浏览代码

Merge branch 'match_flutter12' into yczhang

/main
Yuncong Zhang 5 年前
当前提交
38f23b4b
共有 41 个文件被更改,包括 1416 次插入480 次删除
  1. 58
      Runtime/material/app.cs
  2. 38
      Runtime/material/app_bar.cs
  3. 40
      Runtime/material/bottom_app_bar.cs
  4. 53
      Runtime/material/bottom_navigation_bar.cs
  5. 1
      Runtime/material/bottom_sheet.cs
  6. 37
      Runtime/material/button.cs
  7. 2
      Runtime/material/button_theme.cs
  8. 26
      Runtime/material/card.cs
  9. 74
      Runtime/material/dialog.cs
  10. 64
      Runtime/material/dialog_theme.cs
  11. 11
      Runtime/material/drawer.cs
  12. 11
      Runtime/material/expansion_tile.cs
  13. 17
      Runtime/material/flexible_space_bar.cs
  14. 72
      Runtime/material/float_action_button.cs
  15. 114
      Runtime/material/float_action_button_location.cs
  16. 206
      Runtime/material/input_decorator.cs
  17. 19
      Runtime/material/list_tile.cs
  18. 31
      Runtime/material/material.cs
  19. 1
      Runtime/material/material_button.cs
  20. 72
      Runtime/material/outline_button.cs
  21. 50
      Runtime/material/reorderable_list.cs
  22. 88
      Runtime/material/scaffold.cs
  23. 75
      Runtime/material/switch.cs
  24. 26
      Runtime/material/tab_bar_theme.cs
  25. 44
      Runtime/material/tabs.cs
  26. 146
      Runtime/material/text_field.cs
  27. 28
      Runtime/material/text_theme.cs
  28. 51
      Runtime/material/theme_data.cs
  29. 2
      Runtime/painting/notched_shapes.cs
  30. 82
      Runtime/widgets/editable_text.cs
  31. 14
      Runtime/widgets/gesture_detector.cs
  32. 8
      Runtime/widgets/page_view.cs
  33. 28
      Runtime/widgets/scrollable.cs
  34. 6
      Runtime/widgets/single_child_scroll_view.cs
  35. 2
      Samples/UIWidgetsGallery/demo/material/bottom_app_bar_demo.cs
  36. 112
      Runtime/material/app_bar_theme.cs
  37. 3
      Runtime/material/app_bar_theme.cs.meta
  38. 89
      Runtime/material/bottom_app_bar_theme.cs
  39. 3
      Runtime/material/bottom_app_bar_theme.cs.meta
  40. 89
      Runtime/material/card_theme.cs
  41. 3
      Runtime/material/card_theme.cs.meta

58
Runtime/material/app.cs


string title = "",
Color color = null,
ThemeData theme = null,
ThemeData darkTheme = null,
Locale locale = null,
List<LocalizationsDelegate<MaterialLocalizations>> localizationsDelegates = null,
LocaleListResolutionCallback localeListResolutionCallback = null,

this.title = title;
this.color = color;
this.theme = theme;
this.dartTheme = darkTheme;
this.locale = locale;
this.localizationsDelegates = localizationsDelegates;
this.localeListResolutionCallback = localeListResolutionCallback;

public readonly string title;
public readonly ThemeData theme;
public readonly ThemeData dartTheme;
public readonly Color color;

}
public override Widget build(BuildContext context) {
ThemeData theme = this.widget.theme ?? ThemeData.fallback();
Widget result = new AnimatedTheme(
data: theme,
isMaterialAppTheme: true,
child: new WidgetsApp(
key: new GlobalObjectKey<State>(this),
navigatorKey: this.widget.navigatorKey,
navigatorObservers: this._navigatorObservers,
pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) =>
new MaterialPageRoute(settings: settings, builder: builder),
home: this.widget.home,
routes: this.widget.routes,
initialRoute: this.widget.initialRoute,
onGenerateRoute: this.widget.onGenerateRoute,
onUnknownRoute: this.widget.onUnknownRoute,
builder: this.widget.builder,
textStyle: AppUtils._errorTextStyle,
locale: this.widget.locale,
localizationsDelegates: this._localizationsDelegates,
localeResolutionCallback: this.widget.localeResolutionCallback,
localeListResolutionCallback: this.widget.localeListResolutionCallback,
supportedLocales: this.widget.supportedLocales,
showPerformanceOverlay: this.widget.showPerformanceOverlay
)
Widget result = new WidgetsApp(
key: new GlobalObjectKey<State>(this),
navigatorKey: this.widget.navigatorKey,
navigatorObservers: this._navigatorObservers,
pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) =>
new MaterialPageRoute(settings: settings, builder: builder),
home: this.widget.home,
routes: this.widget.routes,
initialRoute: this.widget.initialRoute,
onGenerateRoute: this.widget.onGenerateRoute,
onUnknownRoute: this.widget.onUnknownRoute,
builder: (BuildContext congtext, Widget child) => {
ThemeData theme = this.widget.theme ?? ThemeData.fallback();
return new AnimatedTheme(
data: theme,
isMaterialAppTheme: true,
child: this.widget.builder != null
? new Builder(
builder: (_context) => { return this.widget.builder(_context, child); }
)
: child
);
},
textStyle: AppUtils._errorTextStyle,
locale: this.widget.locale,
localizationsDelegates: this._localizationsDelegates,
localeResolutionCallback: this.widget.localeResolutionCallback,
localeListResolutionCallback: this.widget.localeListResolutionCallback,
supportedLocales: this.widget.supportedLocales,
showPerformanceOverlay: this.widget.showPerformanceOverlay
);
return result;

38
Runtime/material/app_bar.cs


List<Widget> actions = null,
Widget flexibleSpace = null,
PreferredSizeWidget bottom = null,
float elevation = 4.0f,
float? elevation = null,
Color backgroundColor = null,
Brightness? brightness = null,
IconThemeData iconTheme = null,

float toolbarOpacity = 1.0f,
float bottomOpacity = 1.0f
) : base(key: key) {
D.assert(elevation == null || elevation >= 0.0);
this.leading = leading;
this.automaticallyImplyLeading = automaticallyImplyLeading;
this.title = title;

public readonly PreferredSizeWidget bottom;
public readonly float elevation;
public readonly float? elevation;
public readonly Color backgroundColor;

class _AppBarState : State<AppBar> {
const float _defaultElevation = 4.0f;
void _handleDrawerButton() {
Scaffold.of(this.context).openDrawer();
}

public override Widget build(BuildContext context) {
D.assert(MaterialD.debugCheckHasMaterialLocalizations(context));
ThemeData themeData = Theme.of(context);
AppBarTheme appBarTheme = AppBarTheme.of(context);
ScaffoldState scaffold = Scaffold.of(context, nullOk: true);
ModalRoute parentRoute = ModalRoute.of(context);

bool useCloseButton = parentRoute is PageRoute && ((PageRoute) parentRoute).fullscreenDialog;
IconThemeData appBarIconTheme = this.widget.iconTheme ?? themeData.primaryIconTheme;
TextStyle centerStyle = this.widget.textTheme?.title ?? themeData.primaryTextTheme.title;
TextStyle sideStyle = this.widget.textTheme?.body1 ?? themeData.primaryTextTheme.body1;
IconThemeData appBarIconTheme = this.widget.iconTheme
?? appBarTheme.iconTheme
?? themeData.primaryIconTheme;
TextStyle centerStyle = this.widget.textTheme?.title
?? appBarTheme.textTheme?.title
?? themeData.primaryTextTheme.title;
TextStyle sideStyle = this.widget.textTheme?.body1
?? appBarTheme.textTheme?.body1
?? themeData.primaryTextTheme.body1;
if (this.widget.toolbarOpacity != 1.0f) {
float opacity =

);
}
Brightness brightness = this.widget.brightness ?? themeData.primaryColorBrightness;
Brightness brightness = this.widget.brightness
?? appBarTheme.brightness
?? themeData.primaryColorBrightness;
SystemUiOverlayStyle overlayStyle = brightness == Brightness.dark
? SystemUiOverlayStyle.light
: SystemUiOverlayStyle.dark;

child: new Material(
color: this.widget.backgroundColor ?? themeData.primaryColor,
elevation: this.widget.elevation,
color: this.widget.backgroundColor
?? appBarTheme.color
?? themeData.primaryColor,
elevation: this.widget.elevation
?? appBarTheme.elevation
?? _defaultElevation,
child: appBar
));
}

public override Widget build(BuildContext context, float shrinkOffset, bool overlapsContent) {
float? visibleMainHeight = this.maxExtent - shrinkOffset - this.topPadding;
float toolbarOpacity = this.pinned && !this.floating
? 1.0f
: ((visibleMainHeight - this._bottomHeight) / Constants.kToolbarHeight)?.clamp(0.0f, 1.0f) ?? 0.0f;
float toolbarOpacity = !this.pinned || (!this.floating && this.bottom != null)
? ((visibleMainHeight - this._bottomHeight) / Constants.kToolbarHeight)?.clamp(0.0f, 1.0f) ?? 1.0f
: 1.0f;
Widget appBar = FlexibleSpaceBar.createSettings(
minExtent: this.minExtent,
maxExtent: this.maxExtent,

40
Runtime/material/bottom_app_bar.cs


public BottomAppBar(
Key key = null,
Color color = null,
float elevation = 8.0f,
float? elevation = null,
D.assert(elevation >= 0.0f);
D.assert(elevation == null || elevation >= 0.0f);
this.child = child;
this.color = color;
this.elevation = elevation;

public readonly Color color;
public readonly float elevation;
public readonly float? elevation;
public readonly NotchedShape shape;

class _BottomAppBarState : State<BottomAppBar> {
ValueListenable<ScaffoldGeometry> geometryListenable;
const float _defaultElevation = 8.0f;
public override void didChangeDependencies() {
base.didChangeDependencies();

public override Widget build(BuildContext context) {
CustomClipper<Path> clipper = this.widget.shape != null
BottomAppBarTheme babTheme = BottomAppBarTheme.of(context);
NotchedShape notchedShape = this.widget.shape ?? babTheme.shape;
CustomClipper<Path> clipper = notchedShape != null
shape: this.widget.shape,
shape: notchedShape,
elevation: this.widget.elevation,
color: this.widget.color ?? Theme.of(context).bottomAppBarColor,
elevation: this.widget.elevation ?? babTheme.elevation ?? _defaultElevation,
color: this.widget.color ?? babTheme.color ?? Theme.of(context).bottomAppBarColor,
clipBehavior: this.widget.clipBehavior,
child: new Material(
type: MaterialType.transparency,

public readonly float notchMargin;
public override Path getClip(Size size) {
Rect appBar = Offset.zero & size;
if (this.geometry.value.floatingActionButtonArea == null) {
Path path = new Path();
path.addRect(appBar);
return path;
}
Rect button = this.geometry.value.floatingActionButtonArea
.translate(0.0f, (this.geometry.value.bottomNavigationBarTop * -1.0f) ?? 0.0f);
return this.shape.getOuterPath(appBar, button.inflate(this.notchMargin));
Rect button = this.geometry.value.floatingActionButtonArea?.translate(
0.0f,
(this.geometry.value.bottomNavigationBarTop ?? 0.0f) * -1.0f
);
return this.shape.getOuterPath(Offset.zero & size, button?.inflate(this.notchMargin));
public override bool shouldReclip(CustomClipper<Path> oldClipper) {
return (oldClipper as _BottomAppBarClipper).geometry != this.geometry;
public override bool shouldReclip(CustomClipper<Path> _oldClipper) {
_BottomAppBarClipper oldClipper = _oldClipper as _BottomAppBarClipper;
return oldClipper.geometry != this.geometry
|| oldClipper.shape != this.shape
|| oldClipper.notchMargin != this.notchMargin;
}
}
}

53
Runtime/material/bottom_navigation_bar.cs


break;
}
return new Stack(
children: new List<Widget> {
Positioned.fill(
child: new Material( // Casts shadow.
elevation: 8.0f,
color: backgroundColor
)
),
new ConstrainedBox(
constraints: new BoxConstraints(
minHeight: Constants.kBottomNavigationBarHeight + additionalBottomPadding),
child: new Stack(
children: new List<Widget> {
Positioned.fill(
child: new CustomPaint(
painter: new _RadialPainter(
circles: this._circles.ToList()
)
)
),
new Material( // Splashes.
type: MaterialType.transparency,
child: new Padding(
padding: EdgeInsets.only(bottom: additionalBottomPadding),
child: MediaQuery.removePadding(
context: context,
removeBottom: true,
child: this._createContainer(this._createTiles())
)
)
return new Material(
elevation: 8.0f,
color: backgroundColor,
child: new ConstrainedBox(
constraints: new BoxConstraints(
minHeight: Constants.kBottomNavigationBarHeight + additionalBottomPadding),
child: new CustomPaint(
painter: new _RadialPainter(
circles: this._circles.ToList()
),
child: new Material( // Splashes.
type: MaterialType.transparency,
child: new Padding(
padding: EdgeInsets.only(bottom: additionalBottomPadding),
child: MediaQuery.removePadding(
context: context,
removeBottom: true,
child: this._createContainer(this._createTiles())
}
)
}
)
);
}
}

1
Runtime/material/bottom_sheet.cs


) : base(key: key) {
D.assert(onClosing != null);
D.assert(builder != null);
D.assert(elevation >= 0.0f);
this.animationController = animationController;
this.enableDrag = enableDrag;
this.elevation = elevation;

37
Runtime/material/button.cs


Clip clipBehavior = Clip.none,
MaterialTapTargetSize? materialTapTargetSize = null,
Widget child = null) : base(key: key) {
D.assert(elevation >= 0.0);
D.assert(highlightElevation >= 0.0);
D.assert(disabledElevation >= 0.0);
MaterialTapTargetSize _materialTapTargetSize = materialTapTargetSize ?? MaterialTapTargetSize.padded;
shape = shape ?? new RoundedRectangleBorder();
padding = padding ?? EdgeInsets.zero;

bool _highlight = false;
void _handleHighlightChanged(bool value) {
this.setState(() => {
this._highlight = value;
if (this._highlight != value) {
this.setState(() => {
this._highlight = value;
if (this.widget.onHighlightChanged != null) {
this.widget.onHighlightChanged(value);
}
});
}
}
public override void didUpdateWidget(StatefulWidget _oldWidget) {
RawMaterialButton oldWidget = _oldWidget as RawMaterialButton;
base.didUpdateWidget(oldWidget);
if (this._highlight && !this.widget.enabled) {
this._highlight = false;
this.widget.onHighlightChanged(value);
this.widget.onHighlightChanged(false);
});
}
}
public override Widget build(BuildContext context) {

onHighlightChanged: this._handleHighlightChanged,
splashColor: this.widget.splashColor,
highlightColor: this.widget.highlightColor,
onTap: this.widget.onPressed == null ? (GestureTapCallback) null : () => {
if (this.widget.onPressed != null) {
this.widget.onPressed();
}
},
onTap: this.widget.onPressed == null
? (GestureTapCallback) null
: () => {
if (this.widget.onPressed != null) {
this.widget.onPressed();
}
},
customBorder: this.widget.shape,
child: IconTheme.merge(
data: new IconThemeData(color: this.widget.textStyle?.color),

2
Runtime/material/button_theme.cs


}
if (button is OutlineButton) {
return 2.0f;
return 0.0f;
}
return 8.0f;
}

26
Runtime/material/card.cs


Color color = null,
float? elevation = null,
ShapeBorder shape = null,
bool borderOnForeground = true,
Clip clipBehavior = Clip.none,
Clip? clipBehavior = null,
D.assert(elevation == null || elevation >= 0.0f);
this.margin = margin ?? EdgeInsets.all(4.0f);
this.borderOnForeground = borderOnForeground;
this.margin = margin;
this.clipBehavior = clipBehavior;
this.child = child;
}

public readonly ShapeBorder shape;
public readonly Clip clipBehavior;
public readonly bool borderOnForeground;
public readonly Clip? clipBehavior;
const double _defaultElevation = 1.0;
const Clip _defaultClipBehavior = Clip.none;
CardTheme cardTheme = CardTheme.of(context);
margin: this.margin ?? EdgeInsets.all(4.0f),
margin: this.margin ?? cardTheme.margin ?? EdgeInsets.all(4.0f),
color: this.color ?? Theme.of(context).cardColor,
elevation: this.elevation ?? 1.0f,
shape: this.shape ?? new RoundedRectangleBorder(
color: this.color ?? cardTheme.color ?? Theme.of(context).cardColor,
elevation: this.elevation ?? cardTheme.elevation ?? 1.0f,
shape: this.shape ?? cardTheme.shape ?? new RoundedRectangleBorder(
clipBehavior: this.clipBehavior,
clipBehavior: this.clipBehavior ?? cardTheme.clipBehavior ?? _defaultClipBehavior,
child: this.child)
);
}

74
Runtime/material/dialog.cs


using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
Widget child = null,
Color backgroundColor = null,
float? elevation = null,
ShapeBorder shape = null
ShapeBorder shape = null,
Widget child = null
this.backgroundColor = backgroundColor;
this.elevation = elevation;
this.insetAnimationCurve = Curves.decelerate;
this.insetAnimationCurve = insetAnimationCurve ?? Curves.decelerate;
public readonly Widget child;
public readonly Color backgroundColor;
public readonly float? elevation;
public readonly TimeSpan insetAnimationDuration;

Color _getColor(BuildContext context) {
return Theme.of(context).dialogBackgroundColor;
}
public readonly Widget child;
const float _defaultElevation = 24.0f;
public override Widget build(BuildContext context) {
DialogTheme dialogTheme = DialogTheme.of(context);

child: new ConstrainedBox(
constraints: new BoxConstraints(minWidth: 280.0f),
child: new Material(
elevation: 24.0f,
color: this._getColor(context),
color: this.backgroundColor ?? dialogTheme.backgroundColor ??
Theme.of(context).dialogBackgroundColor,
elevation: this.elevation ?? dialogTheme.elevation ?? _defaultElevation,
shape: this.shape ?? dialogTheme.shape ?? _defaultDialogShape,
child: this.child,
shape: this.shape ?? dialogTheme.shape ?? _defaultDialogShape
child: this.child
)
)
)

Key key = null,
Widget title = null,
EdgeInsets titlePadding = null,
TextStyle titleTextStyle = null,
TextStyle contentTextStyle = null,
Color backgroundColor = null,
float? elevation = null,
this.titleTextStyle = titleTextStyle;
this.contentTextStyle = contentTextStyle;
this.backgroundColor = backgroundColor;
this.elevation = elevation;
public readonly TextStyle titleTextStyle;
public readonly TextStyle contentTextStyle;
public readonly Color backgroundColor;
public readonly float? elevation;
ThemeData theme = Theme.of(context);
DialogTheme dialogTheme = DialogTheme.of(context);
List<Widget> children = new List<Widget>();
if (this.title != null) {

child: new DefaultTextStyle(
style: Theme.of(context).textTheme.title,
style: this.titleTextStyle ?? dialogTheme.titleTextStyle ?? theme.textTheme.title,
child: this.title
)
));

child: new Padding(
padding: this.contentPadding,
child: new DefaultTextStyle(
style: Theme.of(context).textTheme.subhead,
style: this.contentTextStyle ?? dialogTheme.contentTextStyle ?? theme.textTheme.subhead,
child: this.content
)
)

)
);
return new Dialog(child: dialogChild, shape: this.shape);
return new Dialog(
backgroundColor: this.backgroundColor,
elevation: this.elevation,
shape: this.shape,
child: dialogChild
);
}
}

EdgeInsets titlePadding = null,
List<Widget> children = null,
EdgeInsets contentPadding = null,
Color backgroundColor = null,
float? elevation = null,
ShapeBorder shape = null
) : base(key: key) {
this.title = title;

this.backgroundColor = backgroundColor;
this.elevation = elevation;
this.shape = shape;
}

public readonly List<Widget> children;
public readonly EdgeInsets contentPadding;
public readonly Color backgroundColor;
public readonly float? elevation;
public readonly ShapeBorder shape;

)
);
return new Dialog(child: dialogChild, shape: this.shape);
return new Dialog(
backgroundColor: this.backgroundColor,
elevation: this.elevation,
shape: this.shape,
child: dialogChild
);
static Widget _buildMaterialDialogTransitions(BuildContext context, Animation<float> animation,
Animation<float> secondaryAnimation, Widget child) {
return new FadeTransition(

);
}
}
}
}

