浏览代码

[1.5.4] Upgrade most of the material widgets.

/main
Yuncong Zhang 5 年前
当前提交
79a276e6
共有 20 个文件被更改,包括 594 次插入213 次删除
  1. 2
      Runtime/material/dialog.cs
  2. 3
      Runtime/material/drawer.cs
  3. 4
      Runtime/material/input_border.cs
  4. 279
      Runtime/material/input_decorator.cs
  5. 16
      Runtime/material/list_tile.cs
  6. 6
      Runtime/material/material.cs
  7. 4
      Runtime/material/material_button.cs
  8. 1
      Runtime/material/popup_menu.cs
  9. 3
      Runtime/material/radio.cs
  10. 10
      Runtime/material/slider.cs
  11. 4
      Runtime/material/switch.cs
  12. 9
      Runtime/material/tab_bar_theme.cs
  13. 41
      Runtime/material/tabs.cs
  14. 75
      Runtime/material/text_field.cs
  15. 12
      Runtime/material/text_form_field.cs
  16. 16
      Runtime/material/theme_data.cs
  17. 7
      Runtime/material/user_accounts_drawer_header.cs
  18. 174
      Runtime/widgets/editable_text.cs
  19. 130
      Runtime/material/floatting_action_button_theme.cs
  20. 11
      Runtime/material/floatting_action_button_theme.cs.meta

