浏览代码

update

/siyaoH-1.17-PlatformMessage
siyao 4 年前
当前提交
a08a79ab
共有 5 个文件被更改,包括 369 次插入184 次删除
  1. 215
      com.unity.uiwidgets/Runtime/material/flexible_space_bar.cs
  2. 179
      com.unity.uiwidgets/Runtime/material/floating_action_button.cs
  3. 35
      com.unity.uiwidgets/Runtime/material/floating_action_button_location.cs
  4. 114
      com.unity.uiwidgets/Runtime/material/floatting_action_button_theme.cs
  5. 10
      com.unity.uiwidgets/Runtime/material/scaffold.cs

215
com.unity.uiwidgets/Runtime/material/flexible_space_bar.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;

none
}
public enum StretchMode {
zoomBackground,
blurBackground,
fadeTitle,
}
public class FlexibleSpaceBar : StatefulWidget {
public FlexibleSpaceBar(
Key key = null,

EdgeInsets titlePadding = null,
CollapseMode collapseMode = CollapseMode.parallax
CollapseMode collapseMode = CollapseMode.parallax,
List<StretchMode> stretchModes = null
) : base(key: key) {
this.title = title;
this.background = background;

this.stretchModes = stretchModes ?? new List<StretchMode> {StretchMode.zoomBackground};
}
public readonly Widget title;

public readonly bool? centerTitle;
public readonly List<StretchMode> stretchModes;
public readonly EdgeInsets titlePadding;

switch (themeData.platform) {
case RuntimePlatform.IPhonePlayer:
case RuntimePlatform.OSXEditor:
case RuntimePlatform.OSXPlayer:
return true;
default:
return false;

}
public override Widget build(BuildContext context) {
FlexibleSpaceBarSettings settings =
(FlexibleSpaceBarSettings) context.inheritFromWidgetOfExactType(typeof(FlexibleSpaceBarSettings));
D.assert(settings != null,
() => "A FlexibleSpaceBar must be wrapped in the widget returned by FlexibleSpaceBar.createSettings().");
return new LayoutBuilder(
builder: (BuildContext _context, BoxConstraints constraints) => {
FlexibleSpaceBarSettings settings =
_context.dependOnInheritedWidgetOfExactType<FlexibleSpaceBarSettings>();
D.assert(settings != null,
() =>
"A FlexibleSpaceBar must be wrapped in the widget returned by FlexibleSpaceBar.createSettings().");
List<Widget> children = new List<Widget>();
float deltaExtent = settings.maxExtent.Value - settings.minExtent.Value;
List<Widget> children = new List<Widget>();
float deltaExtent = settings.maxExtent.Value - settings.minExtent.Value;
float t = (1.0f - (settings.currentExtent.Value - settings.minExtent.Value) / deltaExtent)
.clamp(0.0f, 1.0f);
float t = (1.0f - (settings.currentExtent.Value - settings.minExtent.Value) / deltaExtent)
.clamp(0.0f, 1.0f);
if (widget.background != null) {
float fadeStart = Mathf.Max(0.0f, 1.0f - material_.kToolbarHeight / deltaExtent);
float fadeEnd = 1.0f;
D.assert(fadeStart <= fadeEnd);
if (widget.background != null) {
float fadeStart = Mathf.Max(0.0f, 1.0f - material_.kToolbarHeight / deltaExtent);
float fadeEnd = 1.0f;
D.assert(fadeStart <= fadeEnd);
float opacity = 1.0f - new Interval(fadeStart, fadeEnd).transform(t);
if (opacity > 0.0f) {
children.Add(new Positioned(
top: _getCollapsePadding(t, settings),
left: 0.0f,
right: 0.0f,
height: settings.maxExtent,
child: new Opacity(
opacity: opacity,
child: widget.background)
)
);
}
}
float opacity = 1.0f - new Interval(fadeStart, fadeEnd).transform(t);
if (opacity > 0.0f) {
float height = settings.maxExtent ?? 0;
if (widget.stretchModes.Contains(StretchMode.zoomBackground) &&
constraints.maxHeight > height) {
height = constraints.maxHeight;
}
children.Add(new Positioned(
top: _getCollapsePadding(t, settings),
left: 0.0f,
right: 0.0f,
height: height,
child: new Opacity(
opacity: opacity,
child: widget.background)
)
);
if (widget.stretchModes.Contains(StretchMode.blurBackground) &&
constraints.maxHeight > settings.maxExtent) {
float blurAmount = (constraints.maxHeight - settings.maxExtent) / 10 ?? 0;
children.Add(Positioned.fill(
child: new BackdropFilter(
child: new Container(
color: Colors.transparent
),
filter: ui.ImageFilter.blur(
sigmaX: blurAmount,
sigmaY: blurAmount
)
)
));
}
}
}
Widget title = null;
if (widget.title != null) {
switch (Application.platform) {
case RuntimePlatform.IPhonePlayer:
title = widget.title;
break;
default:
title = widget.title;
break;
}
}
Widget title = null;
if (widget.title != null) {
switch (Application.platform) {
case RuntimePlatform.IPhonePlayer:
title = widget.title;
break;
default:
title = widget.title;
break;
}
}
if (widget.stretchModes.Contains(StretchMode.fadeTitle) &&
constraints.maxHeight > settings.maxExtent) {
float stretchOpacity =
1 - (((constraints.maxHeight - settings.maxExtent) / 100)?.clamp(0.0f, 1.0f) ?? 0);
title = new Opacity(
opacity: stretchOpacity,
child: title
);
}
ThemeData theme = Theme.of(context);
float toolbarOpacity = settings.toolbarOpacity.Value;
if (toolbarOpacity > 0.0f) {
TextStyle titleStyle = theme.primaryTextTheme.title;
titleStyle = titleStyle.copyWith(
color: titleStyle.color.withOpacity(toolbarOpacity));
ThemeData theme = Theme.of(_context);
float toolbarOpacity = settings.toolbarOpacity.Value;
if (toolbarOpacity > 0.0f) {
TextStyle titleStyle = theme.primaryTextTheme.title;
titleStyle = titleStyle.copyWith(
color: titleStyle.color.withOpacity(toolbarOpacity));
bool effectiveCenterTitle = _getEffectiveCenterTitle(theme).Value;
EdgeInsets padding = widget.titlePadding ??
EdgeInsets.only(
left: effectiveCenterTitle ? 0.0f : 72.0f,
bottom: 16.0f
);
float scaleValue = new FloatTween(begin: 1.5f, end: 1.0f).lerp(t);
Matrix4 scaleTransform = Matrix4.diagonal3Values(scaleValue, scaleValue, 1);
Alignment titleAlignment = _getTitleAlignment(effectiveCenterTitle);
bool effectiveCenterTitle = _getEffectiveCenterTitle(theme).Value;
EdgeInsets padding = widget.titlePadding ??
EdgeInsets.only(
left: effectiveCenterTitle ? 0.0f : 72.0f,
bottom: 16.0f
);
float scaleValue = new FloatTween(begin: 1.5f, end: 1.0f).lerp(t);
Matrix4 scaleTransform = Matrix4.diagonal3Values(scaleValue, scaleValue, 1);
Alignment titleAlignment = _getTitleAlignment(effectiveCenterTitle);
children.Add(new Container(
padding: padding,
child: new Transform(
alignment: titleAlignment,
transform: scaleTransform,
child: new Align(
alignment: titleAlignment,
child: new DefaultTextStyle(
style: titleStyle,
child: title)
children.Add(new Container(
padding: padding,
child: new Transform(
alignment: titleAlignment,
transform: scaleTransform,
child: new Align(
alignment: titleAlignment,
child: new DefaultTextStyle(
style: titleStyle,
child: new LayoutBuilder(
builder: (BuildContext __context, BoxConstraints _constraints) => {
return new Container(
width: _constraints.maxWidth / scaleValue,
alignment: titleAlignment,
child: title
);
}
)
)
)
)
)
)
);
}
);
}
return new ClipRect(
child: new Stack(
children: children)
return new ClipRect(
child: new Stack(
children: children)
);
}
);
}
}

float? currentExtent = null,
Widget child = null
) : base(key: key, child: child) {
D.assert(currentExtent != null);
D.assert(child != null);
D.assert(toolbarOpacity != null);
D.assert(minExtent != null && minExtent >= 0);
D.assert(maxExtent != null && maxExtent >= 0);
D.assert(currentExtent != null && currentExtent >= 0);
D.assert(toolbarOpacity >= 0.0);
D.assert(minExtent <= maxExtent);
D.assert(minExtent <= currentExtent);
D.assert(currentExtent <= maxExtent);
this.toolbarOpacity = toolbarOpacity;
this.minExtent = minExtent;
this.maxExtent = maxExtent;

179
com.unity.uiwidgets/Runtime/material/floating_action_button.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;

using TextStyle = Unity.UIWidgets.painting.TextStyle;
namespace Unity.UIWidgets.material {
static class FloatActionButtonUtils {
public partial class material_ {
public static readonly BoxConstraints _kSizeConstraints = BoxConstraints.tightFor(width: 56.0f, height: 56.0f);
public static readonly BoxConstraints _kMiniSizeConstraints =

}
public class FloatingActionButton : StatelessWidget {
FloatingActionButton(
public FloatingActionButton(
Color focusColor = null,
Color hoverColor = null,
Color splashColor = null,
float? focusElevation = null,
float? hoverElevation = null,
float? highlightElevation = null,
float? disabledElevation = null,
VoidCallback onPressed = null,

FocusNode focusNode = null,
bool autofocus = false,
D.assert(focusElevation == null || focusElevation >= 0.0);
D.assert(hoverElevation == null || hoverElevation >= 0.0);
D.assert(highlightElevation == null || highlightElevation >= 0.0f);
D.assert(disabledElevation == null || disabledElevation >= 0.0f);
heroTag = heroTag ?? new _DefaultHeroTag();

this.backgroundColor = backgroundColor;
this.focusColor = focusColor;
this.hoverColor = hoverColor;
this.splashColor = splashColor;
this.focusElevation = focusElevation;
this.hoverElevation = hoverElevation;
this.focusNode = focusNode;
this.autofocus = autofocus;
? FloatActionButtonUtils._kMiniSizeConstraints
: FloatActionButtonUtils._kSizeConstraints);
}
public FloatingActionButton(
Key key = null,
Widget child = null,
string tooltip = null,
Color foregroundColor = null,
Color backgroundColor = null,
object heroTag = null,
float elevation = 6.0f,
float highlightElevation = 12.0f,
VoidCallback onPressed = null,
bool mini = false,
ShapeBorder shape = null,
Clip clipBehavior = Clip.none,
MaterialTapTargetSize? materialTapTargetSize = null,
bool isExtended = false
) : this(key: key,
child: child,
tooltip: tooltip,
foregroundColor: foregroundColor,
backgroundColor: backgroundColor,
heroTag: heroTag,
elevation: elevation,
highlightElevation: highlightElevation,
onPressed: onPressed,
mini: mini,
shape: shape,
clipBehavior: clipBehavior,
materialTapTargetSize: materialTapTargetSize,
isExtended: isExtended,
_sizeConstraints: null) {
? material_._kMiniSizeConstraints
: material_._kSizeConstraints);
}
public static FloatingActionButton extended(

Color backgroundColor = null,
Color focusColor = null,
Color hoverColor = null,
float? focusElevation = null,
float? hoverElevation = null,
float? splashColor = null,
float? highlightElevation = null,
float? disabledElevation = null,
VoidCallback onPressed = null,

Clip clipBehavior = Clip.none,
FocusNode focusNode = null,
bool autofocus = false,
D.assert(focusElevation == null || focusElevation >= 0.0);
D.assert(hoverElevation == null || hoverElevation >= 0.0);
BoxConstraints _sizeConstraints = FloatActionButtonUtils._kExtendedSizeConstraints;
BoxConstraints _sizeConstraints = material_._kExtendedSizeConstraints;
bool mini = false;
Widget child = new _ChildOverflowBox(
child: new Row(

public readonly Color backgroundColor;
public readonly Color focusColor;
public readonly Color hoverColor;
public readonly Color splashColor;
public readonly object heroTag;
public readonly VoidCallback onPressed;

public readonly float? focusElevation;
public readonly float? hoverElevation;
public readonly float? highlightElevation;
public readonly float? disabledElevation;

public readonly bool isExtended;
public readonly FocusNode focusNode;
public readonly bool autofocus;
const float _defaultFocusElevation = 8;
const float _defaultHoverElevation = 10;
const float _defaultElevation = 6;
const float _defaultHighlightElevation = 12;
readonly ShapeBorder _defaultShape = new CircleBorder();

ThemeData theme = Theme.of(context);
FloatingActionButtonThemeData floatingActionButtonTheme = theme.floatingActionButtonTheme;
if (this.foregroundColor == null && floatingActionButtonTheme.foregroundColor == null) {
bool accentIsDark = theme.accentColorBrightness == Brightness.dark;
Color defaultAccentIconThemeColor = accentIsDark ? Colors.white : Colors.black;
if (theme.accentIconTheme.color != defaultAccentIconThemeColor) {
Debug.Log(
"Warning: " +
"The support for configuring the foreground color of " +
"FloatingActionButtons using ThemeData.accentIconTheme " +
"has been deprecated. Please use ThemeData.floatingActionButtonTheme " +
"instead. "
);
}
}
Color foregroundColor = this.foregroundColor
?? floatingActionButtonTheme.foregroundColor
?? theme.colorScheme.onSecondary;
Color foregroundColor = this.foregroundColor
?? floatingActionButtonTheme.foregroundColor
?? theme.accentIconTheme.color
?? theme.colorScheme.onSecondary;
Color focusColor = this.focusColor
?? floatingActionButtonTheme.focusColor
?? theme.focusColor;
Color hoverColor = this.hoverColor
?? floatingActionButtonTheme.hoverColor
?? theme.hoverColor;
Color splashColor = this.splashColor
?? floatingActionButtonTheme.splashColor
?? theme.splashColor;
float focusElevation = this.focusElevation
?? floatingActionButtonTheme.focusElevation
?? _defaultFocusElevation;
float hoverElevation = this.hoverElevation
?? floatingActionButtonTheme.hoverElevation
?? _defaultHoverElevation;
TextStyle textStyle = theme.accentTextTheme.button.copyWith(
TextStyle textStyle = theme.textTheme.button.copyWith(
color: foregroundColor,
letterSpacing: 1.2f
);

Widget result = null;
if (child != null) {
result = IconTheme.merge(
data: new IconThemeData(
color: foregroundColor),
child: child
);
}
result = new RawMaterialButton(
Widget result = new RawMaterialButton(
focusElevation: focusElevation,
hoverElevation: hoverElevation,
focusColor: focusColor,
hoverColor: hoverColor,
splashColor: splashColor,
child: result);
focusNode: focusNode,
autofocus: autofocus,
child: child
);
child: result);
child: result
);
child: result);
child: result
);
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new ObjectFlagProperty<VoidCallback>("onPressed", onPressed, ifNull: "disabled"));
properties.add(new StringProperty("tooltip", tooltip, defaultValue: null));
properties.add(new ColorProperty("foregroundColor", foregroundColor, defaultValue: null));
properties.add(new ColorProperty("backgroundColor", backgroundColor, defaultValue: null));
properties.add(new ColorProperty("focusColor", focusColor, defaultValue: null));
properties.add(new ColorProperty("hoverColor", hoverColor, defaultValue: null));
properties.add(new ColorProperty("splashColor", splashColor, defaultValue: null));
properties.add(new ObjectFlagProperty<object>("heroTag", heroTag, ifPresent: "hero"));
properties.add(new FloatProperty("elevation", elevation, defaultValue: null));
properties.add(new FloatProperty("focusElevation", focusElevation, defaultValue: null));
properties.add(new FloatProperty("hoverElevation", hoverElevation, defaultValue: null));
properties.add(new FloatProperty("highlightElevation", highlightElevation, defaultValue: null));
properties.add(new FloatProperty("disabledElevation", disabledElevation, defaultValue: null));
properties.add(new DiagnosticsProperty<ShapeBorder>("shape", shape, defaultValue: null));
properties.add(new DiagnosticsProperty<FocusNode>("focusNode", focusNode, defaultValue: null));
properties.add(new FlagProperty("isExtended", value: isExtended, ifTrue: "extended"));
properties.add(new DiagnosticsProperty<MaterialTapTargetSize?>("materialTapTargetSize",
materialTapTargetSize, defaultValue: null));
}
}
class _ChildOverflowBox : SingleChildRenderObjectWidget {

}
public override void updateRenderObject(BuildContext context, RenderObject renderObject) {
if (renderObject is _RenderChildOverflowBox renderChildOverflowBox) {
renderChildOverflowBox.textDirection = Directionality.of(context);
}
}
}

}
protected override void performLayout() {
BoxConstraints constraints = this.constraints;
if (child != null) {
child.layout(new BoxConstraints(), parentUsesSize: true);
size = new Size(

35
com.unity.uiwidgets/Runtime/material/floating_action_button_location.cs


using System;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;
public static class FloatingActionButtonLocationUtils {
public partial class material_ {
public const float kFloatingActionButtonMargin = 16.0f;
public static readonly TimeSpan kFloatingActionButtonSegue = new TimeSpan(0, 0, 0, 0, 200);

public abstract Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry);
public override string ToString() {
return GetType().ToString();
return foundation_.objectRuntimeType(this, "FloatingActionButtonLocation");
}
}

float bottomSheetHeight = scaffoldGeometry.bottomSheetSize.height;
float fabHeight = scaffoldGeometry.floatingActionButtonSize.height;
float snackBarHeight = scaffoldGeometry.snackBarSize.height;
float fabY = contentBottom - fabHeight - FloatingActionButtonLocationUtils.kFloatingActionButtonMargin;
float fabY = contentBottom - fabHeight - material_.kFloatingActionButtonMargin;
FloatingActionButtonLocationUtils.kFloatingActionButtonMargin);
material_.kFloatingActionButtonMargin);
}
if (bottomSheetHeight > 0.0f) {

}
public override Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) {
float fabX = FloatingActionButtonLocationUtils._endOffset(scaffoldGeometry);
float fabX = material_._endOffset(scaffoldGeometry);
float contentBottom = scaffoldGeometry.contentBottom;
float bottomSheetHeight = scaffoldGeometry.bottomSheetSize.height;

float fabY = contentBottom - fabHeight - FloatingActionButtonLocationUtils.kFloatingActionButtonMargin;
float fabY = contentBottom - fabHeight - material_.kFloatingActionButtonMargin;
FloatingActionButtonLocationUtils.kFloatingActionButtonMargin);
material_.kFloatingActionButtonMargin);
}
if (bottomSheetHeight > 0.0f) {

if (snackBarHeight > 0.0f) {
fabY = Mathf.Min(fabY,
contentBottom - snackBarHeight - fabHeight -
FloatingActionButtonLocationUtils.kFloatingActionButtonMargin);
material_.kFloatingActionButtonMargin);
}
if (bottomSheetHeight > 0.0f) {

}
public override Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) {
float fabX = FloatingActionButtonLocationUtils._endOffset(scaffoldGeometry);
float fabX = material_._endOffset(scaffoldGeometry);
return new Offset(fabX, getDockedY(scaffoldGeometry));
}

}
public override Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) {
return new Offset(FloatingActionButtonLocationUtils._startOffset(scaffoldGeometry),
FloatingActionButtonLocationUtils._straddleAppBar(scaffoldGeometry));
return new Offset(material_._startOffset(scaffoldGeometry),
material_._straddleAppBar(scaffoldGeometry));
}
public override string ToString() {

}
public override Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) {
return new Offset(FloatingActionButtonLocationUtils._startOffset(scaffoldGeometry, offset: 4.0f),
FloatingActionButtonLocationUtils._straddleAppBar(scaffoldGeometry));
return new Offset(material_._startOffset(scaffoldGeometry, offset: 4.0f),
material_._straddleAppBar(scaffoldGeometry));
}
public override string ToString() {

}
public override Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) {
return new Offset(FloatingActionButtonLocationUtils._endOffset(scaffoldGeometry),
FloatingActionButtonLocationUtils._straddleAppBar(scaffoldGeometry));
return new Offset(material_._endOffset(scaffoldGeometry),
material_._straddleAppBar(scaffoldGeometry));
}
public override string ToString() {

}
public override string ToString() {
return GetType().ToString();
return foundation_.objectRuntimeType(this, "FloatingActionButtonAnimator");
}
}

}
static readonly Animatable<float> _rotationTween = new FloatTween(
begin: 1.0f - FloatingActionButtonLocationUtils.kFloatingActionButtonTurnInterval * 2.0f,
begin: 1.0f - material_.kFloatingActionButtonTurnInterval * 2.0f,
end: 1.0f
);