64
Runtime/material/dialog_theme.cs


using System;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
public DialogTheme(ShapeBorder shape = null) {
public DialogTheme(
Color backgroundColor = null,
float? elevation = null,
ShapeBorder shape = null,
TextStyle titleTextStyle = null,
TextStyle contentTextStyle = null
) {
this.backgroundColor = backgroundColor;
this.elevation = elevation;
this.titleTextStyle = titleTextStyle;
this.contentTextStyle = contentTextStyle;
public readonly Color backgroundColor;
public readonly float? elevation;
public DialogTheme copyWith(ShapeBorder shape = null) {
return new DialogTheme(shape: shape ?? this.shape);
public readonly TextStyle titleTextStyle;
public readonly TextStyle contentTextStyle;
DialogTheme copyWith(
Color backgroundColor = null,
float? elevation = null,
ShapeBorder shape = null,
TextStyle titleTextStyle = null,
TextStyle contentTextStyle = null
) {
return new DialogTheme(
backgroundColor: backgroundColor ?? this.backgroundColor,
elevation: elevation ?? this.elevation,
shape: shape ?? this.shape,
titleTextStyle: titleTextStyle ?? this.titleTextStyle,
contentTextStyle: contentTextStyle ?? this.contentTextStyle
);
}
public static DialogTheme of(BuildContext context) {

public static DialogTheme lerp(DialogTheme a, DialogTheme b, float t) {
return new DialogTheme(
shape: ShapeBorder.lerp(a?.shape, b?.shape, t)
backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
elevation: MathUtils.lerpFloat(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t),
shape: ShapeBorder.lerp(a?.shape, b?.shape, t),
titleTextStyle: TextStyle.lerp(a?.titleTextStyle, b?.titleTextStyle, t),
contentTextStyle: TextStyle.lerp(a?.contentTextStyle, b?.contentTextStyle, t)
);
}

}
return Equals(this.shape, other.shape);
return Equals(this.backgroundColor, other.backgroundColor)
&& Equals(this.elevation, other.elevation)
&& Equals(this.shape, other.shape)
&& Equals(this.titleTextStyle, other.titleTextStyle)
&& Equals(this.contentTextStyle, other.contentTextStyle);
}
public override bool Equals(object obj) {

return this.Equals((DialogTheme) obj);
}

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<ShapeBorder>("shape", this.shape,
defaultValue: Diagnostics.kNullDefaultValue));
properties.add(new DiagnosticsProperty<Color>("backgroundColor", this.backgroundColor));
properties.add(new DiagnosticsProperty<ShapeBorder>("shape", this.shape));
properties.add(new DiagnosticsProperty<float?>("elevation", this.elevation));
properties.add(new DiagnosticsProperty<TextStyle>("titleTextStyle", this.titleTextStyle));
properties.add(new DiagnosticsProperty<TextStyle>("contentTextStyle", this.contentTextStyle));
}
}

11
Runtime/material/drawer.cs


Key key = null,
float elevation = 16.0f,
Widget child = null) : base(key: key) {
D.assert(elevation >= 0.0f);
this.elevation = elevation;
this.child = child;
}

GlobalKey key = null,
Widget child = null,
DrawerAlignment? alignment = null,
DrawerCallback drawerCallback = null) : base(key: key) {
DrawerCallback drawerCallback = null,
DragStartBehavior? dragStartBehavior = null
) : base(key: key) {
D.assert(dragStartBehavior != null);
this.dragStartBehavior = dragStartBehavior;
public readonly DragStartBehavior? dragStartBehavior;
public readonly DrawerCallback drawerCallback;

onHorizontalDragUpdate: this._move,
onHorizontalDragEnd: this._settle,
behavior: HitTestBehavior.translucent,
dragStartBehavior: this.widget.dragStartBehavior ?? DragStartBehavior.down,
child: new Container(width: dragAreaWidth)
)
);