2
Runtime/material/dialog.cs


) {
D.assert(MaterialD.debugCheckHasMaterialLocalizations(context));
ThemeData theme = Theme.of(context, shadowThemeOnly: true);
ThemeData theme = Theme.of(context, shadowThemeOnly: true);
Widget pageChild = new Builder(builder: builder);
return new SafeArea(
child: new Builder(

3
Runtime/material/drawer.cs


Widget child = null,
DrawerAlignment? alignment = null,
DrawerCallback drawerCallback = null,
DragStartBehavior? dragStartBehavior = null
DragStartBehavior dragStartBehavior = DragStartBehavior.start
D.assert(dragStartBehavior != null);
this.child = child;
this.alignment = alignment ?? DrawerAlignment.start;
this.drawerCallback = drawerCallback;

4
Runtime/material/input_border.cs


const float cornerArcSweep = Mathf.PI / 2.0f;
float tlCornerArcSweep = start < center.tlRadiusX
? Mathf.Asin(start / center.tlRadiusX)
? Mathf.Asin((start / center.tlRadiusX).clamp(-1.0f, 1.0f))
: Mathf.PI / 2.0f;
Path path = new Path();

}
else {
float extent = MathUtils.lerpFloat(0.0f, gapExtent + this.gapPadding * 2.0f, gapPercentage);
Path path = this._gapBorderPath(canvas, center, gapStart - this.gapPadding, extent);
Path path = this._gapBorderPath(canvas, center, Mathf.Max(0.0f,gapStart - this.gapPadding), extent);
canvas.drawPath(path, paint);
}
}

279
Runtime/material/input_decorator.cs


public _RenderDecoration(
_Decoration decoration,
TextBaseline? textBaseline,
bool isFocused
bool isFocused,
bool expands
) {
D.assert(decoration != null);
D.assert(textBaseline != null);

this._expands = expands;
public const float subtextGap = 8.0f;
public readonly Dictionary<_DecorationSlot, RenderBox> slotToChild =
new Dictionary<_DecorationSlot, RenderBox>();

bool _isFocused;
public bool expands {
get { return this._expands; }
set {
if (this._expands == value) {
return;
}
this._expands = value;
this.markNeedsLayout();
}
}
bool _expands = false;
public override void attach(object owner) {
base.attach(owner);
foreach (RenderBox child in this._children) {

get { return this.decoration.contentPadding; }
}
float _layoutLineBox(RenderBox box, BoxConstraints constraints) {
if (box == null) {
return 0.0f;
}
box.layout(constraints, parentUsesSize: true);
float baseline = box.getDistanceToBaseline(this.textBaseline.Value).Value;
D.assert(baseline >= 0.0f);
return baseline;
}
float aboveBaseline = 0.0f;
float belowBaseline = 0.0f;
boxToBaseline[this.prefix] = this._layoutLineBox(this.prefix, boxConstraints);
boxToBaseline[this.suffix] = this._layoutLineBox(this.suffix, boxConstraints);
boxToBaseline[this.icon] = this._layoutLineBox(this.icon, boxConstraints);
boxToBaseline[this.prefixIcon] = this._layoutLineBox(this.prefixIcon, boxConstraints);
boxToBaseline[this.suffixIcon] = this._layoutLineBox(this.suffixIcon, boxConstraints);
void layoutLineBox(RenderBox box) {
if (box == null) {
return;
}
float inputWidth = Math.Max(0.0f, this.constraints.maxWidth - (
_boxSize(this.icon).width
+ this.contentPadding.left
+ _boxSize(this.prefixIcon).width
+ _boxSize(this.prefix).width
+ _boxSize(this.suffix).width
+ _boxSize(this.suffixIcon).width
+ this.contentPadding.right));
boxToBaseline[this.label] = this._layoutLineBox(this.label,
boxConstraints.copyWith(maxWidth: inputWidth)
);
boxToBaseline[this.hint] = this._layoutLineBox(this.hint,
boxConstraints.copyWith(minWidth: inputWidth, maxWidth: inputWidth)
);
boxToBaseline[this.counter] = this._layoutLineBox(this.counter, boxConstraints);
box.layout(boxConstraints, parentUsesSize: true);
float baseline = box.getDistanceToBaseline(this.textBaseline ?? 0.0f) ?? 0.0f;
D.assert(baseline >= 0.0f);
boxToBaseline[box] = baseline;
aboveBaseline = Mathf.Max(baseline, aboveBaseline);
belowBaseline = Mathf.Max(box.size.height - baseline, belowBaseline);
}
boxToBaseline[this.helperError] = this._layoutLineBox(this.helperError,
boxConstraints.copyWith(
maxWidth: Math.Max(0.0f, boxConstraints.maxWidth
- _boxSize(this.icon).width
- _boxSize(this.counter).width
- this.contentPadding.horizontal
)
)
);
layoutLineBox(this.prefix);
layoutLineBox(this.suffix);
float labelHeight = this.label == null
? 0
: this.decoration.floatingLabelHeight;
float topHeight = this.decoration.border.isOutline
? Math.Max(labelHeight - boxToBaseline[this.label], 0)
: labelHeight;
float counterHeight = this.counter == null
? 0
: boxToBaseline[this.counter] + subtextGap;
bool helperErrorExists = this.helperError?.size != null
&& this.helperError.size.height > 0;
float helperErrorHeight = !helperErrorExists
? 0
: this.helperError.size.height + subtextGap;
float bottomHeight = Math.Max(
counterHeight,
helperErrorHeight
);
boxToBaseline[this.input] = this._layoutLineBox(this.input,
boxConstraints.deflate(EdgeInsets.only(
top: this.contentPadding.top + topHeight,
bottom: this.contentPadding.bottom + bottomHeight
)).copyWith(
minWidth: inputWidth,
maxWidth: inputWidth
)
);
if (this.icon != null) {
this.icon.layout(boxConstraints, parentUsesSize: true);
}
// The field can be occupied by a hint or by the input itself
float hintHeight = this.hint == null ? 0 : this.hint.size.height;
float inputDirectHeight = this.input == null ? 0 : this.input.size.height;
float inputHeight = Math.Max(hintHeight, inputDirectHeight);
float inputInternalBaseline = Math.Max(
boxToBaseline[this.input],
boxToBaseline[this.hint]
);
if (this.prefixIcon != null) {
this.prefixIcon.layout(boxConstraints, parentUsesSize: true);
}
// Calculate the amount that prefix/suffix affects height above and below
// the input.
float prefixHeight = this.prefix == null ? 0 : this.prefix.size.height;
float suffixHeight = this.suffix == null ? 0 : this.suffix.size.height;
float fixHeight = Math.Max(
boxToBaseline[this.prefix],
boxToBaseline[this.suffix]
);
float fixAboveInput = Math.Max(0, fixHeight - inputInternalBaseline);
float fixBelowBaseline = Math.Max(
prefixHeight - boxToBaseline[this.prefix],
suffixHeight - boxToBaseline[this.suffix]
);
float fixBelowInput = Math.Max(
0,
fixBelowBaseline - (inputHeight - inputInternalBaseline)
);
// Calculate the height of the input text container.
float prefixIconHeight = this.prefixIcon == null ? 0 : this.prefixIcon.size.height;
float suffixIconHeight = this.suffixIcon == null ? 0 : this.suffixIcon.size.height;
float fixIconHeight = Math.Max(prefixIconHeight, suffixIconHeight);
float contentHeight = Math.Max(
fixIconHeight,
topHeight
+ this.contentPadding.top
+ fixAboveInput
+ inputHeight
+ fixBelowInput
+ this.contentPadding.bottom
);
float maxContainerHeight = boxConstraints.maxHeight - bottomHeight;
float containerHeight = this.expands
? maxContainerHeight
: Math.Min(contentHeight, maxContainerHeight);
if (this.suffixIcon != null) {
this.suffixIcon.layout(boxConstraints, parentUsesSize: true);
}
// Always position the prefix/suffix in the same place (baseline).
float overflow = Math.Max(0, contentHeight - maxContainerHeight);
float baselineAdjustment = fixAboveInput - overflow;
float inputWidth = Mathf.Max(0.0f, this.constraints.maxWidth - (
_boxSize(this.icon).width
+ this.contentPadding.left
+ _boxSize(this.prefixIcon).width
+ _boxSize(this.prefix).width
+ _boxSize(this.suffix).width
+ _boxSize(this.suffixIcon).width
+ this.contentPadding.right));
// The baselines that will be used to draw the actual input text content.
float inputBaseline = this.contentPadding.top
+ topHeight
+ inputInternalBaseline
+ baselineAdjustment;
// The text in the input when an outline border is present is centered
// within the container less 2.0 dps at the top to account for the vertical
// space occupied by the floating label.
float outlineBaseline = inputInternalBaseline
+ baselineAdjustment / 2
+ (containerHeight - (2.0f + inputHeight)) / 2.0f;
boxConstraints = boxConstraints.copyWith(maxWidth: inputWidth);
if (this.label != null) {
if (this.decoration.alignLabelWithHint == true) {
layoutLineBox(this.label);
}
else {
this.label.layout(boxConstraints, parentUsesSize: true);
}
// Find the positions of the text below the input when it exists.
float subtextCounterBaseline = 0;
float subtextHelperBaseline = 0;
float subtextCounterHeight = 0;
float subtextHelperHeight = 0;
if (this.counter != null) {
subtextCounterBaseline =
containerHeight + subtextGap + boxToBaseline[this.counter];
subtextCounterHeight = this.counter.size.height + subtextGap;
boxConstraints = boxConstraints.copyWith(minWidth: inputWidth);
layoutLineBox(this.hint);
layoutLineBox(this.input);
float inputBaseline = this.contentPadding.top + aboveBaseline;
float containerHeight = this.contentPadding.top
+ aboveBaseline
+ belowBaseline
+ this.contentPadding.bottom;
if (this.label != null) {
containerHeight += this.decoration.floatingLabelHeight;
inputBaseline += this.decoration.floatingLabelHeight;
if (helperErrorExists) {
subtextHelperBaseline =
containerHeight + subtextGap + boxToBaseline[this.helperError];
subtextHelperHeight = helperErrorHeight;
containerHeight = Mathf.Max(
containerHeight,
Mathf.Max(
_boxSize(this.suffixIcon).height,
_boxSize(this.prefixIcon).height));
float outlineBaseline = aboveBaseline +
(containerHeight - (2.0f + aboveBaseline + belowBaseline)) / 2.0f;
float subtextBaseline = 0.0f;
float subtextHeight = 0.0f;
if (this.helperError != null || this.counter != null) {
boxConstraints = layoutConstraints.loosen();
aboveBaseline = 0.0f;
belowBaseline = 0.0f;
layoutLineBox(this.counter);
boxConstraints = boxConstraints.copyWith(
maxWidth: Mathf.Max(0.0f, boxConstraints.maxWidth
- _boxSize(this.icon).width
- _boxSize(this.counter).width
- this.contentPadding.horizontal
)
);
layoutLineBox(this.helperError);
if (aboveBaseline + belowBaseline > 0.0f) {
const float subtextGap = 8.0f;
subtextBaseline = containerHeight + subtextGap + aboveBaseline;
subtextHeight = subtextGap + aboveBaseline + belowBaseline;
}
}
float subtextBaseline = Math.Max(
subtextCounterBaseline,
subtextHelperBaseline
);
float subtextHeight = Math.Max(
subtextCounterHeight,
subtextHelperHeight
);
return new _RenderDecorationLayout(
boxToBaseline: boxToBaseline,

protected override float computeMinIntrinsicHeight(float width) {
float subtextHeight = this._lineHeight(width, new List<RenderBox> {this.helperError, this.counter});
if (subtextHeight > 0.0f) {
subtextHeight += 8.0f;
subtextHeight += subtextGap;
}
return this.contentPadding.top

}
protected override float? computeDistanceToActualBaseline(TextBaseline baseline) {
D.assert(false, () => "not implemented");
return 0.0f;
return _boxParentData(this.input).offset.dy + this.input.getDistanceToActualBaseline(baseline);
}
Matrix3 _labelTransform;

Key key = null,
_Decoration decoration = null,
TextBaseline? textBaseline = null,
bool isFocused = false
bool isFocused = false,
bool? expands = null
D.assert(expands != null);
this.expands = expands.Value;
public readonly bool expands;
public override Element createElement() {
return new _RenderDecorationElement(this);

return new _RenderDecoration(
decoration: this.decoration,
textBaseline: this.textBaseline,
isFocused: this.isFocused
isFocused: this.isFocused,
expands: this.expands
);
}

renderObject.textBaseline = this.textBaseline;
renderObject.isFocused = this.isFocused;
renderObject.expands = this.expands;
}
}

TextStyle baseStyle = null,
TextAlign? textAlign = null,
bool isFocused = false,
bool expands = false,
bool isEmpty = false,
Widget child = null
) : base(key: key) {

this.isFocused = isFocused;
this.expands = expands;
this.isEmpty = isEmpty;
this.child = child;
}

public readonly TextAlign? textAlign;
public readonly bool isFocused;
public readonly bool expands;
public readonly bool isEmpty;

properties.add(new DiagnosticsProperty<InputDecoration>("decoration", this.decoration));
properties.add(new DiagnosticsProperty<TextStyle>("baseStyle", this.baseStyle, defaultValue: null));
properties.add(new DiagnosticsProperty<bool>("isFocused", this.isFocused));
properties.add(new DiagnosticsProperty<bool>("expands", this.expands));
properties.add(new DiagnosticsProperty<bool>("isEmpty", this.isEmpty));
}
}

container: container
),
textBaseline: textBaseline,
isFocused: this.isFocused
isFocused: this.isFocused,
expands: this.widget.expands
);
}
}