114
com.unity.uiwidgets/Runtime/material/floatting_action_button_theme.cs


using System;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using UnityEngine;

public class FloatingActionButtonThemeData : Diagnosticable {
public class FloatingActionButtonThemeData : Diagnosticable, IEquatable<FloatingActionButtonThemeData> {
Color backgroundColor = null,
Color backgroundColor = null,
Color focusColor = null,
Color hoverColor = null,
Color splashColor = null,
float? focusElevation = null,
float? hoverElevation = null,
this.foregroundColor = foregroundColor;
this.foregroundColor = foregroundColor;
this.focusColor = focusColor;
this.hoverColor = hoverColor;
this.splashColor = splashColor;
this.focusElevation = focusElevation;
this.hoverElevation = hoverElevation;
public readonly Color foregroundColor;
public readonly Color foregroundColor;
public readonly Color focusColor;
public readonly Color hoverColor;
public readonly Color splashColor;
public readonly float? focusElevation;
public readonly float? hoverElevation;
public readonly float? disabledElevation;

public FloatingActionButtonThemeData copyWith(
Color backgroundColor,
Color foregroundColor,
float? elevation,
float? disabledElevation,
float? highlightElevation,
ShapeBorder shape
Color foregroundColor = null,
Color backgroundColor = null,
Color focusColor = null,
Color hoverColor = null,
Color splashColor = null,
float? elevation = null,
float? focusElevation = null,
float? hoverElevation = null,
float? disabledElevation = null,
float? highlightElevation = null,
ShapeBorder shape = null
foregroundColor: foregroundColor ?? this.foregroundColor,
foregroundColor: foregroundColor ?? this.foregroundColor,
focusColor: focusColor ?? this.focusColor,
hoverColor: hoverColor ?? this.hoverColor,
splashColor: splashColor ?? this.splashColor,
focusElevation: focusElevation ?? this.focusElevation,
hoverElevation: hoverElevation ?? this.hoverElevation,
disabledElevation: disabledElevation ?? this.disabledElevation,
highlightElevation: highlightElevation ?? this.highlightElevation,
shape: shape ?? this.shape

public static FloatingActionButtonThemeData lerp(FloatingActionButtonThemeData a, FloatingActionButtonThemeData b,
public static FloatingActionButtonThemeData lerp(FloatingActionButtonThemeData a,
FloatingActionButtonThemeData b,
float t) {
if (a == null && b == null) {
return null;

backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
focusColor: Color.lerp(a?.focusColor, b?.focusColor, t),
hoverColor: Color.lerp(a?.hoverColor, b?.hoverColor, t),
splashColor: Color.lerp(a?.splashColor, b?.splashColor, t),
focusElevation: Mathf.Lerp(a?.focusElevation ?? 0, b?.focusElevation ?? 0, t),
hoverElevation: Mathf.Lerp(a?.hoverElevation ?? 0, b?.hoverElevation ?? 0, t),
disabledElevation: Mathf.Lerp(a?.disabledElevation ?? 0, b?.disabledElevation ?? 0, t),
highlightElevation: Mathf.Lerp(a?.highlightElevation ?? 0, b?.highlightElevation ?? 0, t),
shape: ShapeBorder.lerp(a?.shape, b?.shape, t)

public override int GetHashCode() {
var hashCode = backgroundColor?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ foregroundColor?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ elevation?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ disabledElevation?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ highlightElevation?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ shape?.GetHashCode() ?? 0;
var hashCode = (foregroundColor != null ? foregroundColor.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (backgroundColor != null ? backgroundColor.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (focusColor != null ? focusColor.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (hoverColor != null ? hoverColor.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (splashColor != null ? splashColor.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ elevation.GetHashCode();
hashCode = (hashCode * 397) ^ focusElevation.GetHashCode();
hashCode = (hashCode * 397) ^ hoverElevation.GetHashCode();
hashCode = (hashCode * 397) ^ disabledElevation.GetHashCode();
hashCode = (hashCode * 397) ^ highlightElevation.GetHashCode();
hashCode = (hashCode * 397) ^ (shape != null ? shape.GetHashCode() : 0);
return hashCode;
}

return true;
}
return Equals(backgroundColor, other.backgroundColor)
&& Equals(elevation, other.elevation)
&& Equals(shape, other.shape)
&& Equals(foregroundColor, other.foregroundColor)
&& Equals(disabledElevation, other.disabledElevation)
&& Equals(highlightElevation, other.highlightElevation);
return Equals(foregroundColor, other.foregroundColor) && Equals(backgroundColor, other.backgroundColor) &&
Equals(focusColor, other.focusColor) && Equals(hoverColor, other.hoverColor) &&
Equals(splashColor, other.splashColor) && Nullable.Equals(elevation, other.elevation) &&
Nullable.Equals(focusElevation, other.focusElevation) &&
Nullable.Equals(hoverElevation, other.hoverElevation) &&
Nullable.Equals(disabledElevation, other.disabledElevation) &&
Nullable.Equals(highlightElevation, other.highlightElevation) && Equals(shape, other.shape);
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {

base.debugFillProperties(properties);
FloatingActionButtonThemeData defaultData = new FloatingActionButtonThemeData();
properties.add(new DiagnosticsProperty<Color>("backgroundColor", backgroundColor,
defaultValue: defaultData.backgroundColor));
properties.add(new DiagnosticsProperty<Color>("foregroundColor", foregroundColor,
properties.add(new ColorProperty("foregroundColor", foregroundColor,
properties.add(new DiagnosticsProperty<float?>("elevation", elevation,
defaultValue: defaultData.elevation));
properties.add(new DiagnosticsProperty<float?>("disabledElevation", disabledElevation,
properties.add(new ColorProperty("backgroundColor", backgroundColor,
defaultValue: defaultData.backgroundColor));
properties.add(new ColorProperty("focusColor", focusColor, defaultValue: defaultData.focusColor));
properties.add(new ColorProperty("hoverColor", hoverColor, defaultValue: defaultData.hoverColor));
properties.add(new ColorProperty("splashColor", splashColor, defaultValue: defaultData.splashColor));
properties.add(new FloatProperty("elevation", elevation, defaultValue: defaultData.elevation));
properties.add(
new FloatProperty("focusElevation", focusElevation, defaultValue: defaultData.focusElevation));
properties.add(
new FloatProperty("hoverElevation", hoverElevation, defaultValue: defaultData.hoverElevation));
properties.add(new FloatProperty("disabledElevation", disabledElevation,
properties.add(new DiagnosticsProperty<float?>("highlightElevation", highlightElevation,
properties.add(new FloatProperty("highlightElevation", highlightElevation,
defaultValue: defaultData.highlightElevation));
properties.add(new DiagnosticsProperty<ShapeBorder>("shape", shape, defaultValue: defaultData.shape));
}

10
com.unity.uiwidgets/Runtime/material/scaffold.cs


base.initState();
_previousController = new AnimationController(
duration: FloatingActionButtonLocationUtils.kFloatingActionButtonSegue,
duration: material_.kFloatingActionButtonSegue,
vsync: this);
_previousController.addStatusListener(_handlePreviousAnimationStatusChanged);

}
static readonly Animatable<float> _entranceTurnTween = new FloatTween(
begin: 1.0f - FloatingActionButtonLocationUtils.kFloatingActionButtonTurnInterval,
begin: 1.0f - material_.kFloatingActionButtonTurnInterval,
end: 1.0f
).chain(new CurveTween(curve: Curves.easeIn));

lowerBound: 0.0f,
upperBound: 1.0f,
value: 1.0f,
duration: FloatingActionButtonLocationUtils.kFloatingActionButtonSegue +
FloatingActionButtonLocationUtils.kFloatingActionButtonSegue
duration: material_.kFloatingActionButtonSegue +
material_.kFloatingActionButtonSegue
duration: FloatingActionButtonLocationUtils.kFloatingActionButtonSegue,
duration: material_.kFloatingActionButtonSegue,
vsync: this
);
}

正在加载...
取消
保存