onHorizontalDragUpdate: this._move,
onHorizontalDragEnd: this._settle,
onHorizontalDragCancel: this._handleDragCancel,
dragStartBehavior: this.widget.dragStartBehavior ?? DragStartBehavior.down,
child: new RepaintBoundary(
child: new Stack(
children: new List<Widget> {

11
Runtime/material/expansion_tile.cs


Widget _buildChildren(BuildContext context, Widget child) {
Color borderSideColor = this._borderColor.value ?? Colors.transparent;
Color titleColor = this._headerColor.value;
return new Container(
decoration: new BoxDecoration(

child: new Column(
mainAxisSize: MainAxisSize.min,
children: new List<Widget> {
IconTheme.merge(
data: new IconThemeData(color: this._iconColor.value),
ListTileTheme.merge(
iconColor: this._iconColor.value,
textColor: this._headerColor.value,
title: new DefaultTextStyle(
style: Theme.of(this.context).textTheme.subhead.copyWith(color: titleColor),
child: this.widget.title
),
title: this.widget.title,
trailing: this.widget.trailing ?? new RotationTransition(
turns: this._iconTurns,
child: new Icon(Icons.expand_more)

17
Runtime/material/flexible_space_bar.cs


Widget title = null,
Widget background = null,
bool? centerTitle = null,
EdgeInsets titlePadding = null,
this.titlePadding = titlePadding;
this.collapseMode = collapseMode;
}

public readonly bool? centerTitle;
public readonly EdgeInsets titlePadding;
public static Widget createSettings(
float? toolbarOpacity = null,

color: titleStyle.color.withOpacity(toolbarOpacity));
bool effectiveCenterTitle = this._getEffectiveCenterTitle(theme).Value;
EdgeInsets padding = this.widget.titlePadding ??
EdgeInsets.only(
left: effectiveCenterTitle ? 0.0f : 72.0f,
bottom: 16.0f
);
padding: EdgeInsets.fromLTRB(
effectiveCenterTitle ? 0.0f : 72.0f,
0f,
0f,
16.0f),
padding: padding,
child: new Transform(
alignment: titleAlignment,
transform: scaleTransform,

72
Runtime/material/float_action_button.cs


}
}
public class FloatingActionButton : StatefulWidget {
public class FloatingActionButton : StatelessWidget {
FloatingActionButton(
Key key = null,
Widget child = null,

object heroTag = null,
float elevation = 6.0f,
float highlightElevation = 12.0f,
float? disabledElevation = null,
VoidCallback onPressed = null,
bool mini = false,
ShapeBorder shape = null,

BoxConstraints _sizeConstraints = null
) : base(key: key) {
D.assert(elevation >= 0.0f);
D.assert(highlightElevation >= 0.0f);
D.assert(disabledElevation == null || disabledElevation >= 0.0f);
heroTag = heroTag ?? new _DefaultHeroTag();
shape = shape ?? new CircleBorder();
this.child = child;

this.clipBehavior = clipBehavior;
this.materialTapTargetSize = materialTapTargetSize;
this.isExtended = isExtended;
this._sizeConstraints = _sizeConstraints ??
(mini
this.disabledElevation = disabledElevation;
this._sizeConstraints = _sizeConstraints ?? (mini
? FloatActionButtonUtils._kMiniSizeConstraints
: FloatActionButtonUtils._kSizeConstraints);
}

object heroTag = null,
float elevation = 6.0f,
float highlightElevation = 12.0f,
float? disabledElevation = null,
VoidCallback onPressed = null,
ShapeBorder shape = null,
bool isExtended = true,

Widget label = null
) {
D.assert(elevation >= 0.0f);
D.assert(highlightElevation >= 0.0f);
D.assert(disabledElevation != null && disabledElevation >= 0.0f);
D.assert(icon != null);
D.assert(label != null);
D.assert(icon != null);
D.assert(label != null);
BoxConstraints _sizeConstraints = FloatActionButtonUtils._kExtendedSizeConstraints;
bool mini = false;

heroTag: heroTag,
elevation: elevation,
highlightElevation: highlightElevation,
disabledElevation: disabledElevation ?? elevation,
onPressed: onPressed,
mini: mini,
shape: shape,

public readonly float highlightElevation;
public readonly float? disabledElevation;
public readonly bool mini;
public readonly ShapeBorder shape;

public readonly BoxConstraints _sizeConstraints;
public override State createState() {
return new _FloatingActionButtonState();
}
}
public class _FloatingActionButtonState : State<FloatingActionButton> {
bool _highlight = false;
void _handleHighlightChanged(bool value) {
this.setState(() => { this._highlight = value; });
}
Color foregroundColor = this.widget.foregroundColor ?? theme.accentIconTheme.color;
Color foregroundColor = this.foregroundColor ?? theme.accentIconTheme.color;
if (this.widget.child != null) {
if (this.child != null) {
child: this.widget.child
child: this.child
onPressed: this.widget.onPressed,
onHighlightChanged: this._handleHighlightChanged,
elevation: this._highlight ? this.widget.highlightElevation : this.widget.elevation,
constraints: this.widget._sizeConstraints,
materialTapTargetSize: this.widget.materialTapTargetSize ?? theme.materialTapTargetSize,
fillColor: this.widget.backgroundColor ?? theme.accentColor,
onPressed: this.onPressed,
elevation: this.elevation,
highlightElevation: this.highlightElevation,
disabledElevation: this.disabledElevation ?? this.elevation,
constraints: this._sizeConstraints,
materialTapTargetSize: this.materialTapTargetSize ?? theme.materialTapTargetSize,
fillColor: this.backgroundColor ?? theme.accentColor,
shape: this.widget.shape,
clipBehavior: this.widget.clipBehavior,
shape: this.shape,
clipBehavior: this.clipBehavior,
if (this.widget.tooltip != null) {
if (this.tooltip != null) {
message: this.widget.tooltip,
message: this.tooltip,
//todo: xingwei.zhu: Hero widget
// if (this.widget.heroTag != null) {
// result = new Hero(
// tag: this.widget.heroTag,
// child: result);
// }
if (this.heroTag != null) {
result = new Hero(
tag: this.heroTag,
child: result);
}
return result;
}

114
Runtime/material/float_action_button_location.cs


public static readonly TimeSpan kFloatingActionButtonSegue = new TimeSpan(0, 0, 0, 0, 200);
public const float kFloatingActionButtonTurnInterval = 0.125f;
public static float _leftOffset(ScaffoldPrelayoutGeometry scaffoldGeometry, float offset = 0.0f) {
return kFloatingActionButtonMargin
+ scaffoldGeometry.minInsets.left
- offset;
}
public static float _rightOffset(ScaffoldPrelayoutGeometry scaffoldGeometry, float offset = 0.0f) {
return scaffoldGeometry.scaffoldSize.width
- kFloatingActionButtonMargin
- scaffoldGeometry.minInsets.right
- scaffoldGeometry.floatingActionButtonSize.width
+ offset;
}
public static float _endOffset(ScaffoldPrelayoutGeometry scaffoldGeometry, float offset = 0.0f) {
return _rightOffset(scaffoldGeometry, offset: offset);
}
public static float _startOffset(ScaffoldPrelayoutGeometry scaffoldGeometry, float offset = 0.0f) {
return _leftOffset(scaffoldGeometry, offset: offset);
}
public static float _straddleAppBar(ScaffoldPrelayoutGeometry scaffoldGeometry) {
float fabHalfHeight = scaffoldGeometry.floatingActionButtonSize.height / 2.0f;
return scaffoldGeometry.contentTop - fabHalfHeight;
}
}

public static readonly FloatingActionButtonLocation endFloat = new _EndFloatFabLocation();
public static readonly FloatingActionButtonLocation endFloat = new _EndFloatFloatingActionButtonLocation();
public static readonly FloatingActionButtonLocation centerFloat = new _CenterFloatFabLocation();
public static readonly FloatingActionButtonLocation
centerFloat = new _CenterFloatFloatingActionButtonLocation();
public static readonly FloatingActionButtonLocation endDocked = new _EndDockedFloatingActionButtonLocation();

public static readonly FloatingActionButtonLocation startTop = new _StartTopFloatingActionButtonLocation();
public static readonly FloatingActionButtonLocation miniStartTop =
new _MiniStartTopFloatingActionButtonLocation();
public static readonly FloatingActionButtonLocation endTop = new _EndTopFloatingActionButtonLocation();
public abstract Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry);
public override string ToString() {

class _CenterFloatFabLocation : FloatingActionButtonLocation {
public _CenterFloatFabLocation() {
class _CenterFloatFloatingActionButtonLocation : FloatingActionButtonLocation {
public _CenterFloatFloatingActionButtonLocation() {
}
public override Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) {

return new Offset(fabX, fabY);
}
public override string ToString() {
return "FloatingActionButtonLocation.centerFloat";
}
class _EndFloatFabLocation : FloatingActionButtonLocation {
public _EndFloatFabLocation() {
class _EndFloatFloatingActionButtonLocation : FloatingActionButtonLocation {
public _EndFloatFloatingActionButtonLocation() {
float endPadding = scaffoldGeometry.minInsets.right;
float fabX = scaffoldGeometry.scaffoldSize.width - scaffoldGeometry.floatingActionButtonSize.width -
FloatingActionButtonLocationUtils.kFloatingActionButtonMargin - endPadding;
float fabX = FloatingActionButtonLocationUtils._endOffset(scaffoldGeometry);
float contentBottom = scaffoldGeometry.contentBottom;
float bottomSheetHeight = scaffoldGeometry.bottomSheetSize.height;

return new Offset(fabX, fabY);
}
public override string ToString() {
return "FloatingActionButtonLocation.endFloat";
}
}
abstract class _DockedFloatingActionButtonLocation : FloatingActionButtonLocation {

}
public override Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) {
float endPadding = scaffoldGeometry.minInsets.right;
float fabX = scaffoldGeometry.scaffoldSize.width - scaffoldGeometry.floatingActionButtonSize.width -
FloatingActionButtonLocationUtils.kFloatingActionButtonMargin - endPadding;
float fabX = FloatingActionButtonLocationUtils._endOffset(scaffoldGeometry);
public override string ToString() {
return "FloatingActionButtonLocation.endDocked";
}
}
class _CenterDockedFloatingActionButtonLocation : _DockedFloatingActionButtonLocation {

public override Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) {
float fabX = (scaffoldGeometry.scaffoldSize.width - scaffoldGeometry.floatingActionButtonSize.width) / 2.0f;
return new Offset(fabX, this.getDockedY(scaffoldGeometry));
}
public override string ToString() {
return "FloatingActionButtonLocation.centerDocked";
}
}
class _StartTopFloatingActionButtonLocation : FloatingActionButtonLocation {
public _StartTopFloatingActionButtonLocation() {
}
public override Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) {
return new Offset(FloatingActionButtonLocationUtils._startOffset(scaffoldGeometry),
FloatingActionButtonLocationUtils._straddleAppBar(scaffoldGeometry));
}
public override string ToString() {
return "FloatingActionButtonLocation.startTop";
}
}
class _MiniStartTopFloatingActionButtonLocation : FloatingActionButtonLocation {
public _MiniStartTopFloatingActionButtonLocation() {
}
public override Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) {
return new Offset(FloatingActionButtonLocationUtils._startOffset(scaffoldGeometry, offset: 4.0f),
FloatingActionButtonLocationUtils._straddleAppBar(scaffoldGeometry));
}
public override string ToString() {
return "FloatingActionButtonLocation.miniStartTop";
}
}
class _EndTopFloatingActionButtonLocation : FloatingActionButtonLocation {
public _EndTopFloatingActionButtonLocation() {
}
public override Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) {
return new Offset(FloatingActionButtonLocationUtils._endOffset(scaffoldGeometry),
FloatingActionButtonLocationUtils._straddleAppBar(scaffoldGeometry));
}
public override string ToString() {
return "FloatingActionButtonLocation.endTop";
}
}

206
Runtime/material/input_decorator.cs


using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using RSG.Promises;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;

}
void _handleChange() {
this.setState(() => {
});
this.setState(() => { });
}
public override void didUpdateWidget(StatefulWidget _old) {

Widget suffixIcon = null,
Widget helperError = null,
Widget counter = null,
Widget container = null
Widget container = null,
bool? alignLabelWithHint = null
) {
D.assert(contentPadding != null);
this.contentPadding = contentPadding;

this.helperError = helperError;
this.counter = counter;
this.container = container;
this.alignLabelWithHint = alignLabelWithHint;
}
public readonly EdgeInsets contentPadding;

public readonly InputBorder border;
public readonly _InputBorderGap borderGap;
public readonly bool? alignLabelWithHint;
public readonly Widget icon;
public readonly Widget input;
public readonly Widget label;

Equals(this.prefix, other.prefix) && Equals(this.suffix, other.suffix) &&
Equals(this.prefixIcon, other.prefixIcon) && Equals(this.suffixIcon, other.suffixIcon) &&
Equals(this.helperError, other.helperError) && Equals(this.counter, other.counter) &&
Equals(this.container, other.container);
Equals(this.container, other.container) && Equals(this.alignLabelWithHint, other.alignLabelWithHint);
}
public override bool Equals(object obj) {

hashCode = (hashCode * 397) ^ (this.helperError != null ? this.helperError.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.counter != null ? this.counter.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.container != null ? this.container.GetHashCode() : 0);
hashCode = (hashCode * 397) ^
(this.alignLabelWithHint != null ? this.alignLabelWithHint.GetHashCode() : 0);
return hashCode;
}
}

}
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));
_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));
if (this.label != null)
{
this.label.layout(boxConstraints, parentUsesSize: true);
if (this.label != null) {
if (this.decoration.alignLabelWithHint == true) {
layoutLineBox(this.label);
}
else {
this.label.layout(boxConstraints, parentUsesSize: true);
}
}
boxConstraints = boxConstraints.copyWith(minWidth: inputWidth);

boxConstraints = boxConstraints.copyWith(
maxWidth: Mathf.Max(0.0f, boxConstraints.maxWidth
- _boxSize(this.icon).width
- _boxSize(this.counter).width
- this.contentPadding.horizontal
- _boxSize(this.icon).width
- _boxSize(this.counter).width
- this.contentPadding.horizontal
)
);
layoutLineBox(this.helperError);

}
if (this.label != null) {
centerLayout(this.label, start);
if (this.decoration.alignLabelWithHint == true) {
baselineLayout(this.label, start);
}
else {
centerLayout(this.label, start);
}
}
if (this.prefix != null) {

if (this.counter != null) {
baselineLayout(this.counter, right - this.counter.size.width);
}
}
if (this.label != null) {

}
void _handleChange() {
this.setState(() => {
});
this.setState(() => { });
}
InputDecoration _effectiveDecoration;

}
Color _getFillColor(ThemeData themeData) {
if (this.decoration.filled != true)
{
if (this.decoration.filled != true) {
return Colors.transparent;
}

child: new Text(this.decoration.hintText,
style: hintStyle,
overflow: TextOverflow.ellipsis,
textAlign: this.textAlign
textAlign: this.textAlign,
maxLines: this.decoration.hintMaxLines
)
);

errorMaxLines: this.decoration.errorMaxLines
);
Widget counter = this.decoration.counterText == null
? null
: new Text(this.decoration.counterText,
Widget counter = null;
if (this.decoration.counter != null) {
counter = this.decoration.counter;
}
else if (this.decoration.counterText != null && this.decoration.counterText != "") {
counter = new Text(this.decoration.counterText,
}
EdgeInsets decorationContentPadding = this.decoration.contentPadding;
EdgeInsets contentPadding;

icon: icon,
input: this.widget.child,
label: label,
alignLabelWithHint: this.decoration.alignLabelWithHint,
hint: hint,
prefix: prefix,
suffix: suffix,

TextStyle helperStyle = null,
string hintText = null,
TextStyle hintStyle = null,
int? hintMaxLines = null,
string errorText = null,
TextStyle errorStyle = null,
int? errorMaxLines = null,

Widget suffix = null,
string suffixText = null,
TextStyle suffixStyle = null,
Widget counter = null,
string counterText = null,
TextStyle counterStyle = null,
bool? filled = null,

InputBorder disabledBorder = null,
InputBorder enabledBorder = null,
InputBorder border = null,
bool? enabled = true
bool? enabled = true,
bool? alignLabelWithHint = null
D.assert(!(prefix != null && prefixText != null), "Declaring both prefix and prefixText is not allowed");
D.assert(!(suffix != null && suffixText != null), "Declaring both suffix and suffixText is not allowed");
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;

this.hintText = hintText;
this.hintStyle = hintStyle;
this.hintMaxLines = hintMaxLines;
this.errorText = errorText;
this.errorStyle = errorStyle;
this.errorMaxLines = errorMaxLines;

this.prefixStyle = prefixStyle;
this.suffixIcon = suffixIcon;
this.suffixStyle = suffixStyle;
this.counter = counter;
this.counterText = counterText;
this.counterStyle = counterStyle;
this.filled = filled;

this.enabledBorder = enabledBorder;
this.border = border;
this.enabled = enabled;
this.alignLabelWithHint = alignLabelWithHint;
}
public static InputDecoration collapsed(

labelStyle: null,
helperText: null,
helperStyle: null,
hintMaxLines: null,
errorText: null,
errorStyle: null,
errorMaxLines: null,

suffixIcon: null,
suffixText: null,
suffixStyle: null,
counter: null,
counterText: null,
counterStyle: null,
errorBorder: null,

filled: filled,
fillColor: fillColor,
border: border,
enabled: enabled
enabled: enabled,
alignLabelWithHint: false
);
decoration.isCollapsed = true;
return decoration;

public readonly string hintText;
public readonly TextStyle hintStyle;
public readonly int? hintMaxLines;
public readonly string errorText;

public readonly TextStyle suffixStyle;
public readonly Widget counter;
public readonly string counterText;
public readonly TextStyle counterStyle;

public readonly InputBorder border;
public readonly bool? enabled;
public readonly bool? alignLabelWithHint;
public InputDecoration copyWith(
Widget icon = null,

TextStyle helperStyle = null,
string hintText = null,
TextStyle hintStyle = null,
int? hintMaxLines = null,
string errorText = null,
TextStyle errorStyle = null,
int? errorMaxLines = null,

Widget suffix = null,
string suffixText = null,
TextStyle suffixStyle = null,
Widget counter = null,
string counterText = null,
TextStyle counterStyle = null,
bool? filled = null,

InputBorder disabledBorder = null,
InputBorder enabledBorder = null,
InputBorder border = null,
bool? enabled = null
bool? enabled = null,
bool? alignLabelWithHint = null
) {
return new InputDecoration(
icon: icon ?? this.icon,

helperStyle: helperStyle ?? this.helperStyle,
hintText: hintText ?? this.hintText,
hintStyle: hintStyle ?? this.hintStyle,
hintMaxLines: hintMaxLines ?? this.hintMaxLines,
errorText: errorText ?? this.errorText,
errorStyle: errorStyle ?? this.errorStyle,
errorMaxLines: errorMaxLines ?? this.errorMaxLines,

suffix: suffix ?? this.suffix,
suffixText: suffixText ?? this.suffixText,
suffixStyle: suffixStyle ?? this.suffixStyle,
counter: counter ?? this.counter,
counterText: counterText ?? this.counterText,
counterStyle: counterStyle ?? this.counterStyle,
filled: filled ?? this.filled,

disabledBorder: disabledBorder ?? this.disabledBorder,
enabledBorder: enabledBorder ?? this.enabledBorder,
border: border ?? this.border,
enabled: enabled ?? this.enabled
enabled: enabled ?? this.enabled,
alignLabelWithHint: alignLabelWithHint ?? this.alignLabelWithHint
);
}

focusedErrorBorder: this.focusedErrorBorder ?? theme.focusedErrorBorder,
disabledBorder: this.disabledBorder ?? theme.disabledBorder,
enabledBorder: this.enabledBorder ?? theme.enabledBorder,
border: this.border ?? theme.border
border: this.border ?? theme.border,
alignLabelWithHint: this.alignLabelWithHint ?? theme.alignLabelWithHint
);
}

}
public bool Equals(InputDecoration other) {
return other.icon == this.icon
&& other.labelText == this.labelText
&& other.labelStyle == this.labelStyle
&& other.helperText == this.helperText
&& other.helperStyle == this.helperStyle
&& other.hintText == this.hintText
&& other.hintStyle == this.hintStyle
&& other.errorText == this.errorText
&& other.errorStyle == this.errorStyle
&& other.errorMaxLines == this.errorMaxLines
&& other.hasFloatingPlaceholder == this.hasFloatingPlaceholder
&& other.isDense == this.isDense
&& other.contentPadding == this.contentPadding
&& other.isCollapsed == this.isCollapsed
&& other.prefixIcon == this.prefixIcon
&& other.prefix == this.prefix
&& other.prefixText == this.prefixText
&& other.prefixStyle == this.prefixStyle
&& other.suffixIcon == this.suffixIcon
&& other.suffix == this.suffix
&& other.suffixText == this.suffixText
&& other.suffixStyle == this.suffixStyle
&& other.counterText == this.counterText
&& other.counterStyle == this.counterStyle
&& other.filled == this.filled
&& other.fillColor == this.fillColor
&& other.errorBorder == this.errorBorder
&& other.focusedBorder == this.focusedBorder
&& other.focusedErrorBorder == this.focusedErrorBorder
&& other.disabledBorder == this.disabledBorder
&& other.enabledBorder == this.enabledBorder
&& other.border == this.border
&& other.enabled == this.enabled;
return Equals(other.icon, this.icon)
&& Equals(other.labelText, this.labelText)
&& Equals(other.labelStyle, this.labelStyle)
&& Equals(other.helperText, this.helperText)
&& Equals(other.helperStyle, this.helperStyle)
&& Equals(other.hintText, this.hintText)
&& Equals(other.hintStyle, this.hintStyle)
&& Equals(other.hintMaxLines, this.hintMaxLines)
&& Equals(other.errorText, this.errorText)
&& Equals(other.errorStyle, this.errorStyle)
&& Equals(other.errorMaxLines, this.errorMaxLines)
&& Equals(other.hasFloatingPlaceholder, this.hasFloatingPlaceholder)
&& Equals(other.isDense, this.isDense)
&& Equals(other.contentPadding, this.contentPadding)
&& Equals(other.isCollapsed, this.isCollapsed)
&& Equals(other.prefixIcon, this.prefixIcon)
&& Equals(other.prefix, this.prefix)
&& Equals(other.prefixText, this.prefixText)
&& Equals(other.prefixStyle, this.prefixStyle)
&& Equals(other.suffixIcon, this.suffixIcon)
&& Equals(other.suffix, this.suffix)
&& Equals(other.suffixText, this.suffixText)
&& Equals(other.suffixStyle, this.suffixStyle)
&& Equals(other.counter, this.counter)
&& Equals(other.counterText, this.counterText)
&& Equals(other.counterStyle, this.counterStyle)
&& Equals(other.filled, this.filled)
&& Equals(other.fillColor, this.fillColor)
&& Equals(other.errorBorder, this.errorBorder)
&& Equals(other.focusedBorder, this.focusedBorder)
&& Equals(other.focusedErrorBorder, this.focusedErrorBorder)
&& Equals(other.disabledBorder, this.disabledBorder)
&& Equals(other.enabledBorder, this.enabledBorder)
&& Equals(other.border, this.border)
&& Equals(other.enabled, this.enabled)
&& Equals(other.alignLabelWithHint, this.alignLabelWithHint);
return this.Equals((InputDecoration) obj);
}

hashCode = (hashCode * 397) ^ this.helperStyle.GetHashCode();
hashCode = (hashCode * 397) ^ this.hintText.GetHashCode();
hashCode = (hashCode * 397) ^ this.hintStyle.GetHashCode();
hashCode = (hashCode * 397) ^ this.hintMaxLines.GetHashCode();
hashCode = (hashCode * 397) ^ this.errorText.GetHashCode();
hashCode = (hashCode * 397) ^ this.errorStyle.GetHashCode();
hashCode = (hashCode * 397) ^ this.errorMaxLines.GetHashCode();

hashCode = (hashCode * 397) ^ this.suffix.GetHashCode();
hashCode = (hashCode * 397) ^ this.suffixText.GetHashCode();
hashCode = (hashCode * 397) ^ this.suffixStyle.GetHashCode();
hashCode = (hashCode * 397) ^ this.counter.GetHashCode();
hashCode = (hashCode * 397) ^ this.counterText.GetHashCode();
hashCode = (hashCode * 397) ^ this.counterStyle.GetHashCode();
hashCode = (hashCode * 397) ^ this.filled.GetHashCode();

hashCode = (hashCode * 397) ^ this.enabledBorder.GetHashCode();
hashCode = (hashCode * 397) ^ this.border.GetHashCode();
hashCode = (hashCode * 397) ^ this.enabled.GetHashCode();
hashCode = (hashCode * 397) ^ this.alignLabelWithHint.GetHashCode();
return hashCode;
}
}