bool? alignLabelWithHint = null
) {
D.assert(enabled != null);
D.assert(!(prefix != null && prefixText != null), () => "Declaring both prefix and prefixText is not supported");
D.assert(!(suffix != null && suffixText != null), () => "Declaring both suffix and suffixText is not supported");
D.assert(!(prefix != null && prefixText != null),
() => "Declaring both prefix and prefixText is not supported");
D.assert(!(suffix != null && suffixText != null),
() => "Declaring both suffix and suffixText is not supported");
this.isCollapsed = false;
this.icon = icon;
this.labelText = labelText;

16
Runtime/material/list_tile.cs


bool hasTrailing = this.trailing != null;
bool isTwoLine = !this.isThreeLine && hasSubtitle;
bool isOneLine = !this.isThreeLine && !hasSubtitle;
BoxConstraints maxIconHeightConstrains = new BoxConstraints(
maxHeight: this.isDense ? 48.0f: 56.0f
);
BoxConstraints iconConstraints = looseConstraints.enforce(maxIconHeightConstrains);
Size leadingSize = _layoutBox(this.leading, looseConstraints);
Size trailingSize = _layoutBox(this.trailing, looseConstraints);
Size leadingSize = _layoutBox(this.leading, iconConstraints);
Size trailingSize = _layoutBox(this.trailing, iconConstraints);
D.assert(
tileWidth != leadingSize.width,
() => "Leading widget consumes entire width. Please use a sized widget."
);
D.assert(
tileWidth != trailingSize.width,
() => "Trailing widget consumes entire width. Please use a sized widget."
);
float titleStart = hasLeading
? Mathf.Max(_minLeadingWidth, leadingSize.width) + _horizontalTitleGap

6
Runtime/material/material.cs


public override Widget build(BuildContext context) {
Color backgroundColor = this._getBackgroundColor(context);
D.assert(backgroundColor != null || this.widget.type == MaterialType.transparency);
D.assert(backgroundColor != null || this.widget.type == MaterialType.transparency,
() => "If Material type is not MaterialType.transparency, a color must" +
"either be passed in through the 'color' property, or be defined " +
"in the theme (ex. canvasColor != null if type is set to " +
"MaterialType.canvas");
Widget contents = this.widget.child;
if (contents != null) {
contents = new AnimatedDefaultTextStyle(

4
Runtime/material/material_button.cs


return new RawMaterialButton(
onPressed: this.onPressed,
onHighlightChanged: this.onHighlightChanged,
fillColor: this.color,
fillColor: buttonTheme.getFillColor(this),
textStyle: theme.textTheme.button.copyWith(color: buttonTheme.getTextColor(this)),
highlightColor: this.highlightColor ?? theme.highlightColor,
splashColor: this.splashColor ?? theme.splashColor,

constraints: buttonTheme.getConstraints(this).copyWith(
minWidth: this.minWidth,
minHeight: this.height),
shape: buttonTheme.shape,
shape: buttonTheme.getShape(this),
clipBehavior: this.clipBehavior ?? Clip.none,
animationDuration: buttonTheme.getAnimationDuration(this),
child: this.child,

1
Runtime/material/popup_menu.cs


float elevation = 8.0f
) {
D.assert(context != null);
D.assert(position != null);
D.assert(items != null && items.isNotEmpty());
D.assert(MaterialD.debugCheckHasMaterialLocalizations(context));

3
Runtime/material/radio.cs


public override void paint(PaintingContext context, Offset offset) {
Canvas canvas = context.canvas;
this.paintRadialReaction(canvas, offset,
new Offset(Constants.kRadialReactionRadius, Constants.kRadialReactionRadius));
this.paintRadialReaction(canvas, offset, this.size.center(Offset.zero));
Offset center = (offset & this.size).center;
Color radioColor = this.onChanged != null ? this.activeColor : this.inactiveColor;

10
Runtime/material/slider.cs


sliderTheme: this._sliderTheme
).width;
if ((trackRect.width - tickMarkWidth) / this.divisions.Value >= 3.0f * tickMarkWidth) {
float adjustedTrackWidth = trackRect.width - tickMarkWidth;
if (adjustedTrackWidth / this.divisions.Value >= 3.0f * tickMarkWidth) {
float dy = trackRect.center.dy;
float tickX = trackRect.left +
tickValue * (trackRect.width - tickMarkWidth) + tickMarkWidth / 2;
float tickY = trackRect.center.dy;
Offset tickMarkOffset = new Offset(tickX, tickY);
float dx = trackRect.left + tickValue * adjustedTrackWidth + tickMarkWidth / 2;
Offset tickMarkOffset = new Offset(dx, dy);
this._sliderTheme.tickMarkShape.paint(
context,
tickMarkOffset,

4
Runtime/material/switch.cs


ImageProvider activeThumbImage = null,
ImageProvider inactiveThumbImage = null,
MaterialTapTargetSize? materialTapTargetSize = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.down
DragStartBehavior dragStartBehavior = DragStartBehavior.start
) : this(
key: key,
value: value,

ImageProvider inactiveThumbImage = null,
MaterialTapTargetSize? materialTapTargetSize = null,
_SwitchType switchType = _SwitchType.material,
DragStartBehavior dragStartBehavior = DragStartBehavior.down
DragStartBehavior dragStartBehavior = DragStartBehavior.start
) : base(key: key) {
D.assert(value != null);
this.value = value.Value;

9
Runtime/material/tab_bar_theme.cs


Decoration indicator = null,
TabBarIndicatorSize? indicatorSize = null,
Color labelColor = null,
EdgeInsets labelPadding = null,
TextStyle labelStyle = null,
Color unselectedLabelColor = null,
TextStyle unselectedLabelStyle = null) {

this.labelPadding = labelPadding;
this.labelStyle = labelStyle;
this.unselectedLabelColor = unselectedLabelColor;
this.unselectedLabelStyle = unselectedLabelStyle;

public readonly Color labelColor;
public readonly EdgeInsets labelPadding;
public readonly TextStyle labelStyle;
public readonly Color unselectedLabelColor;

Decoration indicator = null,
TabBarIndicatorSize? indicatorSize = null,
Color labelColor = null,
EdgeInsets labelPadding = null,
TextStyle labelStyle = null,
Color unselectedLabelColor = null,
TextStyle unselectedLabelStyle = null

indicatorSize: indicatorSize ?? this.indicatorSize,
labelColor: labelColor ?? this.labelColor,
labelPadding: labelPadding ?? this.labelPadding,
labelStyle: labelStyle ?? this.labelStyle,
unselectedLabelColor: unselectedLabelColor ?? this.unselectedLabelColor,
unselectedLabelStyle: unselectedLabelStyle ?? this.unselectedLabelStyle);

indicator: Decoration.lerp(a.indicator, b.indicator, t),
indicatorSize: t < 0.5 ? a.indicatorSize : b.indicatorSize,
labelColor: Color.lerp(a.labelColor, b.labelColor, t),
labelPadding: EdgeInsets.lerp(a.labelPadding, b.labelPadding, t),
labelStyle: TextStyle.lerp(a.labelStyle, b.labelStyle, t),
unselectedLabelColor: Color.lerp(a.unselectedLabelColor, b.unselectedLabelColor, t),
unselectedLabelStyle: TextStyle.lerp(a.unselectedLabelStyle, b.unselectedLabelStyle, t)

var hashCode = this.indicator != null ? this.indicator.GetHashCode() : 0;
hashCode = (hashCode * 397) ^ (this.indicatorSize != null ? this.indicatorSize.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.labelColor != null ? this.labelColor.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.labelPadding != null ? this.labelPadding.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.labelStyle != null ? this.labelStyle.GetHashCode() : 0);
hashCode = (hashCode * 397) ^
(this.unselectedLabelColor != null ? this.unselectedLabelColor.GetHashCode() : 0);

return other.indicator == this.indicator &&
other.indicatorSize == this.indicatorSize &&
other.labelColor == this.labelColor &&
other.labelPadding == this.labelPadding &&
other.unselectedLabelColor == this.unselectedLabelColor;
}

41
Runtime/material/tabs.cs


protected internal override Widget build(BuildContext context) {
ThemeData themeData = Theme.of(context);
TabBarTheme tabBarTheme = TabBarTheme.of(context);
TextStyle defaultStyle = this.labelStyle ?? tabBarTheme.labelStyle ?? themeData.primaryTextTheme.body2;
TextStyle defaultUnselectedStyle = this.unselectedLabelStyle
Animation<float> animation = (Animation<float>) this.listenable;
TextStyle defaultStyle = (this.labelStyle
?? tabBarTheme.labelStyle
?? themeData.primaryTextTheme.body2).copyWith(inherit: true);
TextStyle defaultUnselectedStyle = (this.unselectedLabelStyle
?? this.labelStyle ?? themeData.primaryTextTheme.body2;
Animation<float> animation = (Animation<float>) this.listenable;
?? this.labelStyle
?? themeData.primaryTextTheme.body2).copyWith(inherit: true);
TextStyle textStyle = this.selected
? TextStyle.lerp(defaultStyle, defaultUnselectedStyle, animation.value)
: TextStyle.lerp(defaultUnselectedStyle, defaultStyle, animation.value);

EdgeInsets labelPadding = null,
Color unselectedLabelColor = null,
TextStyle unselectedLabelStyle = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
ValueChanged<int> onTap = null
) : base(key: key) {
indicatorPadding = indicatorPadding ?? EdgeInsets.zero;

return true;
});
D.assert(() => {
if (newController.length != this.widget.tabs.Count) {
throw new UIWidgetsError(
$"Controller's length property {newController.length} does not match the\n" +
$"number of tab elements {this.widget.tabs.Count} present in TabBar's tabs property."
);
}
return true;
});
if (newController == this._controller) {
return;
}

);
}
TabBarTheme tabBarTheme = TabBarTheme.of(context);
padding: this.widget.labelPadding ?? Constants.kTabLabelPadding,
padding: this.widget.labelPadding ?? tabBarTheme.labelPadding ?? Constants.kTabLabelPadding,
child: new KeyedSubtree(
key: this._tabKeys[i],
child: this.widget.tabs[i]

List<Widget> children = null,
TabController controller = null,
ScrollPhysics physics = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.down
DragStartBehavior dragStartBehavior = DragStartBehavior.start
) : base(key: key) {
D.assert(children != null);
this.children = children;

"TabController using the \"controller\" property, or you must ensure that there " +
"is a DefaultTabController above the " + this.widget.GetType() + ".\n" +
"In this case, there was neither an explicit controller nor a default controller."
);
}
return true;
});
D.assert(() => {
if (newController.length != this.widget.children.Count) {
throw new UIWidgetsError(
$"Controller's length property {newController.length} does not match the\n" +
$"number of elements {this.widget.children.Count} present in TabBarView's children property."
);
}

75
Runtime/material/text_field.cs


bool? isFocused);
public class TextField : StatefulWidget {
public TextField(Key key = null, TextEditingController controller = null, FocusNode focusNode = null,
InputDecoration decoration = null, bool noDecoration = false, TextInputType keyboardType = null,
public TextField(Key key = null,
TextEditingController controller = null,
FocusNode focusNode = null,
InputDecoration decoration = null,
bool noDecoration = false,
TextInputType keyboardType = null,
TextCapitalization textCapitalization = TextCapitalization.none, TextStyle style = null,
TextCapitalization textCapitalization = TextCapitalization.none,
TextStyle style = null,
TextAlign textAlign = TextAlign.left, TextDirection textDirection = TextDirection.ltr,
bool autofocus = false, bool obscureText = false, bool autocorrect = false, int? maxLines = 1,
int? maxLength = null, bool maxLengthEnforced = true, ValueChanged<string> onChanged = null,
TextAlign textAlign = TextAlign.left,
TextDirection textDirection = TextDirection.ltr,
bool autofocus = false,
bool obscureText = false,
bool autocorrect = false,
int? maxLines = 1,
int? minLines = null,
bool expands = false,
int? maxLength = null,
bool maxLengthEnforced = true,
ValueChanged<string> onChanged = null,
ValueChanged<string> onSubmitted = null, List<TextInputFormatter> inputFormatters = null,
bool? enabled = null, float? cursorWidth = 2.0f, Radius cursorRadius = null, Color cursorColor = null,
Brightness? keyboardAppearance = null, EdgeInsets scrollPadding = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
ValueChanged<string> onSubmitted = null,
List<TextInputFormatter> inputFormatters = null,
bool? enabled = null,
float? cursorWidth = 2.0f,
Radius cursorRadius = null,
Color cursorColor = null,
Brightness? keyboardAppearance = null,
EdgeInsets scrollPadding = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
InputCounterWidgetBuilder buildCounter = null
InputCounterWidgetBuilder buildCounter = null,
ScrollPhysics scrollPhysics = null
D.assert(minLines == null || minLines > 0);
D.assert((maxLines == null) || (minLines == null) || (maxLines >= minLines),
() => "minLines can't be greater than maxLines");
D.assert(!expands || (maxLines == null && minLines == null),
() => "minLines and maxLines must be null when expands is true.");
D.assert(maxLength == null || maxLength == TextField.noMaxLength || maxLength > 0);
this.controller = controller;

this.obscureText = obscureText;
this.autocorrect = autocorrect;
this.maxLines = maxLines;
this.minLines = minLines;
this.expands = expands;
this.maxLength = maxLength;
this.maxLengthEnforced = maxLengthEnforced;
this.onChanged = onChanged;

this.scrollPadding = scrollPadding ?? EdgeInsets.all(20.0f);
this.dragStartBehavior = dragStartBehavior;
this.buildCounter = buildCounter;
this.scrollPhysics = scrollPhysics;
}
public readonly TextEditingController controller;

public readonly bool autocorrect;
public readonly int? maxLines;
public readonly int? minLines;
public readonly bool expands;
public const long noMaxLength = -1;

public readonly bool? enableInteractiveSelection;
public readonly DragStartBehavior dragStartBehavior;
public readonly ScrollPhysics scrollPhysics;
public bool selectionEnabled {
get {

properties.add(new DiagnosticsProperty<bool>("obscureText", this.obscureText, defaultValue: false));
properties.add(new DiagnosticsProperty<bool>("autocorrect", this.autocorrect, defaultValue: true));
properties.add(new IntProperty("maxLines", this.maxLines, defaultValue: 1));
properties.add(new IntProperty("minLines", this.minLines, defaultValue: null));
properties.add(new DiagnosticsProperty<bool>("expands", this.expands, defaultValue: false));
properties.add(new IntProperty("maxLength", this.maxLength, defaultValue: null));
properties.add(new FlagProperty("maxLengthEnforced", value: this.maxLengthEnforced, defaultValue: true,
ifFalse: "maxLength not enforced"));

properties.add(new DiagnosticsProperty<Brightness?>("keyboardAppearance", this.keyboardAppearance, defaultValue: null));
properties.add(new DiagnosticsProperty<EdgeInsets>("scrollPadding", this.scrollPadding, defaultValue: EdgeInsets.all(20.0f)));
properties.add(new FlagProperty("selectionEnabled", value: this.selectionEnabled, defaultValue: true, ifFalse: "selection disabled"));
properties.add(new DiagnosticsProperty<ScrollPhysics>("scrollPhysics", this.scrollPhysics, defaultValue: null));
}
}

}
void _handleSelectionChanged(TextSelection selection, SelectionChangedCause cause) {
if (Theme.of(this.context).platform == RuntimePlatform.IPhonePlayer
&& cause == SelectionChangedCause.longPress) {
this._editableTextKey.currentState?.bringIntoView(selection.basePos);
switch (Theme.of(this.context).platform) {
case RuntimePlatform.IPhonePlayer:
if (cause == SelectionChangedCause.longPress) {
this._editableTextKey.currentState?.bringIntoView(selection.basePos);
}
return;
case RuntimePlatform.Android:
break;
}
}

obscureText: this.widget.obscureText,
autocorrect: this.widget.autocorrect,
maxLines: this.widget.maxLines,
minLines: this.widget.minLines,
expands: this.widget.expands,
selectionColor: themeData.textSelectionColor,
selectionControls: this.widget.selectionEnabled ? textSelectionControls : null,
onChanged: this.widget.onChanged,

scrollPadding: this.widget.scrollPadding,
keyboardAppearance: keyboardAppearance,
enableInteractiveSelection: this.widget.enableInteractiveSelection == true,
dragStartBehavior: this.widget.dragStartBehavior
dragStartBehavior: this.widget.dragStartBehavior,
scrollPhysics: this.widget.scrollPhysics
)
);

textAlign: this.widget.textAlign,
isFocused: focusNode.hasFocus,
isEmpty: controller.value.text.isEmpty(),
expands: this.widget.expands,
child: _child
);
},