if (this.helperText != null) {
description.Add($"helperText: ${this.helperText}");
}
if (this.hintMaxLines != null) {
description.Add($"hintMaxLines: ${this.hintMaxLines}");
}
if (this.hintText != null) {

description.Add($"suffixStyle: ${this.suffixStyle}");
}
if (this.counter != null) {
description.Add($"counter: ${this.counter}");
}
if (this.counterText != null) {
description.Add($"counterText: ${this.counterText}");
}

description.Add("enabled: false");
}
if (this.alignLabelWithHint != null) {
description.Add($"alignLabelWithHint: {this.alignLabelWithHint}");
}
return $"InputDecoration(${string.Join(", ", description)})";
}
}

InputBorder focusedErrorBorder = null,
InputBorder disabledBorder = null,
InputBorder enabledBorder = null,
InputBorder border = null
InputBorder border = null,
bool alignLabelWithHint = false
) {
D.assert(isDense != null);
D.assert(isCollapsed != null);

this.disabledBorder = disabledBorder;
this.enabledBorder = enabledBorder;
this.border = border;
this.alignLabelWithHint = alignLabelWithHint;
}
public readonly TextStyle labelStyle;

public readonly InputBorder border;
public readonly bool alignLabelWithHint;
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
InputDecorationTheme defaultTheme = new InputDecorationTheme();

defaultValue: defaultTheme.errorBorder));
properties.add(new DiagnosticsProperty<InputBorder>("focusedBorder", this.focusedBorder,
defaultValue: defaultTheme.focusedErrorBorder));
properties.add(new DiagnosticsProperty<InputBorder>("focusedErrorborder", this.focusedErrorBorder,
properties.add(new DiagnosticsProperty<InputBorder>("focusedErrorBorder", this.focusedErrorBorder,
defaultValue: defaultTheme.focusedErrorBorder));
properties.add(new DiagnosticsProperty<InputBorder>("disabledBorder", this.disabledBorder,
defaultValue: defaultTheme.disabledBorder));

new DiagnosticsProperty<InputBorder>("border", this.border, defaultValue: defaultTheme.border));
properties.add(new DiagnosticsProperty<bool>("alignLabelWithHint", this.alignLabelWithHint,
defaultValue: defaultTheme.alignLabelWithHint));
}
}
}

19
Runtime/material/list_tile.cs


D.assert(isOneLine);
}
float defaultTileHeight = this._defaultTileHeight;
tileHeight = Mathf.Max(this._defaultTileHeight, titleSize.height + 2.0f * _minVerticalPadding);
tileHeight = Mathf.Max(defaultTileHeight, titleSize.height + 2.0f * _minVerticalPadding);
titleY = (tileHeight - titleSize.height) / 2.0f;
}
else {

_boxBaseline(this.subtitle, this.subtitleBaselineType ?? TextBaseline.alphabetic);
tileHeight = this._defaultTileHeight;
tileHeight = defaultTileHeight;
float titleOverlap = titleY + titleSize.height - subtitleY;
if (titleOverlap > 0.0f) {

}
}
float leadingY = (tileHeight - leadingSize.height) / 2.0f;
float trailingY = (tileHeight - trailingSize.height) / 2.0f;
float leadingY;
float trailingY;
if (tileHeight > 72.0f) {
leadingY = 16.0f;
trailingY = 16.0f;
}
else {
leadingY = Mathf.Min((tileHeight - leadingSize.height) / 2.0f, 16.0f);
trailingY = (tileHeight - trailingSize.height) / 2.0f;
}
if (hasLeading) {
_positionBox(this.leading, new Offset(0.0f, leadingY));

31
Runtime/material/material.cs


TextStyle textStyle = null,
BorderRadius borderRadius = null,
ShapeBorder shape = null,
bool borderOnForeground = true,
D.assert(elevation >= 0.0f);
D.assert(!(shape != null && borderRadius != null));
D.assert(!(type == MaterialType.circle && (borderRadius != null || shape != null)));

this.textStyle = textStyle;
this.borderRadius = borderRadius;
this.shape = shape;
this.borderOnForeground = borderOnForeground;
this.clipBehavior = clipBehavior;
this.animationDuration = animationDuration ?? Constants.kThemeChangeDuration;
this.child = child;

public readonly ShapeBorder shape;
public readonly bool borderOnForeground;
public readonly Clip clipBehavior;
public readonly TimeSpan animationDuration;

defaultValue: new Color(0xFF000000)));
this.textStyle?.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<ShapeBorder>("shape", this.shape, defaultValue: null));
properties.add(new EnumProperty<BorderRadius>("borderRadius", this.borderRadius, defaultValue: null));
properties.add(new DiagnosticsProperty<bool>("borderOnForeground", this.borderOnForeground,
defaultValue: null));
properties.add(
new DiagnosticsProperty<BorderRadius>("borderRadius", this.borderRadius, defaultValue: null));
}
public const float defaultSplashRadius = 35.0f;

if (this.widget.type == MaterialType.transparency) {
return _transparentInterior(
context: context,
shape: shape,
clipBehavior: this.widget.clipBehavior,
contents: contents);

curve: Curves.fastOutSlowIn,
duration: this.widget.animationDuration,
shape: shape,
borderOnForeground: this.widget.borderOnForeground,
clipBehavior: this.widget.clipBehavior,
elevation: this.widget.elevation,
color: backgroundColor,

static Widget _transparentInterior(
BuildContext context = null,
ShapeBorder shape = null,
Clip? clipBehavior = null,
Widget contents = null) {

Key key = null,
Widget child = null,
ShapeBorder shape = null,
bool borderOnForeground = true,
Clip clipBehavior = Clip.none,
float? elevation = null,
Color color = null,

) : base(key: key, curve: curve ?? Curves.linear, duration: duration) {
D.assert(child != null);
D.assert(shape != null);
D.assert(elevation != null);
D.assert(elevation != null && elevation >= 0.0f);
this.borderOnForeground = borderOnForeground;
this.clipBehavior = clipBehavior;
this.elevation = elevation ?? 0.0f;
this.color = color;

public readonly Widget child;
public readonly ShapeBorder shape;
public readonly bool borderOnForeground;
public readonly Clip clipBehavior;

return new PhysicalShape(
child: new _ShapeBorderPaint(
child: this.widget.child,
shape: shape),
shape: shape,
borderOnForeground: this.widget.borderOnForeground),
clipper: new ShapeBorderClipper(
shape: shape),
clipBehavior: this.widget.clipBehavior,

class _ShapeBorderPaint : StatelessWidget {
public _ShapeBorderPaint(
Widget child = null,
ShapeBorder shape = null) {
ShapeBorder shape = null,
bool borderOnForeground = true) {
this.borderOnForeground = borderOnForeground;
public readonly bool borderOnForeground;
foregroundPainter: new _ShapeBorderPainter(this.shape));
painter: this.borderOnForeground ? null : new _ShapeBorderPainter(this.shape),
foregroundPainter: this.borderOnForeground ? new _ShapeBorderPainter(this.shape) : null);
}
}

1
Runtime/material/material_button.cs


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

72
Runtime/material/outline_button.cs


);
}
public override void didUpdateWidget(StatefulWidget _oldWidget) {
_OutlineButton oldWidget = _oldWidget as _OutlineButton;
base.didUpdateWidget(oldWidget);
if (this._pressed && !this.widget.enabled) {
this._pressed = false;
this._controller.reverse();
}
}
void _handleHighlightChanged(bool value) {
if (this._pressed == value) {
return;
}
this.setState(() => {
this._pressed = value;
if (value) {
this._controller.forward();
}
else {
this._controller.reverse();
}
});
}
public override void dispose() {
this._controller.dispose();
base.dispose();

bool themeIsDark = this.widget.brightness == Brightness.dark;
Color color = this.widget.color ?? (themeIsDark
? new Color(0x00000000)
: new Color(0x00FFFFFF));
if (this.widget.highlightElevation == null || this.widget.highlightElevation == 0.0) {
return Colors.transparent;
}
Color color = this.widget.color ?? Theme.of(this.context).canvasColor;
ColorTween colorTween = new ColorTween(
begin: color.withAlpha(0x00),
end: color.withAlpha(0xFF)

BorderSide _getOutline() {
bool isDark = this.widget.brightness == Brightness.dark;
Color color = this.widget.enabled
? (this._pressed
? this.widget.highlightedBorderColor
: (this.widget.borderSide?.color ??
(isDark ? Colors.grey[600] : Colors.grey[200])))
: (this.widget.disabledBorderColor ??
(isDark ? Colors.grey[800] : Colors.grey[100]));
Color specifiedColor = this.widget.enabled
? (this._pressed ? this.widget.highlightedBorderColor : null) ?? this.widget.borderSide?.color
: this.widget.disabledBorderColor;
Color themeColor = Theme.of(this.context).colorScheme.onSurface.withOpacity(0.12f);
color: color,
width: this.widget.borderSide?.width ?? 2.0f
color: specifiedColor ?? themeColor,
width: this.widget.borderSide?.width ?? 1.0f
if (this.widget.highlightElevation == null || this.widget.highlightElevation == 0.0f) {
return 0.0f;
}
return new FloatTween(
begin: 0.0f,
end: this.widget.highlightElevation ?? 2.0f

elevation: 0.0f,
disabledElevation: 0.0f,
highlightElevation: this._getHighlightElevation(),
onHighlightChanged: (bool value) => {
this.setState(() => {
this._pressed = value;
if (value) {
this._controller.forward();
}
else {
this._controller.reverse();
}
});
},
onHighlightChanged: this._handleHighlightChanged,
padding:
this.widget.padding,
shape: new _OutlineBorder(

public bool Equals(_OutlineBorder other) {
return this.side == other.side && this.shape == other.shape;
}
return this.Equals((_OutlineBorder) obj);
}

50
Runtime/material/reorderable_list.cs


List<Widget> children = null,
ReorderCallback onReorder = null,
Axis scrollDirection = Axis.vertical,
EdgeInsets padding = null
EdgeInsets padding = null,
bool reverse = false
) {
D.assert(onReorder != null);
D.assert(children != null);

this.scrollDirection = scrollDirection;
this.padding = padding;
this.onReorder = onReorder;
this.reverse = reverse;
}
public readonly Widget header;

public readonly ReorderCallback onReorder;
public readonly bool reverse;
public override State createState() {
return new _ReorderableListViewState();
}

children: this.widget.children,
scrollDirection: this.widget.scrollDirection,
onReorder: this.widget.onReorder,
padding: this.widget.padding
padding: this.widget.padding,
reverse: this.widget.reverse
);
}
);

List<Widget> children,
Axis scrollDirection,
EdgeInsets padding,
ReorderCallback onReorder
ReorderCallback onReorder,
bool? reverse = null
) {
this.header = header;
this.children = children;

this.reverse = reverse;
}
public readonly Widget header;

public readonly ReorderCallback onReorder;
public readonly bool? reverse;
public override State createState() {
return new _ReorderableListContentState();

Widget _wrap(Widget toWrap, int index, BoxConstraints constraints) {
D.assert(toWrap.key != null);
GlobalObjectKey<State<_ReorderableListContent>> keyIndexGlobalKey = new GlobalObjectKey<State<_ReorderableListContent>>(toWrap.key);
GlobalObjectKey<State<_ReorderableListContent>> keyIndexGlobalKey =
new GlobalObjectKey<State<_ReorderableListContent>>(toWrap.key);
void onDragStarted() {
this.setState(() => {

void onDragEnded() {
reorder(this._dragStartIndex, this._currentIndex);
}
return new KeyedSubtree(
key: keyIndexGlobalKey,
child: toWrap
);
return new KeyedSubtree(
key: keyIndexGlobalKey,
child: toWrap
);
}
Widget buildDragTarget(BuildContext context, List<Key> acceptedCandidates, List<Key> rejectedCandidates) {

break;
}
wrappedChildren.Add(this._wrap(
finalDropArea, this.widget.children.Count,
constraints)
);
if (this.widget.reverse == true) {
wrappedChildren.Insert(0, this._wrap(
finalDropArea,
this.widget.children.Count,
constraints)
);
}
else {
wrappedChildren.Add(this._wrap(
finalDropArea, this.widget.children.Count,
constraints)
);
}
controller: this._scrollController
controller: this._scrollController,
reverse: this.widget.reverse == true
);
});
}

88
Runtime/material/scaffold.cs


using Unity.UIWidgets.animation;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;

float floatingActionButtonMoveAnimationProgress,
FloatingActionButtonAnimator floatingActionButtonMotionAnimator
) {
D.assert(minInsets != null);
D.assert(geometryNotifier != null);
D.assert(previousFloatingActionButtonLocation != null);
D.assert(currentFloatingActionButtonLocation != null);

Widget bottomNavigationBar = null,
Widget bottomSheet = null,
Color backgroundColor = null,
bool resizeToAvoidBottomPadding = true,
bool primary = true
bool? resizeToAvoidBottomPadding = null,
bool? resizeToAvoidBottomInset = null,
bool primary = true,
DragStartBehavior drawerDragStartBehavior = DragStartBehavior.down
) : base(key: key) {
this.appBar = appBar;
this.body = body;

this.bottomSheet = bottomSheet;
this.backgroundColor = backgroundColor;
this.resizeToAvoidBottomPadding = resizeToAvoidBottomPadding;
this.resizeToAvoidBottomInset = resizeToAvoidBottomInset;
this.drawerDragStartBehavior = drawerDragStartBehavior;
}
public readonly PreferredSizeWidget appBar;

public readonly Widget bottomSheet;
public readonly bool resizeToAvoidBottomPadding;
public readonly bool? resizeToAvoidBottomPadding;
public readonly bool? resizeToAvoidBottomInset;
public readonly DragStartBehavior drawerDragStartBehavior;
public static ScaffoldState of(BuildContext context, bool nullOk = false) {
D.assert(context != null);

// INTERNALS
_ScaffoldGeometryNotifier _geometryNotifier;
bool _resizeToAvoidBottomInset {
get { return this.widget.resizeToAvoidBottomInset ?? this.widget.resizeToAvoidBottomPadding ?? true; }
}
public override void initState() {
base.initState();

bool removeLeftPadding,
bool removeTopPadding,
bool removeRightPadding,
bool removeBottomPadding
bool removeBottomPadding,
bool removeBottomInset = false
MediaQueryData data = MediaQuery.of(this.context).removePadding(
removeLeft: removeLeftPadding,
removeTop: removeTopPadding,
removeRight: removeRightPadding,
removeBottom: removeBottomPadding
);
if (removeBottomInset) {
data = data.removeViewInsets(removeBottom: true);
}
child: MediaQuery.removePadding(
context: this.context,
removeLeft: removeLeftPadding,
removeTop: removeTopPadding,
removeRight: removeRightPadding,
removeBottom: removeBottomPadding,
child: child
)
child: new MediaQuery(data: data, child: child)
)
);
}

key: this._endDrawerKey,
alignment: DrawerAlignment.end,
child: this.widget.endDrawer,
drawerCallback: this._endDrawerOpenedCallback
drawerCallback: this._endDrawerOpenedCallback,
dragStartBehavior: this.widget.drawerDragStartBehavior
),
childId: _ScaffoldSlot.endDrawer,
removeLeftPadding: true,

key: this._drawerKey,
alignment: DrawerAlignment.start,
child: this.widget.drawer,
drawerCallback: this._drawerOpenedCallback
drawerCallback: this._drawerOpenedCallback,
dragStartBehavior: this.widget.drawerDragStartBehavior
),
childId: _ScaffoldSlot.drawer,
removeLeftPadding: false,

removeTopPadding: this.widget.appBar != null,
removeRightPadding: false,
removeBottomPadding: this.widget.bottomNavigationBar != null ||
this.widget.persistentFooterButtons != null
this.widget.persistentFooterButtons != null,
removeBottomInset: this._resizeToAvoidBottomInset
);
if (this.widget.appBar != null) {

}
if (this._snackBars.isNotEmpty()) {
bool removeBottomPadding = this.widget.persistentFooterButtons != null ||
this.widget.bottomNavigationBar != null;
this._addIfNonNull(
children: children,
child: this._snackBars.First()._widget,

removeRightPadding: false,
removeBottomPadding: removeBottomPadding
removeBottomPadding: this.widget.bottomNavigationBar != null ||
this.widget.persistentFooterButtons != null
);
}

removeLeftPadding: false,
removeTopPadding: true,
removeRightPadding: false,
removeBottomPadding: this.widget.resizeToAvoidBottomPadding
removeBottomPadding: this._resizeToAvoidBottomInset
);
}

removeBottomPadding: true
);
if (themeData.platform == RuntimePlatform.IPhonePlayer) {
this._addIfNonNull(
children: children,
new GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: this._handleStatusBarTap
),
childId: _ScaffoldSlot.statusBar,
removeLeftPadding: false,
removeTopPadding: true,
removeRightPadding: false,
removeBottomPadding: true
);
switch (themeData.platform) {
case RuntimePlatform.IPhonePlayer:
this._addIfNonNull(
children: children,
new GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: this._handleStatusBarTap
),
childId: _ScaffoldSlot.statusBar,
removeLeftPadding: false,
removeTopPadding: true,
removeRightPadding: false,
removeBottomPadding: true
);
break;
}
if (this._endDrawerOpened) {

}
EdgeInsets minInsets = mediaQuery.padding.copyWith(
bottom: this.widget.resizeToAvoidBottomPadding ? mediaQuery.viewInsets.bottom : 0.0f
bottom: this._resizeToAvoidBottomInset ? mediaQuery.viewInsets.bottom : 0.0f
);
return new _ScaffoldScope(

75
Runtime/material/switch.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.scheduler;

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

activeThumbImage: activeThumbImage,
inactiveThumbImage: inactiveThumbImage,
materialTapTargetSize: materialTapTargetSize,
switchType: _SwitchType.material
switchType: _SwitchType.material,
dragStartBehavior: dragStartBehavior
) {
}

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

this.inactiveThumbImage = inactiveThumbImage;
this.materialTapTargetSize = materialTapTargetSize;
this._switchType = switchType;
this.dragStartBehavior = dragStartBehavior;
}
public static Switch adaptive(

Color inactiveTrackColor = null,
ImageProvider activeThumbImage = null,
ImageProvider inactiveThumbImage = null,
MaterialTapTargetSize? materialTapTargetSize = null
MaterialTapTargetSize? materialTapTargetSize = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.down
) {
return new Switch(key: key,
value: value,

internal readonly _SwitchType _switchType;
public readonly DragStartBehavior dragStartBehavior;
public override State createState() {
return new _SwitchState();
}

properties.add(new FlagProperty("value", value: this.value, ifTrue: "on", ifFalse: "off", showName: true));
properties.add(new ObjectFlagProperty<ValueChanged<bool?>>("onChanged", this.onChanged, ifNull: "disabled"));
properties.add(
new ObjectFlagProperty<ValueChanged<bool?>>("onChanged", this.onChanged, ifNull: "disabled"));
}
}

case MaterialTapTargetSize.shrinkWrap:
return new Size(Switch._kSwitchWidth, Switch._kSwitchHeightCollapsed);
}
D.assert(false);
return null;
}

inactiveThumbColor = this.widget.inactiveThumbColor ??
(isDark ? Colors.grey.shade400 : Colors.grey.shade50);
inactiveTrackColor = this.widget.inactiveTrackColor ?? (isDark ? Colors.white30 : black32);
} else {
}
else {
inactiveThumbColor = this.widget.inactiveThumbColor ??
(isDark ? Colors.grey.shade800 : Colors.grey.shade400);
inactiveTrackColor = this.widget.inactiveTrackColor ?? (isDark ? Colors.white10 : Colors.black12);

dragStartBehavior: this.widget.dragStartBehavior,
value: this.widget.value,
activeColor: activeThumbColor,
inactiveColor: inactiveThumbColor,

ImageConfiguration configuration = null,
ValueChanged<bool?> onChanged = null,
TickerProvider vsync = null,
BoxConstraints additionalConstraints = null
BoxConstraints additionalConstraints = null,
DragStartBehavior? dragStartBehavior = null
) : base(key: key) {
D.assert(value != null);
this.value = value.Value;

this.onChanged = onChanged;
this.vsync = vsync;
this.additionalConstraints = additionalConstraints;
this.dragStartBehavior = dragStartBehavior;
}
public readonly bool value;

public readonly ValueChanged<bool?> onChanged;
public readonly TickerProvider vsync;
public readonly BoxConstraints additionalConstraints;
public readonly DragStartBehavior? dragStartBehavior;
dragStartBehavior: this.dragStartBehavior,
value: this.value,
activeColor: this.activeColor,
inactiveColor: this.inactiveColor,

renderObject.configuration = this.configuration;
renderObject.onChanged = this.onChanged;
renderObject.additionalConstraints = this.additionalConstraints;
renderObject.dragStartBehavior = this.dragStartBehavior;
renderObject.vsync = this.vsync;
}
}

ImageConfiguration configuration = null,
BoxConstraints additionalConstraints = null,
ValueChanged<bool?> onChanged = null,
TickerProvider vsync = null
TickerProvider vsync = null,
DragStartBehavior? dragStartBehavior = null
) : base(
value: value,
tristate: false,

onStart = this._handleDragStart,
onUpdate = this._handleDragUpdate,
onEnd = this._handleDragEnd,
dragStartBehavior = dragStartBehavior ?? DragStartBehavior.down
};
}

if (value == this._activeThumbImage) {
return;
}
this._activeThumbImage = value;
this.markNeedsPaint();
}

if (value == this._inactiveThumbImage) {
return;
}
this._inactiveThumbImage = value;
this.markNeedsPaint();
}

if (value == this._activeTrackColor) {
return;
}
this._activeTrackColor = value;
this.markNeedsPaint();
}

if (value == this._inactiveTrackColor) {
return;
}
this._inactiveTrackColor = value;
this.markNeedsPaint();
}

if (value == this._configuration) {
return;
}
this._configuration = value;
this.markNeedsPaint();
}

public DragStartBehavior? dragStartBehavior {
get { return this._drag.dragStartBehavior; }
set { this._drag.dragStartBehavior = value ?? DragStartBehavior.down; }
}
public override void detach() {
this._cachedThumbPainter?.Dispose();

void _handleDragEnd(DragEndDetails details) {
if (this.position.value >= 0.5) {
this.positionController.forward();
} else {
}
else {
this.reactionController.reverse();
}

this._drag.addPointer((PointerDownEvent) evt);
}
base.handleEvent(evt, entry);
}

public override void paint(PaintingContext context, Offset offset) {
Canvas canvas = context.canvas;
bool isActive = this.onChanged != null;
bool isEnabled = this.onChanged != null;
Color trackColor = isActive
Color trackColor = isEnabled
Color thumbColor = isEnabled
? Color.lerp(this.inactiveColor, this.activeColor, currentValue)
: this.inactiveColor;
ImageProvider thumbImage = isEnabled
? (currentValue < 0.5 ? this.inactiveThumbImage : this.activeThumbImage)
: this.inactiveThumbImage;
// Paint the track
Paint paint = new Paint {color = trackColor};
float trackHorizontalPadding = Constants.kRadialReactionRadius - Switch._kTrackRadius;

try {
this._isPainting = true;
BoxPainter thumbPainter;
Color thumbColor = isActive
? Color.lerp(this.inactiveColor, this.activeColor, currentValue)
: this.inactiveColor;
ImageProvider thumbImage = isActive
? (currentValue < 0.5 ? this.inactiveThumbImage : this.activeThumbImage)
: this.inactiveThumbImage;
if (this._cachedThumbPainter == null || thumbColor != this._cachedThumbColor ||
thumbImage != this._cachedThumbImage) {
this._cachedThumbColor = thumbColor;

}
thumbPainter = this._cachedThumbPainter;
float inset = 1.0f - (currentValue - 0.5f).abs() * 2.0f;

thumbPosition + offset - new Offset(radius, radius),
this.configuration.copyWith(size: Size.fromRadius(radius))
);
} finally {
}
finally {
}
}

26
Runtime/material/tab_bar_theme.cs


using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
namespace Unity.UIWidgets.material {
public class TabBarTheme : Diagnosticable, IEquatable<TabBarTheme> {

Color labelColor = null,
Color unselectedLabelColor = null) {
TextStyle labelStyle = null,
Color unselectedLabelColor = null,
TextStyle unselectedLabelStyle = null) {
this.labelStyle = labelStyle;
this.unselectedLabelStyle = unselectedLabelStyle;
}
public readonly Decoration indicator;

public readonly Color labelColor;
public readonly TextStyle labelStyle;
public readonly TextStyle unselectedLabelStyle;
Color unselectedLabelColor = null
TextStyle labelStyle = null,
Color unselectedLabelColor = null,
TextStyle unselectedLabelStyle = null
unselectedLabelColor: unselectedLabelColor ?? this.unselectedLabelColor);
labelStyle: labelStyle ?? this.labelStyle,
unselectedLabelColor: unselectedLabelColor ?? this.unselectedLabelColor,
unselectedLabelStyle: unselectedLabelStyle ?? this.unselectedLabelStyle);
}
public static TabBarTheme of(BuildContext context) {

indicator: Decoration.lerp(a.indicator, b.indicator, t),
indicatorSize: t < 0.5 ? a.indicatorSize : b.indicatorSize,
labelColor: Color.lerp(a.labelColor, b.labelColor, t),
unselectedLabelColor: Color.lerp(a.unselectedLabelColor, b.unselectedLabelColor, 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)
);
}