12
Runtime/material/text_form_field.cs


bool autocorrect = true,
bool autovalidate = false,
bool maxLengthEnforced = true,
int maxLines = 1,
int? maxLines = 1,
int? minLines = null,
bool expands = false,
int? maxLength = null,
VoidCallback onEditingComplete = null,
ValueChanged<string> onFieldSubmitted = null,

autocorrect: autocorrect,
maxLengthEnforced: maxLengthEnforced,
maxLines: maxLines,
minLines: minLines,
expands: expands,
maxLength: maxLength,
onChanged: field.didChange,
onEditingComplete: onEditingComplete,

) {
D.assert(initialValue == null || controller == null);
D.assert(maxLines > 0);
D.assert(maxLines == null || maxLines > 0);
D.assert(minLines == null || minLines > 0);
D.assert((maxLines == null) || (minLines == null) || (maxLines >= minLines),
() => "minLines can't be greater than maxLines");
D.assert(!expands || (maxLines == null && minLines == null),
() => "minLines and maxLines must be null when expands is true.");
D.assert(maxLength == null || maxLength > 0);
this.controller = controller;
}

16
Runtime/material/theme_data.cs


BottomAppBarTheme bottomAppBarTheme = null,
ColorScheme colorScheme = null,
DialogTheme dialogTheme = null,
FloatingActionButtonThemeData floatingActionButtonTheme = null,
Typography typography = null
) {
brightness = brightness ?? Brightness.light;

labelStyle: textTheme.body2
);
dialogTheme = dialogTheme ?? new DialogTheme();
floatingActionButtonTheme = floatingActionButtonTheme ?? new FloatingActionButtonThemeData();
D.assert(brightness != null);
D.assert(primaryColor != null);