hashCode = (hashCode * 397) ^ (this.indicatorSize != null ? this.indicatorSize.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.labelColor != null ? this.labelColor.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.labelStyle != null ? this.labelStyle.GetHashCode() : 0);
hashCode = (hashCode * 397) ^
(this.unselectedLabelStyle != null ? this.unselectedLabelStyle.GetHashCode() : 0);
return hashCode;
}
}

44
Runtime/material/tabs.cs


using RSG;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;

height = TabsUtils._kTabHeight;
label = this._buildLabelText();
}
else if (this.text == null) {
else if (this.text == null && this.child == null) {
height = TabsUtils._kTabHeight;
label = this.icon;
}

ThemeData themeData = Theme.of(context);
TabBarTheme tabBarTheme = TabBarTheme.of(context);
TextStyle defaultStyle = this.labelStyle ?? themeData.primaryTextTheme.body2;
TextStyle defaultUnselectedStyle =
this.unselectedLabelStyle ?? this.labelStyle ?? themeData.primaryTextTheme.body2;
TextStyle defaultStyle = this.labelStyle ?? tabBarTheme.labelStyle ?? themeData.primaryTextTheme.body2;
TextStyle defaultUnselectedStyle = this.unselectedLabelStyle
?? tabBarTheme.unselectedLabelStyle
?? this.labelStyle ?? themeData.primaryTextTheme.body2;
Animation<float> animation = (Animation<float>) this.listenable;
TextStyle textStyle = this.selected
? TextStyle.lerp(defaultStyle, defaultUnselectedStyle, animation.value)

}
public readonly _TabBarState tabBar;
bool _initialViewportDimensionWasZero;
if (!this.havePixels) {
this.correctPixels(this.tabBar._initialScrollOffset(this.viewportDimension, minScrollExtent, maxScrollExtent));
if (this._initialViewportDimensionWasZero != true) {
this._initialViewportDimensionWasZero = this.viewportDimension != 0.0;
this.correctPixels(this.tabBar._initialScrollOffset(this.viewportDimension, minScrollExtent,
maxScrollExtent));
return base.applyContentDimensions(minScrollExtent, maxScrollExtent) && result;
}
}

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

this.labelPadding = labelPadding;
this.unselectedLabelColor = unselectedLabelColor;
this.unselectedLabelStyle = unselectedLabelStyle;
this.dragStartBehavior = dragStartBehavior;
this.onTap = onTap;
}
public readonly List<Widget> tabs;

public readonly TextStyle unselectedLabelStyle;
public readonly DragStartBehavior dragStartBehavior;
public readonly ValueChanged<int> onTap;
public override Size preferredSize {
get {
foreach (Widget item in this.tabs) {

}
Color color = this.widget.indicatorColor ?? Theme.of(this.context).indicatorColor;
if (color.value == Material.of(this.context).color.value) {
if (color.value == Material.of(this.context).color?.value) {
color = Colors.white;
}

void _handleTap(int index) {
D.assert(index >= 0 && index < this.widget.tabs.Count);
this._controller.animateTo(index);
if (this.widget.onTap != null) {
this.widget.onTap(index);
}
}
Widget _buildStyledTab(Widget child, bool selected, Animation<float> animation) {

if (this.widget.isScrollable) {
this._scrollController = this._scrollController ?? new _TabBarScrollController(this);
tabBar = new SingleChildScrollView(
dragStartBehavior: this.widget.dragStartBehavior,
scrollDirection: Axis.horizontal,
controller: this._scrollController,
child: tabBar);

Key key = null,
List<Widget> children = null,
TabController controller = null,
ScrollPhysics physics = null
ScrollPhysics physics = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.down
this.dragStartBehavior = dragStartBehavior;
}
public readonly TabController controller;

public readonly ScrollPhysics physics;
public readonly DragStartBehavior dragStartBehavior;
public override State createState() {
return new _TabBarViewState();

return new NotificationListener<ScrollNotification>(
onNotification: this._handleScrollNotification,
child: new PageView(
dragStartBehavior: this.widget.dragStartBehavior,
controller: this._pageController,
physics: this.widget.physics == null
? TabsUtils._kTabBarViewPhysics

146
Runtime/material/text_field.cs


using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;
public delegate Widget InputCounterWidgetBuilder(
BuildContext buildContext,
int? currentLength,
int? maxLength,
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,

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,
bool enableInteractiveSelection = true,
GestureTapCallback onTap = null
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
bool? enableInteractiveSelection = null,
GestureTapCallback onTap = null,
InputCounterWidgetBuilder buildCounter = null
D.assert(maxLength == null || maxLength > 0);
D.assert(maxLength == null || maxLength == TextField.noMaxLength || maxLength > 0);
this.controller = controller;
this.focusNode = focusNode;

this.onTap = onTap;
this.keyboardType = keyboardType ?? (maxLines == 1 ? TextInputType.text : TextInputType.multiline);
this.scrollPadding = scrollPadding ?? EdgeInsets.all(20.0f);
this.dragStartBehavior = dragStartBehavior;
this.buildCounter = buildCounter;
}
public readonly TextEditingController controller;

public readonly bool autocorrect;
public readonly int? maxLines;
public const long noMaxLength = 9007199254740992; // math.pow(2, 53);
public const long noMaxLength = -1;
public readonly int? maxLength;

public readonly EdgeInsets scrollPadding;
public readonly bool enableInteractiveSelection;
public readonly bool? enableInteractiveSelection;
public readonly DragStartBehavior dragStartBehavior;
public bool selectionEnabled {
get {
return this.enableInteractiveSelection ?? !this.obscureText;
}
}
public readonly InputCounterWidgetBuilder buildCounter;
public override State createState() {
return new _TextFieldState();

new DiagnosticsProperty<TextEditingController>("controller", this.controller, defaultValue: null));
properties.add(new DiagnosticsProperty<FocusNode>("focusNode", this.focusNode, defaultValue: null));
properties.add(new DiagnosticsProperty<bool?>("enabled", this.enabled, defaultValue: null));
properties.add(new DiagnosticsProperty<InputDecoration>("decoration", this.decoration));
properties.add(new DiagnosticsProperty<InputDecoration>("decoration", this.decoration, defaultValue: new InputDecoration()));
properties.add(new DiagnosticsProperty<bool>("autocorrect", this.autocorrect, defaultValue: false));
properties.add(new DiagnosticsProperty<bool>("autocorrect", this.autocorrect, defaultValue: true));
properties.add(new FlagProperty("maxLengthEnforced", value: this.maxLengthEnforced,
ifTrue: "max length enforced"));
properties.add(new DiagnosticsProperty<GestureTapCallback>("onTap", this.onTap, defaultValue: null));
properties.add(new FlagProperty("maxLengthEnforced", value: this.maxLengthEnforced, defaultValue: true,
ifFalse: "maxLength not enforced"));
properties.add(new EnumProperty<TextInputAction?>("textInputAction", this.textInputAction, defaultValue: null));
properties.add(new EnumProperty<TextCapitalization>("textCapitalization", this.textCapitalization, defaultValue: TextCapitalization.none));
properties.add(new EnumProperty<TextAlign>("textAlign", this.textAlign, defaultValue: TextAlign.left));
properties.add(new EnumProperty<TextDirection>("textDirection", this.textDirection, defaultValue: null));
properties.add(new FloatProperty("cursorWidth", this.cursorWidth, defaultValue: 2.0));
properties.add(new DiagnosticsProperty<Radius>("cursorRadius", this.cursorRadius, defaultValue: null));
properties.add(new DiagnosticsProperty<Color>("cursorColor", this.cursorColor, defaultValue: null));
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"));
}
}

InputDecoration _getEffectiveDecoration() {
MaterialLocalizations localizations = MaterialLocalizations.of(this.context);
ThemeData themeData = Theme.of(this.context);
.applyDefaults(Theme.of(this.context).inputDecorationTheme)
.applyDefaults(themeData.inputDecorationTheme)
enabled: this.widget.enabled
enabled: this.widget.enabled,
hintMaxLines: this.widget.decoration?.hintMaxLines ?? this.widget.maxLines
if (!this.needsCounter) {
if (effectiveDecoration.counter != null || effectiveDecoration.counterText != null) {
Widget counter;
if (effectiveDecoration.counter == null
&& effectiveDecoration.counterText == null
&& this.widget.buildCounter != null) {
bool isFocused = this._effectiveFocusNode.hasFocus;
counter = this.widget.buildCounter(
this.context,
currentLength: currentLength,
maxLength: this.widget.maxLength,
isFocused: isFocused
);
return effectiveDecoration.copyWith(counter: counter);
}
if (this.widget.maxLength == null)
return effectiveDecoration;
if (this.widget.maxLength != TextField.noMaxLength) {
if (this.widget.maxLength > 0) {
if (this._effectiveController.value.text.Length > this.widget.maxLength) {
return effectiveDecoration.copyWith(
errorText: effectiveDecoration.errorText ?? "",
counterStyle: effectiveDecoration.errorStyle
?? themeData.textTheme.caption.copyWith(color: themeData.errorColor),
counterText: counterText
);
}
if (this._effectiveController.value.text.Length > this.widget.maxLength) {
ThemeData themeData = Theme.of(this.context);
return effectiveDecoration.copyWith(
errorText: effectiveDecoration.errorText ?? "",
counterStyle: effectiveDecoration.errorStyle
?? themeData.textTheme.caption.copyWith(color: themeData.errorColor),
counterText: counterText
);
}
return effectiveDecoration.copyWith(
counterText: counterText

}
void _handleSelectionChanged(TextSelection selection, SelectionChangedCause cause) {
if (cause == SelectionChangedCause.longPress) {
// Feedback.forLongPress(context); todo add feedback
if (Theme.of(this.context).platform == RuntimePlatform.IPhonePlayer
&& cause == SelectionChangedCause.longPress) {
this._editableTextKey.currentState?.bringIntoView(selection.basePos);
ThemeData themeData = Theme.of(this.context);
Color color = Theme.of(this.context).splashColor;
Color color = themeData.splashColor;
InteractiveInkFeature splash = null;

} // else we're probably in deactivate()
}
splash = Theme.of(this.context).splashFactory.create(
splash = themeData.splashFactory.create(
controller: inkController,
referenceBox: referenceBox,
position: position,

}
void _handleSingleTapUp(TapUpDetails details) {
if (this.widget.enableInteractiveSelection) {
if (this.widget.enableInteractiveSelection == true) {
this._renderEditable.handleTap();
}

}
void _handleLongPress() {
if (this.widget.enableInteractiveSelection) {
if (this.widget.enableInteractiveSelection == true) {
this._renderEditable.handleLongPress();
}

base.build(context); // See AutomaticKeepAliveClientMixin.
D.assert(MaterialD.debugCheckHasMaterial(context));
D.assert(WidgetsD.debugCheckHasDirectionality(context));
D.assert(
!(this.widget.style != null && this.widget.style.inherit == false &&
(this.widget.style.fontSize == null || this.widget.style.textBaseline == null)),
"inherit false style must supply fontSize and textBaseline"
);
TextStyle style = this.widget.style ?? themeData.textTheme.subhead;
TextStyle style = themeData.textTheme.subhead.merge(this.widget.style);
Brightness keyboardAppearance = this.widget.keyboardAppearance ?? themeData.primaryColorBrightness;
TextEditingController controller = this._effectiveController;
FocusNode focusNode = this._effectiveFocusNode;

}
bool forcePressEnabled = false;
TextSelectionControls textSelectionControls = MaterialUtils.materialTextSelectionControls;;
bool paintCursorAboveText = false;
bool cursorOpacityAnimates = false;
Offset cursorOffset = null;
Color cursorColor = this.widget.cursorColor ?? themeData.cursorColor;
Radius cursorRadius = this.widget.cursorRadius;
Widget child = new RepaintBoundary(
child: new EditableText(

autocorrect: this.widget.autocorrect,
maxLines: this.widget.maxLines,
selectionColor: themeData.textSelectionColor,
selectionControls: this.widget.enableInteractiveSelection
? MaterialUtils.materialTextSelectionControls
: null,
selectionControls: this.widget.selectionEnabled ? textSelectionControls : null,
onSelectionChanged: this._handleSelectionChanged,
onSelectionChanged: this._handleSelectionChanged,
cursorRadius: this.widget.cursorRadius,
cursorColor: this.widget.cursorColor ?? Theme.of(context).cursorColor,
cursorRadius: cursorRadius,
cursorColor: cursorColor,
cursorOpacityAnimates: cursorOpacityAnimates,
cursorOffset: cursorOffset,
paintCursorAboveText: paintCursorAboveText,
backgroundCursorColor: new Color(0xFF8E8E93),// TODO: CupertinoColors.inactiveGray,
enableInteractiveSelection: this.widget.enableInteractiveSelection
enableInteractiveSelection: this.widget.enableInteractiveSelection == true,
dragStartBehavior: this.widget.dragStartBehavior
)
);

28
Runtime/material/text_theme.cs


}
public static TextTheme lerp(TextTheme a, TextTheme b, float t) {
D.assert(a != null);
D.assert(b != null);
display4: TextStyle.lerp(a.display4, b.display4, t),
display3: TextStyle.lerp(a.display3, b.display3, t),
display2: TextStyle.lerp(a.display2, b.display2, t),
display1: TextStyle.lerp(a.display1, b.display1, t),
headline: TextStyle.lerp(a.headline, b.headline, t),
title: TextStyle.lerp(a.title, b.title, t),
subhead: TextStyle.lerp(a.subhead, b.subhead, t),
body2: TextStyle.lerp(a.body2, b.body2, t),
body1: TextStyle.lerp(a.body1, b.body1, t),
caption: TextStyle.lerp(a.caption, b.caption, t),
button: TextStyle.lerp(a.button, b.button, t),
subtitle: TextStyle.lerp(a.subtitle, b.subtitle, t),
overline: TextStyle.lerp(a.overline, b.overline, t)
display4: TextStyle.lerp(a?.display4, b?.display4, t),
display3: TextStyle.lerp(a?.display3, b?.display3, t),
display2: TextStyle.lerp(a?.display2, b?.display2, t),
display1: TextStyle.lerp(a?.display1, b?.display1, t),
headline: TextStyle.lerp(a?.headline, b?.headline, t),
title: TextStyle.lerp(a?.title, b?.title, t),
subhead: TextStyle.lerp(a?.subhead, b?.subhead, t),
body2: TextStyle.lerp(a?.body2, b?.body2, t),
body1: TextStyle.lerp(a?.body1, b?.body1, t),
caption: TextStyle.lerp(a?.caption, b?.caption, t),
button: TextStyle.lerp(a?.button, b?.button, t),
subtitle: TextStyle.lerp(a?.subtitle, b?.subtitle, t),
overline: TextStyle.lerp(a?.overline, b?.overline, t)
);
}

51
Runtime/material/theme_data.cs


IconThemeData primaryIconTheme = null,
IconThemeData accentIconTheme = null,
TabBarTheme tabBarTheme = null,
CardTheme cardTheme = null,
AppBarTheme appBarTheme = null,
BottomAppBarTheme bottomAppBarTheme = null,
ColorScheme colorScheme = null,
DialogTheme dialogTheme = null,
Typography typography = null

errorColor = errorColor ?? Colors.red[700];
inputDecorationTheme = inputDecorationTheme ?? new InputDecorationTheme();
pageTransitionsTheme = pageTransitionsTheme ?? new PageTransitionsTheme();
appBarTheme = appBarTheme ?? new AppBarTheme();
bottomAppBarTheme = bottomAppBarTheme ?? new BottomAppBarTheme();
primaryIconTheme = primaryIconTheme ??
(primaryIsDark
? new IconThemeData(color: Colors.white)

: ThemeDataUtils._kLightThemeSplashColor);
tabBarTheme = tabBarTheme ?? new TabBarTheme();
cardTheme = cardTheme ?? new CardTheme();
dialogTheme = dialogTheme ?? new DialogTheme();
D.assert(brightness != null);

D.assert(accentIconTheme != null);
D.assert(materialTapTargetSize != null);
D.assert(pageTransitionsTheme != null);
D.assert(appBarTheme != null);
D.assert(bottomAppBarTheme != null);
D.assert(cardTheme != null);
D.assert(dialogTheme != null);
this.brightness = brightness ?? Brightness.light;

this.primaryIconTheme = primaryIconTheme;
this.accentIconTheme = accentIconTheme;
this.tabBarTheme = tabBarTheme;
this.cardTheme = cardTheme;
this.appBarTheme = appBarTheme;
this.bottomAppBarTheme = bottomAppBarTheme;
this.colorScheme = colorScheme;
this.dialogTheme = dialogTheme;
this.typography = typography;

IconThemeData primaryIconTheme = null,
IconThemeData accentIconTheme = null,
TabBarTheme tabBarTheme = null,
CardTheme cardTheme = null,
AppBarTheme appBarTheme = null,
BottomAppBarTheme bottomAppBarTheme = null,
ColorScheme colorScheme = null,
DialogTheme dialogTheme = null,
Typography typography = null

D.assert(platform != null);
D.assert(materialTapTargetSize != null);
D.assert(pageTransitionsTheme != null);
D.assert(appBarTheme != null);
D.assert(bottomAppBarTheme != null);
D.assert(cardTheme != null);
D.assert(dialogTheme != null);
return new ThemeData(

primaryIconTheme: primaryIconTheme,
accentIconTheme: accentIconTheme,
tabBarTheme: tabBarTheme,
cardTheme: cardTheme,
appBarTheme: appBarTheme,
bottomAppBarTheme: bottomAppBarTheme,
colorScheme: colorScheme,
dialogTheme: dialogTheme,
typography: typography);

public readonly IconThemeData accentIconTheme;
public readonly TabBarTheme tabBarTheme;
public readonly CardTheme cardTheme;
public readonly RuntimePlatform platform;

public readonly AppBarTheme appBarTheme;
public readonly BottomAppBarTheme bottomAppBarTheme;
public readonly ColorScheme colorScheme;
public readonly DialogTheme dialogTheme;

IconThemeData primaryIconTheme = null,
IconThemeData accentIconTheme = null,
TabBarTheme tabBarTheme = null,
CardTheme cardTheme = null,
AppBarTheme appBarTheme = null,
BottomAppBarTheme bottomAppBarTheme = null,
ColorScheme colorScheme = null,
DialogTheme dialogTheme = null,
Typography typography = null

primaryIconTheme: primaryIconTheme ?? this.primaryIconTheme,
accentIconTheme: accentIconTheme ?? this.accentIconTheme,
tabBarTheme: tabBarTheme ?? this.tabBarTheme,
cardTheme: cardTheme ?? this.cardTheme,
appBarTheme: appBarTheme ?? this.appBarTheme,
bottomAppBarTheme: bottomAppBarTheme ?? this.bottomAppBarTheme,
colorScheme: colorScheme ?? this.colorScheme,
dialogTheme: dialogTheme ?? this.dialogTheme,
typography: typography ?? this.typography

primaryIconTheme: IconThemeData.lerp(a.primaryIconTheme, b.primaryIconTheme, t),
accentIconTheme: IconThemeData.lerp(a.accentIconTheme, b.accentIconTheme, t),
tabBarTheme: TabBarTheme.lerp(a.tabBarTheme, b.tabBarTheme, t),
cardTheme: CardTheme.lerp(a.cardTheme, b.cardTheme, t),
appBarTheme: AppBarTheme.lerp(a.appBarTheme, b.appBarTheme, t),
bottomAppBarTheme: BottomAppBarTheme.lerp(a.bottomAppBarTheme, b.bottomAppBarTheme, t),
colorScheme: ColorScheme.lerp(a.colorScheme, b.colorScheme, t),
dialogTheme: DialogTheme.lerp(a.dialogTheme, b.dialogTheme, t),
typography: Typography.lerp(a.typography, b.typography, t)

other.primaryIconTheme == this.primaryIconTheme &&
other.accentIconTheme == this.accentIconTheme &&
other.tabBarTheme == this.tabBarTheme &&
other.cardTheme == this.cardTheme &&
other.appBarTheme == this.appBarTheme &&
other.bottomAppBarTheme == this.bottomAppBarTheme &&
other.colorScheme == this.colorScheme &&
other.dialogTheme == this.dialogTheme &&
other.typography == this.typography;

if (this._cachedHashCode != null) {
return this._cachedHashCode.Value;
}
unchecked {
var hashCode = this.brightness.GetHashCode();
hashCode = (hashCode * 397) ^ this.primaryColor.GetHashCode();

hashCode = (hashCode * 397) ^ this.primaryIconTheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.accentIconTheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.tabBarTheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.cardTheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.appBarTheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.bottomAppBarTheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.colorScheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.dialogTheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.typography.GetHashCode();

properties.add(new DiagnosticsProperty<TextTheme>("textTheme", this.textTheme));
properties.add(new DiagnosticsProperty<TextTheme>("primaryTextTheme", this.primaryTextTheme));
properties.add(new DiagnosticsProperty<TextTheme>("accentTextTheme", this.accentTextTheme));
properties.add(new DiagnosticsProperty<InputDecorationTheme>("inputDecorationTheme", this.inputDecorationTheme));
properties.add(
new DiagnosticsProperty<InputDecorationTheme>("inputDecorationTheme", this.inputDecorationTheme));
properties.add(new DiagnosticsProperty<Color>("toggleableActiveColor", this.toggleableActiveColor,
defaultValue: defaultData.toggleableActiveColor));
properties.add(new DiagnosticsProperty<IconThemeData>("iconTheme", this.iconTheme));

properties.add(new DiagnosticsProperty<CardTheme>("cardTheme", this.cardTheme));
properties.add(new DiagnosticsProperty<AppBarTheme>("appBarTheme", this.appBarTheme));
properties.add(new DiagnosticsProperty<BottomAppBarTheme>("bottomAppBarTheme", this.bottomAppBarTheme));
properties.add(new DiagnosticsProperty<ColorScheme>("colorScheme", this.colorScheme,
defaultValue: defaultData.colorScheme));
properties.add(new DiagnosticsProperty<DialogTheme>("dialogTheme", this.dialogTheme,

public V putIfAbsent(K key, Func<V> value) {
D.assert(key != null);
D.assert(value != null);
V get_value;
if (this._cache.TryGetValue(key, out get_value)) {
return get_value;

2
Runtime/painting/notched_shapes.cs


}
public override Path getOuterPath(Rect host, Rect guest) {
if (!host.overlaps(guest)) {
if (guest == null || !host.overlaps(guest)) {
Path path = new Path();
path.addRect(host);
return path;

82
Runtime/widgets/editable_text.cs


using Unity.UIWidgets.animation;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.scheduler;

public readonly Color cursorColor;
public readonly Color backgroundCursorColor;
public readonly int? maxLines;
public readonly bool autofocus;

public readonly bool unityTouchKeyboard;
public EditableText(TextEditingController controller, FocusNode focusNode, TextStyle style,
Color cursorColor, bool obscureText = false, bool autocorrect = false,
Color cursorColor, Color backgroundCursorColor = null, bool obscureText = false, bool autocorrect = false,
TextAlign textAlign = TextAlign.left, TextDirection? textDirection = null,
float? textScaleFactor = null, int? maxLines = 1,
bool autofocus = false, Color selectionColor = null, TextSelectionControls selectionControls = null,

ValueChanged<string> onSubmitted = null, SelectionChangedCallback onSelectionChanged = null,
List<TextInputFormatter> inputFormatters = null, bool rendererIgnoresPointer = false,
EdgeInsets scrollPadding = null, bool unityTouchKeyboard = false,
Key key = null, float? cursorWidth = 2.0f, Radius cursorRadius = null, Brightness? keyboardAppearance = Brightness.light,
bool enableInteractiveSelection = true
) : base(key) {
Key key = null, float? cursorWidth = 2.0f, Radius cursorRadius = null, bool cursorOpacityAnimates = false,
Offset cursorOffset = null, bool paintCursorAboveText = false,
Brightness? keyboardAppearance = Brightness.light,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
bool? enableInteractiveSelection = null
) : base(key) {
D.assert(backgroundCursorColor != null);
this.keyboardType = keyboardType ?? (maxLines == 1 ? TextInputType.text : TextInputType.multiline);
this.scrollPadding = scrollPadding ?? EdgeInsets.all(20.0f);

this.cursorWidth = cursorWidth;
this.cursorRadius = cursorRadius;
this.cursorOpacityAnimates = cursorOpacityAnimates;
this.cursorOffset = cursorOffset;
this.paintCursorAboveText = paintCursorAboveText;
this.dragStartBehavior = dragStartBehavior;
public readonly bool cursorOpacityAnimates;
public readonly Offset cursorOffset;
public readonly bool paintCursorAboveText;
public readonly DragStartBehavior dragStartBehavior;
public readonly bool enableInteractiveSelection;
public readonly bool? enableInteractiveSelection;
public bool selectionEnabled {
get { return this.enableInteractiveSelection ?? !this.obscureText; }
}
public override State createState() {
return new EditableTextState();
}

}
}
public class EditableTextState : AutomaticKeepAliveClientMixin<EditableText>, WidgetsBindingObserver, TextInputClient,
public class EditableTextState : AutomaticKeepAliveClientWithTickerProviderStateMixin<EditableText>,
WidgetsBindingObserver, TextInputClient,
static TimeSpan _kCursorBlinkWaitForStart = TimeSpan.FromMilliseconds(150);
static readonly TimeSpan _fadeDuration = TimeSpan.FromMilliseconds(500);
static readonly TimeSpan _floatingCursorResetTime = TimeSpan.FromMilliseconds(150);
ValueNotifier<bool> _showCursor = new ValueNotifier<bool>(false);
bool _targetCursorVisibility = false;
ValueNotifier<bool> _cursorVisibilityNotifier = new ValueNotifier<bool>(false);
AnimationController _cursorBlinkOpacityController;
TextInputConnection _textInputConnection;
TextSelectionOverlay _selectionOverlay;

? TextInputAction.newline
: TextInputAction.done),
textCapitalization: this.widget.textCapitalization,
keyboardAppearance: this.widget.keyboardAppearance??Brightness.light,
keyboardAppearance: this.widget.keyboardAppearance ?? Brightness.light,
));
this._textInputConnection.setEditingState(localValue);
this._updateImePosIfNeed();

);
});
}
if (this._lastBottomViewInset < Window.instance.viewInsets.bottom) {
this._showCaretOnScreen();
if (this._lastBottomViewInset < Window.instance.viewInsets.bottom) {
this._showCaretOnScreen();
this._lastBottomViewInset = Window.instance.viewInsets.bottom;
this._lastBottomViewInset = Window.instance.viewInsets.bottom;
public void didChangeTextScaleFactor() {}
public void didChangeTextScaleFactor() {
}
public void didChangeLocales(List<Locale> locale) {}
public void didChangeLocales(List<Locale> locale) {
}
public IPromise<bool> didPopRoute() {
return Promise<bool>.Resolved(false);

}
public bool cursorCurrentlyVisible {
get { return this._showCursor.value; }
get { return this._cursorVisibilityNotifier.value; }
}
public TimeSpan cursorBlinkInterval {

void _cursorTick() {
this._showCursor.value = !this._unityKeyboard() && !this._showCursor.value;
this._cursorVisibilityNotifier.value = !this._unityKeyboard() && !this._cursorVisibilityNotifier.value;
if (this._obscureShowCharTicksPending > 0) {
this.setState(() => { this._obscureShowCharTicksPending--; });
}

this._showCursor.value = !this._unityKeyboard();
this._cursorVisibilityNotifier.value = !this._unityKeyboard();
this._cursorTimer = Window.instance.run(_kCursorBlinkHalfPeriod, this._cursorTick,
periodic: true);
}

}
this._cursorTimer = null;
this._showCursor.value = false;
this._cursorVisibilityNotifier.value = false;
this._obscureShowCharTicksPending = 0;
}

WidgetsBinding.instance.removeObserver(this);
this._value = new TextEditingValue(text: this._value.text);
}
this.updateKeepAlive();
}

textSpan: this.buildTextSpan(),
value: this._value,
cursorColor: this.widget.cursorColor,
showCursor: this._showCursor,
showCursor: this._cursorVisibilityNotifier,
hasFocus: this._hasFocus,
maxLines: this.widget.maxLines,
selectionColor: this.widget.selectionColor,

rendererIgnoresPointer: this.widget.rendererIgnoresPointer,
cursorWidth: this.widget.cursorWidth,
cursorRadius: this.widget.cursorRadius,
enableInteractiveSelection: this.widget.enableInteractiveSelection,
enableInteractiveSelection: this.widget.enableInteractiveSelection == true,
textSelectionDelegate: this
)
)

}
bool _imePosUpdateScheduled = false;
void _updateImePosIfNeed() {
if (!this._hasInputConnection || !this._textInputConnection.imeRequired()) {
return;

return;
}
this._imePosUpdateScheduled = true;
SchedulerBinding.instance.addPostFrameCallback(_ => {
this._imePosUpdateScheduled = false;

this._textInputConnection.setIMEPos(this._getImePos());
});
}

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,
Key key = null, TextSelectionDelegate textSelectionDelegate = null, float? cursorWidth = null,
Radius cursorRadius = null, bool enableInteractiveSelection = true) : base(key) {
this.textSpan = textSpan;
this.value = value;

this.cursorWidth = cursorWidth;
this.cursorRadius = cursorRadius;
this.enableInteractiveSelection = enableInteractiveSelection;
}
public override RenderObject createRenderObject(BuildContext context) {

onSelectionChanged: this.onSelectionChanged,
onCaretChanged: this.onCaretChanged,
ignorePointer: this.rendererIgnoresPointer,
cursorWidth: this.cursorWidth??1.0f,
cursorWidth: this.cursorWidth ?? 1.0f,
cursorRadius: this.cursorRadius,
enableInteractiveSelection: this.enableInteractiveSelection,
textSelectionDelegate: this.textSelectionDelegate

14
Runtime/widgets/gesture_detector.cs


GestureDragUpdateCallback onPanUpdate = null,
GestureDragEndCallback onPanEnd = null,
GestureDragCancelCallback onPanCancel = null,
HitTestBehavior behavior = HitTestBehavior.deferToChild) : base(key) {
HitTestBehavior behavior = HitTestBehavior.deferToChild,
DragStartBehavior dragStartBehavior = DragStartBehavior.down
) : base(key) {
D.assert(() => {
bool haveVerticalDrag =
onVerticalDragStart != null || onVerticalDragUpdate != null ||

this.onPanEnd = onPanEnd;
this.onPanCancel = onPanCancel;
this.behavior = behavior;
this.dragStartBehavior = dragStartBehavior;
}
public readonly Widget child;

public readonly GestureDragEndCallback onPanEnd;
public readonly GestureDragCancelCallback onPanCancel;
public readonly HitTestBehavior behavior;
public readonly DragStartBehavior dragStartBehavior;
public override Widget build(BuildContext context) {
var gestures = new Dictionary<Type, GestureRecognizerFactory>();

instance.onUpdate = this.onVerticalDragUpdate;
instance.onEnd = this.onVerticalDragEnd;
instance.onCancel = this.onVerticalDragCancel;
instance.dragStartBehavior = this.dragStartBehavior;
}
);
}

instance.onUpdate = this.onHorizontalDragUpdate;
instance.onEnd = this.onHorizontalDragEnd;
instance.onCancel = this.onHorizontalDragCancel;
instance.dragStartBehavior = this.dragStartBehavior;
}
);
}

instance.onUpdate = this.onPanUpdate;
instance.onEnd = this.onPanEnd;
instance.onCancel = this.onPanCancel;
instance.dragStartBehavior = this.dragStartBehavior;
}
);
}