D.assert(cardTheme != null);
D.assert(chipTheme != null);
D.assert(dialogTheme != null);
D.assert(floatingActionButtonTheme != null);
this.brightness = brightness ?? Brightness.light;
this.primaryColor = primaryColor;

this.bottomAppBarTheme = bottomAppBarTheme;
this.colorScheme = colorScheme;
this.dialogTheme = dialogTheme;
this.floatingActionButtonTheme = floatingActionButtonTheme;
this.typography = typography;
}

BottomAppBarTheme bottomAppBarTheme = null,
ColorScheme colorScheme = null,
DialogTheme dialogTheme = null,
FloatingActionButtonThemeData floatingActionButtonTheme = null,
Typography typography = null
) {
D.assert(brightness != null);

D.assert(cardTheme != null);
D.assert(chipTheme != null);
D.assert(dialogTheme != null);
D.assert(floatingActionButtonTheme != null);
return new ThemeData(
brightness: brightness,

bottomAppBarTheme: bottomAppBarTheme,
colorScheme: colorScheme,
dialogTheme: dialogTheme,
floatingActionButtonTheme: floatingActionButtonTheme,
typography: typography);
}

public readonly ColorScheme colorScheme;
public readonly DialogTheme dialogTheme;
public readonly FloatingActionButtonThemeData floatingActionButtonTheme;
public readonly Typography typography;

BottomAppBarTheme bottomAppBarTheme = null,
ColorScheme colorScheme = null,
DialogTheme dialogTheme = null,
FloatingActionButtonThemeData floatingActionButtonTheme = null,
Typography typography = null
) {
return raw(

bottomAppBarTheme: bottomAppBarTheme ?? this.bottomAppBarTheme,
colorScheme: colorScheme ?? this.colorScheme,
dialogTheme: dialogTheme ?? this.dialogTheme,
floatingActionButtonTheme: floatingActionButtonTheme ?? this.floatingActionButtonTheme,
typography: typography ?? this.typography
);
}

bottomAppBarTheme: BottomAppBarTheme.lerp(a.bottomAppBarTheme, b.bottomAppBarTheme, t),
colorScheme: ColorScheme.lerp(a.colorScheme, b.colorScheme, t),
dialogTheme: DialogTheme.lerp(a.dialogTheme, b.dialogTheme, t),
floatingActionButtonTheme: FloatingActionButtonThemeData.lerp(a.floatingActionButtonTheme, b.floatingActionButtonTheme, t),
typography: Typography.lerp(a.typography, b.typography, t)
);
}

other.bottomAppBarTheme == this.bottomAppBarTheme &&
other.colorScheme == this.colorScheme &&
other.dialogTheme == this.dialogTheme &&
other.floatingActionButtonTheme == this.floatingActionButtonTheme &&
other.typography == this.typography;
}

hashCode = (hashCode * 397) ^ this.bottomAppBarTheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.colorScheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.dialogTheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.floatingActionButtonTheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.typography.GetHashCode();
this._cachedHashCode = hashCode;

defaultValue: defaultData.colorScheme));
properties.add(new DiagnosticsProperty<DialogTheme>("dialogTheme", this.dialogTheme,
defaultValue: defaultData.dialogTheme));
properties.add(new DiagnosticsProperty<FloatingActionButtonThemeData>("floatingActionButtonTheme",
this.floatingActionButtonTheme, defaultValue: defaultData.floatingActionButtonTheme));
properties.add(new DiagnosticsProperty<Typography>("typography", this.typography,
defaultValue: defaultData.typography));
}

7
Runtime/material/user_accounts_drawer_header.cs