behavior: this.behavior,
child: this.child
);
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new EnumProperty<DragStartBehavior>("startBehavior", this.dragStartBehavior));
}
}

8
Runtime/widgets/page_view.cs


using RSG;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.physics;
using Unity.UIWidgets.rendering;

public float page {
get {
return (Mathf.Max(0.0f, this.pixels.clamp(this.minScrollExtent, this.maxScrollExtent)) /
Mathf.Max(1.0f, this.viewportDimension * this.viewportFraction));
Mathf.Max(1.0f, this.viewportDimension * this.viewportFraction));
}
}

bool pageSnapping = true,
ValueChanged<int> onPageChanged = null,
List<Widget> children = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
IndexedWidgetBuilder itemBuilder = null,
SliverChildDelegate childDelegate = null,
int itemCount = 0

this.physics = physics;
this.pageSnapping = pageSnapping;
this.onPageChanged = onPageChanged;
this.dragStartBehavior = dragStartBehavior;
this.controller = controller ?? PageViewUtils._defaultPageController;
if (itemBuilder != null) {
this.childrenDelegate = new SliverChildBuilderDelegate(itemBuilder, childCount: itemCount);

public readonly ValueChanged<int> onPageChanged;
public readonly SliverChildDelegate childrenDelegate;
public readonly DragStartBehavior dragStartBehavior;
public override State createState() {
return new _PageViewState();

return false;
},
child: new Scrollable(
dragStartBehavior: this.widget.dragStartBehavior,
axisDirection: axisDirection,
controller: this.widget.controller,
physics: physics,

28
Runtime/widgets/scrollable.cs


AxisDirection axisDirection = AxisDirection.down,
ScrollController controller = null,
ScrollPhysics physics = null,
ViewportBuilder viewportBuilder = null
ViewportBuilder viewportBuilder = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.down
) : base(key: key) {
D.assert(viewportBuilder != null);

this.viewportBuilder = viewportBuilder;
this.dragStartBehavior = dragStartBehavior;
}
public readonly AxisDirection axisDirection;

public readonly ScrollPhysics physics;
public readonly ViewportBuilder viewportBuilder;
public readonly DragStartBehavior dragStartBehavior;
public Axis axis {
get { return AxisUtils.axisDirectionToAxis(this.axisDirection); }

this._physics == null ? (float?) null : this._physics.minFlingVelocity;
instance.maxFlingVelocity =
this._physics == null ? (float?) null : this._physics.maxFlingVelocity;
instance.dragStartBehavior = this.widget.dragStartBehavior;
}
));
break;

this._physics == null ? (float?) null : this._physics.minFlingVelocity;
instance.maxFlingVelocity =
this._physics == null ? (float?) null : this._physics.maxFlingVelocity;
instance.dragStartBehavior = this.widget.dragStartBehavior;
}
));
break;

public override Widget build(BuildContext context) {
D.assert(this.position != null);
Widget result = new RawGestureDetector(
key: this._gestureDetectorKey,
gestures: this._gestureRecognizers,
behavior: HitTestBehavior.opaque,
child: new IgnorePointer(
key: this._ignorePointerKey,
ignoring: this._shouldIgnorePointer,
child: new _ScrollableScope(
scrollable: this,
position: this.position,
Widget result = new _ScrollableScope(
scrollable: this,
position: this.position,
child: new RawGestureDetector(
key: this._gestureDetectorKey,
gestures: this._gestureRecognizers,
behavior: HitTestBehavior.opaque,
child: new IgnorePointer(
key: this._ignorePointerKey,
ignoring: this._shouldIgnorePointer,
child: this.widget.viewportBuilder(context, this.position)
)
)

6
Runtime/widgets/single_child_scroll_view.cs


bool? primary = null,
ScrollPhysics physics = null,
ScrollController controller = null,
Widget child = null
Widget child = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.down
) : base(key: key) {
D.assert(!(controller != null && primary == true),
"Primary ScrollViews obtain their ScrollController via inheritance from a PrimaryScrollController widget. " +

this.physics = physics;
this.controller = controller;
this.child = child;
this.dragStartBehavior = dragStartBehavior;
}
public readonly Axis scrollDirection;

public readonly Widget child;
public readonly DragStartBehavior dragStartBehavior;
AxisDirection _getDirection(BuildContext context) {
return AxisDirectionUtils.getAxisDirectionFromAxisReverseAndDirectionality(context, this.scrollDirection,

: this.controller;
Scrollable scrollable = new Scrollable(
dragStartBehavior: this.dragStartBehavior,
axisDirection: axisDirection,
controller: scrollController,
physics: this.physics,

2
Samples/UIWidgetsGallery/demo/material/bottom_app_bar_demo.cs


}
public override Path getOuterPath(Rect host, Rect guest) {
if (!host.overlaps(guest)) {
if (guest == null || !host.overlaps(guest)) {
Path path = new Path();
path.addRect(host);
return path;

112
Runtime/material/app_bar_theme.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.material {
public class AppBarTheme : Diagnosticable {
public AppBarTheme(
Brightness? brightness = null,
Color color = null,
float? elevation = null,
IconThemeData iconTheme = null,
TextTheme textTheme = null
) {
this.brightness = brightness;
this.color = color;
this.elevation = elevation;
this.iconTheme = iconTheme;
this.textTheme = textTheme;
}
public readonly Brightness? brightness;
public readonly Color color;
public readonly float? elevation;
public readonly IconThemeData iconTheme;
public readonly TextTheme textTheme;
AppBarTheme copyWith(
Brightness? brightness = null,
Color color = null,
float? elevation = null,
IconThemeData iconTheme = null,
TextTheme textTheme = null
) {
return new AppBarTheme(
brightness: brightness ?? this.brightness,
color: color ?? this.color,
elevation: elevation ?? this.elevation,
iconTheme: iconTheme ?? this.iconTheme,
textTheme: textTheme ?? this.textTheme
);
}
public static AppBarTheme of(BuildContext context) {
return Theme.of(context).appBarTheme;
}
public static AppBarTheme lerp(AppBarTheme a, AppBarTheme b, float t) {
return new AppBarTheme(
brightness: t < 0.5f ? a?.brightness : b?.brightness,
color: Color.lerp(a?.color, b?.color, t),
elevation: MathUtils.lerpFloat(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t),
iconTheme: IconThemeData.lerp(a?.iconTheme, b?.iconTheme, t),
textTheme: TextTheme.lerp(a?.textTheme, b?.textTheme, t)
);
}
public override int GetHashCode() {
var hashCode = this.brightness?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.color?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.elevation?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.iconTheme?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.textTheme?.GetHashCode() ?? 0;
return hashCode;
}
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((AppBarTheme) obj);
}
public static bool operator ==(AppBarTheme left, AppBarTheme right) {
return Equals(left, right);
}
public static bool operator !=(AppBarTheme left, AppBarTheme right) {
return !Equals(left, right);
}
public bool Equals(AppBarTheme other) {
return other.brightness == this.brightness
&& other.color == this.color
&& other.elevation == this.elevation
&& other.iconTheme == this.iconTheme
&& other.textTheme == this.textTheme;
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<Brightness?>("brightness", this.brightness, defaultValue: null));
properties.add(new DiagnosticsProperty<Color>("color", this.color, defaultValue: null));
properties.add(new DiagnosticsProperty<float?>("elevation", this.elevation, defaultValue: null));
properties.add(new DiagnosticsProperty<IconThemeData>("iconTheme", this.iconTheme, defaultValue: null));
properties.add(new DiagnosticsProperty<TextTheme>("textTheme", this.textTheme, defaultValue: null));
}
}
}

3
Runtime/material/app_bar_theme.cs.meta


fileFormatVersion: 2
guid: 0c0ee979ef6b4f32a092532c3bdae31e
timeCreated: 1556178331

89
Runtime/material/bottom_app_bar_theme.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.material {
public class BottomAppBarTheme : Diagnosticable {
public BottomAppBarTheme(
Color color = null,
float? elevation = null,
NotchedShape shape = null
) {
}
public readonly Color color;
public readonly float? elevation;
public readonly NotchedShape shape;
BottomAppBarTheme copyWith(
Color color = null,
float? elevation = null,
NotchedShape shape = null
) {
return new BottomAppBarTheme(
color: color ?? this.color,
elevation: elevation ?? this.elevation,
shape: shape ?? this.shape
);
}
public static BottomAppBarTheme of(BuildContext context) {
return Theme.of(context).bottomAppBarTheme;
}
public static BottomAppBarTheme lerp(BottomAppBarTheme a, BottomAppBarTheme b, float t) {
return new BottomAppBarTheme(
color: Color.lerp(a?.color, b?.color, t),
elevation: MathUtils.lerpFloat(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t),
shape: t < 0.5f ? a?.shape : b?.shape
);
}
public override int GetHashCode() {
var hashCode = this.color?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.elevation?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.shape?.GetHashCode() ?? 0;
return hashCode;
}
public bool Equals(BottomAppBarTheme other) {
return other.color == this.color
&& other.elevation == this.elevation
&& other.shape == this.shape;
}
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((BottomAppBarTheme) obj);
}
public static bool operator ==(BottomAppBarTheme left, BottomAppBarTheme right) {
return Equals(left, right);
}
public static bool operator !=(BottomAppBarTheme left, BottomAppBarTheme right) {
return !Equals(left, right);
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<Color>("color", this.color, defaultValue: null));
properties.add(new DiagnosticsProperty<float?>("elevation", this.elevation, defaultValue: null));
properties.add(new DiagnosticsProperty<NotchedShape>("shape", this.shape, defaultValue: null));
}
}
}

3
Runtime/material/bottom_app_bar_theme.cs.meta


fileFormatVersion: 2
guid: 9c88d19dd1254f4eb6c0c998084832ea
timeCreated: 1556185402

89
Runtime/material/card_theme.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.material {
public class CardTheme : Diagnosticable {
public CardTheme(
Clip? clipBehavior = null,
Color color = null,
float? elevation = null,
EdgeInsets margin = null,
ShapeBorder shape = null
) {
D.assert(elevation == null || elevation >= 0.0f);
this.clipBehavior = clipBehavior;
this.color = color;
this.elevation = elevation;
this.margin = margin;
this.shape = shape;
}
public readonly Clip? clipBehavior;
public readonly Color color;
public readonly float? elevation;
public readonly EdgeInsets margin;
public readonly ShapeBorder shape;
CardTheme copyWith(
Clip? clipBehavior = null,
Color color = null,
float? elevation = null,
EdgeInsets margin = null,
ShapeBorder shape = null
) {
return new CardTheme(
clipBehavior: this.clipBehavior ?? this.clipBehavior,
color: color ?? this.color,
elevation: this.elevation ?? this.elevation,
margin: margin ?? this.margin,
shape: shape ?? this.shape
);
}
public static CardTheme of(BuildContext context) {
return Theme.of(context).cardTheme;
}
public static CardTheme lerp(CardTheme a, CardTheme b, float t) {
return new CardTheme(
clipBehavior: t < 0.5f ? a?.clipBehavior : b?.clipBehavior,
color: Color.lerp(a?.color, b?.color, t),
elevation: MathUtils.lerpFloat(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t),
margin: EdgeInsets.lerp(a?.margin, b?.margin, t),
shape: ShapeBorder.lerp(a?.shape, b?.shape, t)
);
}
public override int GetHashCode() {
var hashCode = this.clipBehavior?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.color?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.elevation?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.margin?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ this.shape?.GetHashCode() ?? 0;
return hashCode;
}
public bool Equals(CardTheme other) {
return other.clipBehavior == this.clipBehavior
&& other.color == this.color
&& other.elevation == this.elevation
&& other.margin == this.margin
&& other.shape == this.shape;
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<Clip?>("clipBehavior", this.clipBehavior, defaultValue: null));
properties.add(new DiagnosticsProperty<Color>("color", this.color, defaultValue: null));
properties.add(new DiagnosticsProperty<float?>("elevation", this.elevation, defaultValue: null));
properties.add(new DiagnosticsProperty<EdgeInsets>("margin", this.margin, defaultValue: null));
properties.add(new DiagnosticsProperty<ShapeBorder>("shape", this.shape, defaultValue: null));
}
}
}

3
Runtime/material/card_theme.cs.meta


fileFormatVersion: 2
guid: d74c4f94f0994a3880425c80ec3d9ba3
timeCreated: 1556187816
正在加载...
取消
保存