public override void didUpdateWidget(StatefulWidget _oldWidget) {
base.didUpdateWidget(_oldWidget);
_AccountDetails oldWidget = _oldWidget as _AccountDetails;
if (this._animation.status == AnimationStatus.dismissed ||
this._animation.status == AnimationStatus.reverse) {
if (oldWidget.isOpen == this.widget.isOpen) {
return;
}
if(this.widget.isOpen ?? false) {
this._controller.forward();
}
else {

174
Runtime/widgets/editable_text.cs


get { return this.value.text; }
set {
this.value = this.value.copyWith(text: value, selection: TextSelection.collapsed(-1),
this.value = this.value.copyWith(
text: value,
selection: TextSelection.collapsed(-1),
composing: TextRange.empty);
}
}

}
public class EditableText : StatefulWidget {
public readonly TextEditingController controller;
public readonly FocusNode focusNode;
public readonly bool obscureText;
public readonly bool autocorrect;
public readonly TextStyle style;
public StrutStyle strutStyle {
get {
if (this._strutStyle == null) {
return this.style != null
? StrutStyle.fromTextStyle(this.style, forceStrutHeight: true)
: StrutStyle.disabled;
}
return this._strutStyle.inheritFromTextStyle(this.style);
}
}
readonly StrutStyle _strutStyle;
public readonly TextAlign textAlign;
public readonly TextDirection? textDirection;
public readonly TextCapitalization textCapitalization;
public readonly float? textScaleFactor;
public readonly Color cursorColor;
public readonly Color backgroundCursorColor;
public readonly int? maxLines;
public readonly bool autofocus;
public readonly Color selectionColor;
public readonly TextSelectionControls selectionControls;
public readonly TextInputType keyboardType;
public readonly TextInputAction? textInputAction;
public readonly ValueChanged<string> onChanged;
public readonly VoidCallback onEditingComplete;
public readonly ValueChanged<string> onSubmitted;
public readonly SelectionChangedCallback onSelectionChanged;
public readonly List<TextInputFormatter> inputFormatters;
public readonly bool rendererIgnoresPointer;
public readonly bool unityTouchKeyboard;
public EditableText(
TextEditingController controller = null,
FocusNode focusNode = null, TextStyle style = null,

TextDirection? textDirection = null,
float? textScaleFactor = null,
int? maxLines = 1,
int? minLines = null,
bool expands = false,
bool autofocus = false,
Color selectionColor = null,
TextSelectionControls selectionControls = null,

bool paintCursorAboveText = false,
Brightness? keyboardAppearance = Brightness.light,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
bool? enableInteractiveSelection = null
bool? enableInteractiveSelection = null,
ScrollPhysics scrollPhysics = null
) : base(key) {
D.assert(controller != null);
D.assert(focusNode != null);

D.assert(minLines == null || minLines > 0);
D.assert((maxLines == null) || (minLines == null) || (maxLines >= minLines),
() => "minLines can't be greater than maxLines");
D.assert(!expands || (maxLines == null && minLines == null),
() => "minLines and maxLines must be null when expands is true.");
// D.assert(backgroundCursorColor != null); // TODO: remove comment
this.keyboardType = keyboardType ?? (maxLines == 1 ? TextInputType.text : TextInputType.multiline);

this.cursorColor = cursorColor;
this.backgroundCursorColor = backgroundCursorColor ?? Colors.grey; // TODO: remove ??
this.maxLines = maxLines;
this.minLines = minLines;
this.expands = expands;
this.autofocus = autofocus;
this.selectionColor = selectionColor;
this.onChanged = onChanged;

this.keyboardAppearance = keyboardAppearance;
this.enableInteractiveSelection = enableInteractiveSelection;
this.dragStartBehavior = dragStartBehavior;
this.scrollPhysics = scrollPhysics;
public readonly TextEditingController controller;
public readonly FocusNode focusNode;
public readonly bool obscureText;
public readonly bool autocorrect;
public readonly TextStyle style;
public StrutStyle strutStyle {
get {
if (this._strutStyle == null) {
return this.style != null
? StrutStyle.fromTextStyle(this.style, forceStrutHeight: true)
: StrutStyle.disabled;
}
return this._strutStyle.inheritFromTextStyle(this.style);
}
}
readonly StrutStyle _strutStyle;
public readonly TextAlign textAlign;
public readonly TextDirection? textDirection;
public readonly TextCapitalization textCapitalization;
public readonly float? textScaleFactor;
public readonly Color cursorColor;
public readonly Color backgroundCursorColor;
public readonly int? maxLines;
public readonly int? minLines;
public readonly bool expands;
public readonly bool autofocus;
public readonly Color selectionColor;
public readonly TextSelectionControls selectionControls;
public readonly TextInputType keyboardType;
public readonly TextInputAction? textInputAction;
public readonly ValueChanged<string> onChanged;
public readonly VoidCallback onEditingComplete;
public readonly ValueChanged<string> onSubmitted;
public readonly SelectionChangedCallback onSelectionChanged;
public readonly List<TextInputFormatter> inputFormatters;
public readonly bool rendererIgnoresPointer;
public readonly bool unityTouchKeyboard;
public readonly float? cursorWidth;
public readonly Radius cursorRadius;
public readonly bool cursorOpacityAnimates;

public readonly EdgeInsets scrollPadding;
public readonly DragStartBehavior dragStartBehavior;
public readonly ScrollPhysics scrollPhysics;
public bool selectionEnabled {
get { return this.enableInteractiveSelection ?? !this.obscureText; }

properties.add(new DiagnosticsProperty<float?>("textScaleFactor", this.textScaleFactor,
defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new DiagnosticsProperty<int?>("maxLines", this.maxLines, defaultValue: 1));
properties.add(new DiagnosticsProperty<int?>("minLines", this.minLines,
defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new DiagnosticsProperty<bool>("expands", this.expands, defaultValue: false));
properties.add(new DiagnosticsProperty<ScrollPhysics>("scrollPhysics", this.scrollPhysics,
defaultValue: Diagnostics.kNullDefaultValue));
}
}

public void performAction(TextInputAction action) {
switch (action) {
case TextInputAction.newline:
if (this.widget.maxLines == 1) {
if (!this._isMultiline) {
this._finalizeEditing(true);
}

public void updateFloatingCursor(RawFloatingCursorPoint point) {
switch (point.state) {
case FloatingCursorDragState.Start:
if (this._floatingCursorResetController.isAnimating) {
this._floatingCursorResetController.stop();
this._onFloatingCursorResetTick();
}
TextPosition currentTextPosition =
new TextPosition(offset: this.renderEditable.selection.baseOffset);
this._startCaretRect = this.renderEditable.getLocalRectForCaret(currentTextPosition);

}
public override Widget build(BuildContext context) {
D.assert(WidgetsD.debugCheckHasMediaQuery(context));
FocusScope.of(context).reparentIfNeeded(this.widget.focusNode);
base.build(context); // See AutomaticKeepAliveClientMixin.

physics: new ClampingScrollPhysics(),
physics: this.widget.scrollPhysics,
dragStartBehavior: this.widget.dragStartBehavior,
viewportBuilder: (BuildContext _context, ViewportOffset offset) =>
new CompositedTransformTarget(

: this._cursorVisibilityNotifier,
hasFocus: this._hasFocus,
maxLines: this.widget.maxLines,
minLines: this.widget.minLines,
expands: this.widget.expands,
strutStyle: this.widget.strutStyle,
selectionColor: this.widget.selectionColor,
textScaleFactor: this.widget.textScaleFactor ?? MediaQuery.textScaleFactorOf(context),

public readonly ValueNotifier<bool> showCursor;
public readonly bool hasFocus;
public readonly int? maxLines;
public readonly int? minLines;
public readonly bool expands;
public readonly StrutStyle strutStyle;
public readonly Color selectionColor;
public readonly float textScaleFactor;

public readonly float? devicePixelRatio;
public _Editable(TextSpan textSpan = null, TextEditingValue value = null,
Color cursorColor = null, Color backgroundCursorColor = null, ValueNotifier<bool> showCursor = null,
public _Editable(TextSpan textSpan = null,
TextEditingValue value = null,
Color cursorColor = null,
Color backgroundCursorColor = null,
ValueNotifier<bool> showCursor = null,
int? maxLines = null, StrutStyle strutStyle = null, Color selectionColor = null,
int? maxLines = null,
int? minLines = null,
bool expands = false,
StrutStyle strutStyle = null,
Color selectionColor = null,
TextDirection? textDirection = null, bool obscureText = false, TextAlign textAlign = TextAlign.left,
bool autocorrect = false, ViewportOffset offset = null, SelectionChangedHandler onSelectionChanged = null,
CaretChangedHandler onCaretChanged = null, bool rendererIgnoresPointer = false,
Key key = null, TextSelectionDelegate textSelectionDelegate = null, float? cursorWidth = null,
Radius cursorRadius = null, Offset cursorOffset = null, bool enableInteractiveSelection = true,
bool? paintCursorAboveText = null, float? devicePixelRatio = null) : base(key) {
TextDirection? textDirection = null,
bool obscureText = false,
TextAlign textAlign = TextAlign.left,
bool autocorrect = false,
ViewportOffset offset = null,
SelectionChangedHandler onSelectionChanged = null,
CaretChangedHandler onCaretChanged = null,
bool rendererIgnoresPointer = false,
Key key = null,
TextSelectionDelegate textSelectionDelegate = null,
float? cursorWidth = null,
Radius cursorRadius = null,
Offset cursorOffset = null,
bool enableInteractiveSelection = true,
bool? paintCursorAboveText = null,
float? devicePixelRatio = null) : base(key) {
this.textSpan = textSpan;
this.value = value;
this.cursorColor = cursorColor;

this.maxLines = maxLines;
this.minLines = minLines;
this.strutStyle = strutStyle;
this.selectionColor = selectionColor;
this.textScaleFactor = textScaleFactor;

backgroundCursorColor: this.backgroundCursorColor,
hasFocus: this.hasFocus,
maxLines: this.maxLines,
minLines: this.minLines,
expands: this.expands,
strutStyle: this.strutStyle,
selectionColor: this.selectionColor,
textScaleFactor: this.textScaleFactor,

130
Runtime/material/floatting_action_button_theme.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.material {
public class FloatingActionButtonThemeData : Diagnosticable {
public FloatingActionButtonThemeData(
Color backgroundColor = null,
Color foregroundColor = null,
float? elevation = null,
float? disabledElevation = null,
float? highlightElevation = null,
ShapeBorder shape = null
) {
this.backgroundColor = backgroundColor;
this.foregroundColor = foregroundColor;
this.elevation = elevation;
this.disabledElevation = disabledElevation;
this.highlightElevation = highlightElevation;
this.shape = shape;
}
public readonly Color backgroundColor;
public readonly Color foregroundColor;
public readonly float? elevation;
public readonly float? disabledElevation;
public readonly float? highlightElevation;
public readonly ShapeBorder shape;
public FloatingActionButtonThemeData copyWith(
Color backgroundColor,
Color foregroundColor,
float? elevation,
float? disabledElevation,
float? highlightElevation,
ShapeBorder shape
) {
return new FloatingActionButtonThemeData(
backgroundColor: backgroundColor ?? this.backgroundColor,
foregroundColor: foregroundColor ?? this.foregroundColor,
elevation: elevation ?? this.elevation,
disabledElevation: disabledElevation ?? this.disabledElevation,
highlightElevation: highlightElevation ?? this.highlightElevation,
shape: shape ?? this.shape
);
}
public static FloatingActionButtonThemeData lerp(FloatingActionButtonThemeData a, FloatingActionButtonThemeData b,
float t) {
D.assert(t != null);
if (a == null && b == null) {
return null;
}
return new FloatingActionButtonThemeData(
backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
foregroundColor: Color.lerp(a?.foregroundColor, b?.foregroundColor, t),
elevation: MathUtils.lerpFloat(a?.elevation ?? 0, b?.elevation ?? 0, t),
disabledElevation: MathUtils.lerpFloat(a?.disabledElevation ?? 0, b?.disabledElevation ?? 0, t),
highlightElevation: MathUtils.lerpFloat(a?.highlightElevation ?? 0, b?.highlightElevation ?? 0, t),
shape: ShapeBorder.lerp(a?.shape, b?.shape, t)
);
}
public override int GetHashCode() {
var hashCode = this.backgroundColor?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.foregroundColor?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.elevation?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.disabledElevation?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.highlightElevation?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.shape?.GetHashCode() ?? 0;
return hashCode;
}
public bool Equals(FloatingActionButtonThemeData other) {
if (ReferenceEquals(null, other)) {
return false;
}
if (ReferenceEquals(this, other)) {
return true;
}
return Equals(this.backgroundColor, other.backgroundColor)
&& Equals(this.elevation, other.elevation)
&& Equals(this.shape, other.shape)
&& Equals(this.foregroundColor, other.foregroundColor)
&& Equals(this.disabledElevation, other.disabledElevation)
&& Equals(this.highlightElevation, other.highlightElevation);
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != this.GetType()) {
return false;
}
return this.Equals((FloatingActionButtonThemeData) obj);
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
FloatingActionButtonThemeData defaultData = new FloatingActionButtonThemeData();
properties.add(new DiagnosticsProperty<Color>("backgroundColor", this.backgroundColor,
defaultValue: defaultData.backgroundColor));
properties.add(new DiagnosticsProperty<Color>("foregroundColor", this.foregroundColor,
defaultValue: defaultData.foregroundColor));
properties.add(new DiagnosticsProperty<float?>("elevation", this.elevation,
defaultValue: defaultData.elevation));
properties.add(new DiagnosticsProperty<float?>("disabledElevation", this.disabledElevation,
defaultValue: defaultData.disabledElevation));
properties.add(new DiagnosticsProperty<float?>("highlightElevation", this.highlightElevation,
defaultValue: defaultData.highlightElevation));
properties.add(new DiagnosticsProperty<ShapeBorder>("shape", this.shape, defaultValue: defaultData.shape));
}
}
}

11
Runtime/material/floatting_action_button_theme.cs.meta


fileFormatVersion: 2
guid: f2f4277e1c02b5b4281b4fc2b7ac3e21
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存