浏览代码

update to 1.17.5

/siyaoH-1.17-PlatformMessage
Shiyun Wen 4 年前
当前提交
93f4d640
共有 31 个文件被更改,包括 1765 次插入554 次删除
  1. 4
      com.unity.uiwidgets/Runtime/animation/animation.cs
  2. 2
      com.unity.uiwidgets/Runtime/animation/animations.cs
  3. 46
      com.unity.uiwidgets/Runtime/animation/tween.cs
  4. 24
      com.unity.uiwidgets/Runtime/cupertino/action_Sheet.cs
  5. 10
      com.unity.uiwidgets/Runtime/cupertino/activity_indicator.cs
  6. 43
      com.unity.uiwidgets/Runtime/cupertino/app.cs
  7. 11
      com.unity.uiwidgets/Runtime/cupertino/button.cs
  8. 7
      com.unity.uiwidgets/Runtime/cupertino/colors.cs
  9. 61
      com.unity.uiwidgets/Runtime/cupertino/context_menu.cs
  10. 2
      com.unity.uiwidgets/Runtime/cupertino/dialog.cs
  11. 220
      com.unity.uiwidgets/Runtime/cupertino/nav_bar.cs
  12. 51
      com.unity.uiwidgets/Runtime/cupertino/page_scaffold.cs
  13. 126
      com.unity.uiwidgets/Runtime/cupertino/route.cs
  14. 3
      com.unity.uiwidgets/Runtime/cupertino/text_field.cs
  15. 33
      com.unity.uiwidgets/Runtime/painting/colors.cs
  16. 4
      com.unity.uiwidgets/Runtime/rendering/error.cs
  17. 320
      com.unity.uiwidgets/Runtime/widgets/app.cs
  18. 5
      com.unity.uiwidgets/Runtime/widgets/framework.cs
  19. 232
      com.unity.uiwidgets/Runtime/widgets/heroes.cs
  20. 173
      com.unity.uiwidgets/Runtime/widgets/media_query.cs
  21. 2
      com.unity.uiwidgets/Runtime/widgets/modal_barrier.cs
  22. 230
      com.unity.uiwidgets/Runtime/widgets/navigator.cs
  23. 2
      com.unity.uiwidgets/Runtime/widgets/preferred_size.cs
  24. 483
      com.unity.uiwidgets/Runtime/widgets/routes.cs
  25. 6
      com.unity.uiwidgets/Runtime/widgets/widget_inspector.cs
  26. 117
      com.unity.uiwidgets/Runtime/animation/tween_sequence.cs
  27. 11
      com.unity.uiwidgets/Runtime/animation/tween_sequence.cs.meta
  28. 38
      com.unity.uiwidgets/Runtime/widgets/route_notification_messages.cs
  29. 11
      com.unity.uiwidgets/Runtime/widgets/route_notification_messages.cs.meta
  30. 31
      com.unity.uiwidgets/Runtime/widgets/spacer.cs
  31. 11
      com.unity.uiwidgets/Runtime/widgets/spacer.cs.meta

4
com.unity.uiwidgets/Runtime/animation/animation.cs


using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.animation {
public enum AnimationStatus {
dismissed,
forward,

public delegate void AnimationStatusListener(AnimationStatus status);
public abstract class Animation<T> : ValueListenable<T> {

2
com.unity.uiwidgets/Runtime/animation/animations.cs


using UnityEngine;
namespace Unity.UIWidgets.animation {
class _AlwaysCompleteAnimation : Animation<float> {
internal _AlwaysCompleteAnimation() {
}

_nextTrain.removeListener(_valueChangeHandler);
_nextTrain = null;
}
base.dispose();
}

46
com.unity.uiwidgets/Runtime/animation/tween.cs


namespace Unity.UIWidgets.animation {
public abstract class Animatable<T> {
public abstract T evaluate(Animation<float> animation);
public Animatable() {
}
public abstract T transform(float t);
public T evaluate(Animation<float> animation) {
return transform(animation.value);
}
public Animation<T> animate(Animation<float> parent) {
return new _AnimatedEvaluation<T>(parent, this);

readonly Animatable<float> _parent;
readonly Animatable<T> _evaluatable;
public override T evaluate(Animation<float> animation) {
public override T transform(float t) {
return _evaluatable.transform(_parent.transform(t));
}
/*public override T evaluate(Animation<float> animation) {
}
}*/
public override string ToString() {
return $"{_parent}\u27A9{_evaluatable}";

public abstract class Tween<T> : Animatable<T>, IEquatable<Tween<T>> {
protected Tween(T begin, T end) {
public Tween(T begin, T end) {
this.begin = begin;
this.end = end;
}

public virtual T end { get; set; }
public abstract T lerp(float t);
public override T transform(float t) {
if (t == 0.0)
return begin;
if (t == 1.0)
return end;
return lerp(t);
}
public override T evaluate(Animation<float> animation) {
/*public override T evaluate(Animation<float> animation) {
float t = animation.value;
if (t == 0.0) {
return begin;

}
return lerp(t);
}
}*/
public override string ToString() {
return $"{GetType()}({begin} \u2192 {end})";

}
public readonly Curve curve;
public override float transform(float t) {
if (t == 0.0 || t == 1.0) {
D.assert(curve.transform(t).round() == t);
return t;
}
return curve.transform(t);
}
public override float evaluate(Animation<float> animation) {
/*public override float evaluate(Animation<float> animation) {
float t = animation.value;
if (t == 0.0 || t == 1.0) {
D.assert(curve.transform(t).round() == t);

return curve.transform(t);
}
}*/
public override string ToString() {
return $"{GetType()}(curve: {curve})";

24
com.unity.uiwidgets/Runtime/cupertino/action_Sheet.cs


);
}
public override void updateRenderObject(BuildContext context, _RenderCupertinoAlert renderObject) {
public override void updateRenderObject(BuildContext context,RenderObject renderObject ) {
//RenderObject renderObject
renderObject = (_RenderCupertinoAlert) renderObject;
renderObject.dividerColor = CupertinoDynamicColor.resolve(CupertinoActionSheetUtils._kButtonDividerColor, context);
((_RenderCupertinoAlert) renderObject).dividerColor = CupertinoDynamicColor.resolve(CupertinoActionSheetUtils._kButtonDividerColor, context);
}
public override Element createElement() {

Element _contentElement;
Element _actionsElement;
public override _CupertinoAlertRenderWidget widget {
get { return base.widget as _CupertinoAlertRenderWidget; }
public new _CupertinoAlertRenderWidget widget {
get { return base.widget as _CupertinoAlertRenderWidget; }
public override _RenderCupertinoAlert renderObject {
get { return base.renderObject as _RenderCupertinoAlert; }
public new _RenderCupertinoAlert renderObject {
get { return base.renderObject as _RenderCupertinoAlert; }
}
public override void visitChildren(ElementVisitor visitor) {

_AlertSections.actionsSection);
}
public override void forgetChild(Element child) {
internal override void forgetChild(Element child) {
D.assert(child == _contentElement || child == _actionsElement);
if (_contentElement == child) {
_contentElement = null;

return 0.0f;
}
protected override float computeMaxIntrinsicHeight(float width) {
protected internal override float computeMaxIntrinsicHeight(float width) {
float contentHeight = contentSection.getMaxIntrinsicHeight(width);
float actionsHeight = actionsSection.getMaxIntrinsicHeight(width);
bool hasDivider = contentHeight > 0.0f && actionsHeight > 0.0f;

return 0.0f;
}
public override void performLayout() {
protected override void performLayout() {
bool hasDivider = contentSection.getMaxIntrinsicHeight(constraints.maxWidth) > 0.0f
&& actionsSection.getMaxIntrinsicHeight(constraints.maxWidth) > 0.0f;
float dividerThickness = hasDivider ? _dividerThickness : 0.0f;

);
}
public override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
MultiChildLayoutParentData contentSectionParentData =
contentSection.parentData as MultiChildLayoutParentData;
MultiChildLayoutParentData actionsSectionParentData =

+ (0.5f * childAfter(firstChild).getMinIntrinsicHeight(width));
}
protected override float computeMaxIntrinsicHeight(float width) {
protected internal override float computeMaxIntrinsicHeight(float width) {
if (childCount == 0) {
return 0.0f;
}

10
com.unity.uiwidgets/Runtime/cupertino/activity_indicator.cs


namespace Unity.UIWidgets.cupertino {
static class CupertinoActivityIndicatorUtils {
public const float _kDefaultIndicatorRadius = 10.0f;
public const Color _kActiveTickColor = CupertinoDynamicColor.withBrightness(
color: Color(0xFF3C3C44),
darkColor: Color(0xFFEBEBF5)
public static readonly Color _kActiveTickColor = CupertinoDynamicColor.withBrightness(
color: new Color(0xFF3C3C44),
darkColor: new Color(0xFFEBEBF5)
);
public const float _kTwoPI = Mathf.PI * 2.0f;

}
}
class _CupertinoActivityIndicatorPainter : CustomPainter {
class _CupertinoActivityIndicatorPainter : AbstractCustomPainter
{//CustomPainter {
//AbstractCustomPainter {
public _CupertinoActivityIndicatorPainter(
Animation<float> position = null,

43
com.unity.uiwidgets/Runtime/cupertino/app.cs


return new WidgetsApp(
key: new GlobalObjectKey<State<StatefulWidget>>(value: this),
navigatorKey: widget.navigatorKey,
onGenerateRoute: widget.onGenerateRoute,
onGenerateInitialRoutes: widget.onGenerateInitialRoutes,
onUnknownRoute: widget.onUnknownRoute,
initialRoute: widget.initialRoute,
pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) =>
pageRouteBuilder:(RouteSettings settings, WidgetBuilder builder) =>
builder: widget.builder,
initialRoute: widget.initialRoute,
onGenerateRoute: widget.onGenerateRoute,
onGenerateInitialRoutes: widget.onGenerateInitialRoutes,
onUnknownRoute: widget.onUnknownRoute,
builder: widget.builder,
onGenerateTitle: widget.onGenerateTitle,
onGenerateTitle: widget.onGenerateTitle,
textStyle: CupertinoTheme.of(context).textTheme.textStyle,
color: CupertinoDynamicColor.resolve(widget.color ?? effectiveThemeData.primaryColor, context),
locale: widget.locale,

checkerboardOffscreenLayers: widget.checkerboardOffscreenLayers,
showSemanticsDebugger: widget.showSemanticsDebugger,
debugShowCheckedModeBanner: widget.debugShowCheckedModeBanner,
inspectorSelectButtonBuilder: (BuildContext context2, VoidCallback onPressed)=>{
return CupertinoButton.filled(
child: new Icon(
CupertinoIcons.search,
size: 28.0f,
color: CupertinoColors.white
),
padding: EdgeInsets.zero,
onPressed: onPressed
);
}
///TBC????
//shortcuts: widget.shortcuts,
//actions: widget.actions
);
inspectorSelectButtonBuilder: (BuildContext context3, VoidCallback onPressed) => {
return CupertinoButton.filled(
child: new Icon(
CupertinoIcons.search,
size: 28.0f,
color: CupertinoColors.white
),
padding: EdgeInsets.zero,
onPressed: onPressed
);
}//,
//shortcuts: widget.shortcuts,
//actions: widget.actions,
);
}
)
)

11
com.unity.uiwidgets/Runtime/cupertino/button.cs


EdgeInsets padding = null,
Color color = null,
Color disabledColor = null,
float minSize = CupertinoButtonUtils.kMinInteractiveDimensionCupertino,
float minSize = 44.0f,
float pressedOpacity = 0.4f,
BorderRadius borderRadius = null,
VoidCallback onPressed = null

Widget child = null,
EdgeInsets padding = null,
Color disabledColor = null,
float minSize = CupertinoButtonUtils.kMinInteractiveDimensionCupertino,
float minSize = 44.0f,
float pressedOpacity = 0.4f,
BorderRadius borderRadius = null,
VoidCallback onPressed = null

class _CupertinoButtonState : SingleTickerProviderStateMixin<CupertinoButton> {
static readonly TimeSpan kFadeOutDuration = new TimeSpan(0, 0, 0, 0, 10);
static readonly TimeSpan kFadeInDuration = new TimeSpan(0, 0, 0, 0, 100);
public readonly Tween<float> _opacityTween = new Tween<float>(begin: 1.0f, end: 0.0f);
public readonly Tween<float> _opacityTween = new FloatTween(begin: 1.0f, end: 0.0f);//Tween<Float>
AnimationController _animationController;
Animation<float> _opacityAnimation;

void _setTween() {
if (widget != null) {
_opacityTween.end = widget.pressedOpacity ?? 1.0f;
_opacityTween.end = 1.0f;
if (!widget.pressedOpacity.Equals(0f)) {
_opacityTween.end = widget.pressedOpacity;
}
}
}

7
com.unity.uiwidgets/Runtime/cupertino/colors.cs


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.ui;

);
}
public class CupertinoDynamicColor : Color, Diagnosticable {
public class CupertinoDynamicColor : Color,Diagnosticable {
public CupertinoDynamicColor(
string debugLabel = null,

);
}
else {
return new ColorProperty(
name,
value,

}
}
}
}

61
com.unity.uiwidgets/Runtime/cupertino/context_menu.cs


}
}
public delegate Widget _DismissCallback(
public delegate void _DismissCallback(
BuildContext context,
float scale,
float opacity

}
public class _CupertinoContextMenuState : State<CupertinoContextMenu> , TickerProviderStateMixin {
public class _CupertinoContextMenuState : TickerProviderStateMixin<CupertinoContextMenu> {
\ public AnimationController _openController;
public AnimationController _openController;
public _ContextMenuRoute<void> _route;
public _ContextMenuRoute _route;
public override void initState() {
base.initState();

_childHidden = true;
});
_route = new _ContextMenuRoute<void>(
_route = new _ContextMenuRoute(
actions: widget.actions,
barrierLabel: "Dismiss",
filter: ui.ImageFilter.blur(

return new _DecoyChildState();
}
}
public class _DecoyChildState : State<_DecoyChild> , TickerProviderStateMixin {
public class _DecoyChildState : TickerProviderStateMixin<_DecoyChild> {
public static readonly Color _lightModeMaskColor = new Color(0xFF888888);
public static readonly Color _masklessColor = new Color(0xFFFFFFFF);

colors.Add(color);
return Positioned.fromRect(
rect: _rect.value,
child: kIsweb
? new Container(key: _childGlobalKey, child: widget.child)
: new ShaderMask(
child: //kIsweb?
new Container(key: _childGlobalKey, child: widget.child)
/*: new ShaderMask(
key: _childGlobalKey,
shaderCallback: (Rect bounds) => {
return new LinearGradient(

).createShader(bounds);
},
child: widget.child
)
)*/
);
}
public override Widget build(BuildContext context) {

);
}
}
public class _ContextMenuRoute<T> : PopupRoute<T> {
public class _ContextMenuRoute : PopupRoute {
public _ContextMenuRoute(
List<Widget> actions = null,
_ContextMenuLocation contextMenuLocation = default,

public readonly static RectTween _sheetRectTween = new RectTween();
public readonly Animatable<Rect> _sheetRectAnimatable = _sheetRectTween.chain(_curve);
public readonly Animatable<Rect> _sheetRectAnimatableReverse = _sheetRectTween.chain(_curveReverse);
public readonly static Tween< float> _sheetScaleTween = new Tween<float>(0.0f,0.0f);
public readonly static Tween< float> _sheetScaleTween = new FloatTween(0.0f,0.0f);
public readonly Tween< float> _opacityTween = new Tween< float>(begin: 0.0f, end: 1.0f);
public readonly Tween< float> _opacityTween = new FloatTween(begin: 0.0f, end: 1.0f);
public Animation< float> _sheetOpacity;
public readonly string barrierLabel;

);
return offsetScaled & sizeScaled;
}
public static AlignmentDirectional getSheetAlignment(_ContextMenuLocation contextMenuLocation) {
/*public static AlignmentDirectional getSheetAlignment(_ContextMenuLocation contextMenuLocation) {
switch (contextMenuLocation) {
case _ContextMenuLocation.center:
return AlignmentDirectional.topCenter;

return AlignmentDirectional.topStart;
}
}
}*/
public static Rect _getSheetRectBegin(Orientation orientation, _ContextMenuLocation contextMenuLocation, Rect childRect, Rect sheetRect) {
switch (contextMenuLocation) {
case _ContextMenuLocation.center:

parent: animation,
curve: new Interval(0.9f, 1.0f)
));
Navigator.of(context).pop();
Navigator.of(context).pop<object>();
}
public void _updateTweenRects() {

base.offstage = _externalOffstage || _internalOffstage;
changedInternalState();
}
public bool didPop(T result) {
public bool didPop(object result) {
/*public set offstage(bool value) {
_externalOffstage = value;
_setOffstageInternally();
}*/
// tbc ???
public bool offstage{
set{
_externalOffstage = value;
_setOffstageInternally();
}
}
public TickerFuture didPush() {
_internalOffstage = true;

child: new Opacity(
opacity: _sheetOpacity.value,
child: Transform.scale(
alignment: getSheetAlignment(_contextMenuLocation),
//alignment: getSheetAlignment(_contextMenuLocation),
scale: sheetScale,
child: new _ContextMenuSheet(
key: _sheetGlobalKey,

}
}
public class _ContextMenuRouteStaticState : State<_ContextMenuRouteStatic> ,TickerProviderStateMixin {
public class _ContextMenuRouteStaticState : TickerProviderStateMixin<_ContextMenuRouteStatic> {
public readonly static float _kMinScale = 0.8f;
public readonly static float _kSheetScaleThreshold = 0.9f;
public readonly static float _kPadding = 20.0f;

_sheetController.reverse();
}
_moveAnimation = new Tween<Offset>(
_moveAnimation = new OffsetTween(
begin: new Offset(0.0f, _moveAnimation.value.dy),
end:new Offset(0.0f, finalPosition)
).animate(_moveController);

: _kPadding * dragOffset.dy / _kDamping;
setState(() =>{
_dragOffset = dragOffset;
_moveAnimation = new Tween<Offset>(
_moveAnimation = new OffsetTween(
begin: Offset.zero,
end: new Offset(
endX.clamp(-_kPadding, _kPadding) ,

);
_sheetController = new AnimationController(
duration: new TimeSpan(0,0,0,100),
reverseDuration: new TimeSpan(0,0,0,300),/// TBC ???
//reverseDuration: new TimeSpan(0,0,0,300),/// TBC ???
_sheetScaleAnimation = new Tween< float>(
_sheetScaleAnimation = new FloatTween(
begin: 1.0f,
end: 0.0f
).animate(

reverseCurve: Curves.easeInBack
)
);
_sheetOpacityAnimation = new Tween< float>(
_sheetOpacityAnimation = new FloatTween(
begin: 1.0f,
end: 0.0f
).animate(_sheetController);

2
com.unity.uiwidgets/Runtime/cupertino/dialog.cs


_AlertDialogSections.actionsSection);
}
public override void forgetChild(Element child) {
internal override void forgetChild(Element child) {
D.assert(child == _contentElement || child == _actionsElement);
if (_contentElement == child) {
_contentElement = null;

220
com.unity.uiwidgets/Runtime/cupertino/nav_bar.cs


using Color = Unity.UIWidgets.ui.Color;
using Rect = Unity.UIWidgets.ui.Rect;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
using Brightness = Unity.UIWidgets.ui.Brightness;
namespace Unity.UIWidgets.cupertino {
class NavBarUtils {

public static Widget _wrapWithBackground(
Border border = null,
Color backgroundColor = null,
Brightness? brightness = null,
bool darkBackground = backgroundColor.computeLuminance() < 0.179f;
/*bool darkBackground = backgroundColor.computeLuminance() < 0.179f;
: SystemUiOverlayStyle.dark;
: SystemUiOverlayStyle.dark;*/
bool isDark = backgroundColor.computeLuminance() < 0.179;
Brightness newBrightness = brightness ?? (isDark ? Brightness.dark : Brightness.light);
SystemUiOverlayStyle overlayStyle;
switch (newBrightness) {
case Brightness.dark:
overlayStyle = SystemUiOverlayStyle.light;
break;
case Brightness.light:
default:
overlayStyle = SystemUiOverlayStyle.dark;
break;
}
result = new AnnotatedRegion<SystemUiOverlayStyle>(
value: overlayStyle,
sized: true,

);
}
return null;
throw new UIWidgetsError($"Unknown flight direction: {flightDirection}");
};

end: end.topLeft & largestSize
);
};
public static TransitionBuilder _navBarHeroLaunchPadBuilder = (
//TransitionBuilder
public static HeroPlaceholderBuilder _navBarHeroLaunchPadBuilder = (
Size heroSize,
Widget child
) => {
D.assert(child is _TransitionableNavigationBar);

return true;
}
return navigator == other.navigator;
return other is _HeroTag && navigator == other.navigator;
}
public override bool Equals(object obj) {

Widget trailing = null,
Border border = null,
Color backgroundColor = null,
Brightness? brightness = null,
EdgeInsets padding = null,
Color actionsForegroundColor = null,
bool transitionBetweenRoutes = true,

this.trailing = trailing;
this.border = border ?? NavBarUtils._kDefaultNavBarBorder;
this.backgroundColor = backgroundColor;
this.brightness = brightness ?? Brightness.dark; //todo ????
this.padding = padding;
this.actionsForegroundColor = actionsForegroundColor;
this.transitionBetweenRoutes = transitionBetweenRoutes;

public readonly Widget middle;
public readonly Widget trailing;
public readonly Brightness brightness;
public readonly Color backgroundColor;
public readonly EdgeInsets padding;

public readonly bool transitionBetweenRoutes;
public readonly object heroTag;
public override bool shouldFullyObstruct(BuildContext context) {
Color backgroundColor = CupertinoDynamicColor.resolve(this.backgroundColor, context)
?? CupertinoTheme.of(context).barBackgroundColor;
return backgroundColor.alpha == 0xFF;
}
public override bool? fullObstruction {
/*public override bool? fullObstruction {
}
}*/
public override Size preferredSize {
get { return Size.fromHeight(NavBarUtils._kNavBarPersistentHeight); }

}
public override Widget build(BuildContext context) {
Color backgroundColor = widget.backgroundColor ?? CupertinoTheme.of(context).barBackgroundColor;
//Color backgroundColor = widget.backgroundColor ?? CupertinoTheme.of(context).barBackgroundColor;
Color backgroundColor =
CupertinoDynamicColor.resolve(widget.backgroundColor, context) ?? CupertinoTheme.of(context).barBackgroundColor;
_NavigationBarStaticComponents components = new _NavigationBarStaticComponents(
keys: keys,

Widget navBar = NavBarUtils._wrapWithBackground(
border: widget.border,
backgroundColor: backgroundColor,
brightness:widget.brightness,
child: new DefaultTextStyle(
style: CupertinoTheme.of(context).textTheme.textStyle,
child: new _PersistentNavigationBar(

)
);
Color actionsForegroundColor = CupertinoDynamicColor.resolve(
widget.actionsForegroundColor, // ignore: deprecated_member_use_from_same_package
context
);
return NavBarUtils._wrapActiveColor(widget.actionsForegroundColor, context,
navBar); // ignore: deprecated_member_use_from_same_package
//return NavBarUtils._wrapActiveColor(widget.actionsForegroundColor, context, navBar); // ignore: deprecated_member_use_from_same_package
return NavBarUtils._wrapActiveColor(actionsForegroundColor, context, navBar);
widget.actionsForegroundColor, // ignore: deprecated_member_use_from_same_package
//widget.actionsForegroundColor, // ignore: deprecated_member_use_from_same_package
actionsForegroundColor,
context,
new Builder(
builder: (BuildContext _context) => {

Widget trailing = null,
Border border = null,
Color backgroundColor = null,
Brightness? brightness = null,
EdgeInsets padding = null,
Color actionsForegroundColor = null,
bool transitionBetweenRoutes = true,

this.trailing = trailing;
this.border = border ?? NavBarUtils._kDefaultNavBarBorder;
this.backgroundColor = backgroundColor;
this.brightness = brightness ?? Brightness.dark;
this.padding = padding;
this.actionsForegroundColor = actionsForegroundColor;
this.transitionBetweenRoutes = transitionBetweenRoutes;

public readonly Widget trailing;
public readonly Color backgroundColor;
public readonly Brightness brightness;
public readonly EdgeInsets padding;

}
public override Widget build(BuildContext context) {
Color actionsForegroundColor =
widget.actionsForegroundColor ??
CupertinoTheme.of(context).primaryColor; // ignore: deprecated_member_use_from_same_package
//Color actionsForegroundColor = widget.actionsForegroundColor ?? CupertinoTheme.of(context).primaryColor; // ignore: deprecated_member_use_from_same_package
Color actionsForegroundColor = CupertinoDynamicColor.resolve(widget.actionsForegroundColor, context) // ignore: deprecated_member_use_from_same_package
?? CupertinoTheme.of(context).primaryColor;
_NavigationBarStaticComponents components = new _NavigationBarStaticComponents(
keys: keys,
route: ModalRoute.of(context),

return NavBarUtils._wrapActiveColor(
widget.actionsForegroundColor, // ignore: deprecated_member_use_from_same_package
context,
new SliverPersistentHeader(
//new SliverPersistentHeader(
new MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1),
child: new SliverPersistentHeader(
backgroundColor: widget.backgroundColor ?? CupertinoTheme.of(context).barBackgroundColor,
//backgroundColor: widget.backgroundColor ?? CupertinoTheme.of(context).barBackgroundColor,
backgroundColor:CupertinoDynamicColor.resolve(widget.backgroundColor, context) ?? CupertinoTheme.of(context).barBackgroundColor,
brightness: widget.brightness,
border: widget.border,
padding: widget.padding,
actionsForegroundColor: actionsForegroundColor,

alwaysShowMiddle: widget.middle != null
)
)
)
);
}
}

public _LargeTitleNavigationBarSliverDelegate(
_NavigationBarStaticComponentsKeys keys,
_NavigationBarStaticComponents components,
Widget userMiddle,
Color backgroundColor,
Border border,
EdgeInsets padding,
Color actionsForegroundColor,
bool transitionBetweenRoutes,
object heroTag,
float persistentHeight,
bool alwaysShowMiddle
_NavigationBarStaticComponentsKeys keys = null,
_NavigationBarStaticComponents components = null,
Widget userMiddle = null,
Color backgroundColor = null,
Brightness? brightness = null,
Border border = null,
EdgeInsets padding = null,
Color actionsForegroundColor = null,
bool transitionBetweenRoutes = false,
object heroTag = null,
float persistentHeight = 0.0f,
bool alwaysShowMiddle =false
D.assert(persistentHeight != null);
D.assert(alwaysShowMiddle != null);
D.assert(transitionBetweenRoutes != null);
this.brightness = brightness ?? Brightness.dark;
this.padding = padding;
this.actionsForegroundColor = actionsForegroundColor;
this.transitionBetweenRoutes = transitionBetweenRoutes;

public readonly Widget userMiddle;
public readonly Color backgroundColor;
public readonly Border border;
public Brightness brightness;
public readonly EdgeInsets padding;
public readonly Color actionsForegroundColor;
public readonly bool transitionBetweenRoutes;

Widget navBar = NavBarUtils._wrapWithBackground(
border: border,
backgroundColor: backgroundColor,
//backgroundColor: backgroundColor,
backgroundColor: CupertinoDynamicColor.resolve(backgroundColor, context),
brightness: brightness,
child: new DefaultTextStyle(
style: CupertinoTheme.of(context).textTheme.textStyle,
child: new Stack(

transitionOnUserGestures: true,
child: new _TransitionableNavigationBar(
componentsKeys: keys,
backgroundColor: backgroundColor,
//backgroundColor: backgroundColor,
backgroundColor: CupertinoDynamicColor.resolve(backgroundColor, context),
backButtonTextStyle: CupertinoTheme.of(context).textTheme.navActionTextStyle,
titleTextStyle: CupertinoTheme.of(context).textTheme.navTitleTextStyle,
largeTitleTextStyle: CupertinoTheme.of(context).textTheme.navLargeTitleTextStyle,

leadingContent = new CupertinoButton(
child: new Text("Close"),
padding: EdgeInsets.zero,
onPressed: () => { route.navigator.maybePop(); }
onPressed: () => { route.navigator.maybePop<object>(); }
);
}

public class CupertinoNavigationBarBackButton : StatelessWidget {
public CupertinoNavigationBarBackButton(
Color color,
string previousPageTitle
) {
Key key = null,
Color color = null,
string previousPageTitle = null,
VoidCallback onPressed = null
):base(key:key) {
this.onPressed = onPressed;
Color color,
string previousPageTitle,
Widget backLabel
Widget backLabel,
Color color = null,
string previousPageTitle = null,
VoidCallback onPressed = null
this.onPressed = onPressed;
}
public static CupertinoNavigationBarBackButton _assemble(

backChevron: _backChevron,
backLabel: _backLabel,
color: null,
previousPageTitle: null
backChevron:_backChevron,
backLabel : _backLabel
}
public readonly Color color;

public readonly Widget _backChevron;
public readonly Widget _backLabel;
public readonly VoidCallback onPressed;
D.assert(
currentRoute?.canPop == true,
() => "CupertinoNavigationBarBackButton should only be used in routes that can be popped"
);
if (onPressed == null) {
D.assert(
currentRoute?.canPop == true,
() => "CupertinoNavigationBarBackButton should only be used in routes that can be popped"
);
}
actionTextStyle = actionTextStyle.copyWith(color: color);
// actionTextStyle = actionTextStyle.copyWith(color: color);
actionTextStyle = actionTextStyle.copyWith(color: CupertinoDynamicColor.resolve(color, context));
}
return new CupertinoButton(

)
),
padding: EdgeInsets.zero,
onPressed: () => { Navigator.maybePop(context); }
onPressed: () => {
//Navigator.maybePop(context);
if (onPressed != null) {
onPressed();
} else {
Navigator.maybePop<object>(context);
}
}
);
}
}

string specifiedPreviousTitle = null,
ModalRoute route = null
) : base(key: key) {
D.assert(route != null);
//D.assert(route != null);
this.specifiedPreviousTitle = specifiedPreviousTitle;
this.route = route;
}

if (specifiedPreviousTitle != null) {
return _buildPreviousTitleWidget(context, specifiedPreviousTitle, null);
}
else if (route is CupertinoPageRoute cupertinoRoute) {
//else if (route is CupertinoPageRoute cupertinoRoute) {
else if (route is CupertinoPageRoute && !route.isFirst) {
CupertinoPageRoute cupertinoRoute = route as CupertinoPageRoute;
return new ValueListenableBuilder<string>(
valueListenable: cupertinoRoute.previousTitle,
builder: _buildPreviousTitleWidget

public RenderBox renderBox {
get {
RenderBox box = (RenderBox) componentsKeys.navBarBoxKey.currentContext.findRenderObject();
D.assert(
// RenderBox box = (RenderBox) componentsKeys.navBarBoxKey.currentContext.findRenderObject();
RenderBox box = componentsKeys.navBarBoxKey.currentContext.findRenderObject() as RenderBox;
D.assert(
box.attached,
() => "_TransitionableNavigationBar.renderBox should be called when building " +
"hero flight shuttles when the from and the to nav bar boxes are already " +

public readonly float forwardDirection;
public RelativeRect positionInTransitionBox(
GlobalKey key,
RenderBox from
GlobalKey key = null,
RenderBox from = null
RenderBox componentBox = (RenderBox) key.currentContext.findRenderObject();
//RenderBox componentBox = (RenderBox) key.currentContext.findRenderObject();
RenderBox componentBox = key.currentContext.findRenderObject() as RenderBox;
D.assert(componentBox.attached);
return RelativeRect.fromRect(

public RelativeRectTween slideFromLeadingEdge(
GlobalKey fromKey,
RenderBox fromNavBarBox,
GlobalKey toKey,
RenderBox toNavBarBox
GlobalKey fromKey = null,
RenderBox fromNavBarBox = null,
GlobalKey toKey = null,
RenderBox toNavBarBox = null
RenderBox fromBox = (RenderBox) fromKey.currentContext.findRenderObject();
RenderBox toBox = (RenderBox) toKey.currentContext.findRenderObject();
//RenderBox fromBox = (RenderBox) fromKey.currentContext.findRenderObject();
//RenderBox toBox = (RenderBox) toKey.currentContext.findRenderObject();
RenderBox fromBox = fromKey.currentContext.findRenderObject() as RenderBox;
RenderBox toBox = toKey.currentContext.findRenderObject() as RenderBox;
Rect toRect =
toBox.localToGlobal(

}
public Widget bottomLeading {
get {
KeyedSubtree bottomLeading = (KeyedSubtree) bottomComponents.leadingKey.currentWidget;
get {
//KeyedSubtree bottomLeading = (KeyedSubtree) bottomComponents.leadingKey.currentWidget;
KeyedSubtree bottomLeading = bottomComponents.leadingKey.currentWidget as KeyedSubtree;
if (bottomLeading == null) {
return null;
}

public Widget bottomBackChevron {
get {
KeyedSubtree bottomBackChevron = (KeyedSubtree) bottomComponents.backChevronKey.currentWidget;
//KeyedSubtree bottomBackChevron = (KeyedSubtree) bottomComponents.backChevronKey.currentWidget;
KeyedSubtree bottomBackChevron = bottomComponents.backChevronKey.currentWidget as KeyedSubtree;
if (bottomBackChevron == null) {
return null;

public Widget bottomBackLabel {
get {
KeyedSubtree bottomBackLabel = (KeyedSubtree) bottomComponents.backLabelKey.currentWidget;
//KeyedSubtree bottomBackLabel = (KeyedSubtree) bottomComponents.backLabelKey.currentWidget;
KeyedSubtree bottomBackLabel = bottomComponents.backLabelKey.currentWidget as KeyedSubtree;
if (bottomBackLabel == null) {
return null;

public Widget bottomMiddle {
get {
KeyedSubtree bottomMiddle = (KeyedSubtree) bottomComponents.middleKey.currentWidget;
KeyedSubtree topBackLabel = (KeyedSubtree) topComponents.backLabelKey.currentWidget;
KeyedSubtree topLeading = (KeyedSubtree) topComponents.leadingKey.currentWidget;
//KeyedSubtree bottomMiddle = (KeyedSubtree) bottomComponents.middleKey.currentWidget;
//KeyedSubtree topBackLabel = (KeyedSubtree) topComponents.backLabelKey.currentWidget;
//KeyedSubtree topLeading = (KeyedSubtree) topComponents.leadingKey.currentWidget;
KeyedSubtree bottomMiddle = bottomComponents.middleKey.currentWidget as KeyedSubtree;
KeyedSubtree topBackLabel = topComponents.backLabelKey.currentWidget as KeyedSubtree;
KeyedSubtree topLeading = topComponents.leadingKey.currentWidget as KeyedSubtree;
if (bottomHasUserMiddle != true && bottomLargeExpanded == true) {
return null;

51
com.unity.uiwidgets/Runtime/cupertino/page_scaffold.cs


}
public override Widget build(BuildContext context) {
List<Widget> stacked = new List<Widget>();
//List<Widget> stacked = new List<Widget>();
Widget paddedContent = widget.child;

? existingMediaQuery.viewInsets.copyWith(bottom: 0.0f)
: existingMediaQuery.viewInsets;
bool? fullObstruction =
widget.navigationBar.fullObstruction == false
bool fullObstruction = widget.navigationBar.shouldFullyObstruct(context);
/*widget.navigationBar.fullObstruction == false
: widget.navigationBar.fullObstruction;
: widget.navigationBar.fullObstruction;*/
if (fullObstruction == true) {
paddedContent = new MediaQuery(

);
}
}
stacked.Add(new PrimaryScrollController(
else {
float bottomPadding = widget.resizeToAvoidBottomInset
? existingMediaQuery.viewInsets.bottom
: 0.0f;
paddedContent = new Padding(
padding: EdgeInsets.only(bottom: bottomPadding),
child: paddedContent
);
}
List<Widget> childrenWigets = new List<Widget>();
childrenWigets.Add( new PrimaryScrollController(
stacked.Add(new Positioned(
childrenWigets.Add(new Positioned(
child: widget.navigationBar
child: new MediaQuery(
data: existingMediaQuery.copyWith(textScaleFactor: 1),
child: widget.navigationBar
)
stacked.Add(new Positioned(
childrenWigets.Add(new Positioned(
//excludeFromSemantics: true,
)
);
));
color: widget.backgroundColor ?? CupertinoTheme.of(context).scaffoldBackgroundColor
color: CupertinoDynamicColor.resolve(widget.backgroundColor, context)
?? CupertinoTheme.of(context).scaffoldBackgroundColor
children: stacked
)
);
children: childrenWigets));
public abstract class ObstructingPreferredSizeWidget : PreferredSizeWidget {
public abstract class ObstructingPreferredSizeStateWidget : StatefulWidget {
}
///protected ObstructingPreferredSizeWidget(Key key = null) : base(key: key) {}
public abstract class ObstructingPreferredSizeWidget : PreferredSizeWidget {
protected ObstructingPreferredSizeWidget(Key key = null) : base(key: key) {}
// public virtual bool? fullObstruction { get; }
public abstract bool shouldFullyObstruct(BuildContext context);
}

126
com.unity.uiwidgets/Runtime/cupertino/route.cs


);
public static Future showCupertinoModalPopup(
/*public static Future showCupertinoModalPopup(
BuildContext context,
WidgetBuilder builder
) {

barrierLabel: "Dismiss"
)
);
}*/
Future showCupertinoModalPopup<T>(
BuildContext context = null,
WidgetBuilder builder = null,
ImageFilter filter = null,
bool useRootNavigator = true,
bool? semanticsDismissible =null
) {
D.assert(useRootNavigator != null);
return Navigator.of(context, rootNavigator: useRootNavigator).push(
new _CupertinoModalPopupRoute(
barrierColor: CupertinoDynamicColor.resolve(_kModalBarrierColor, context),
barrierLabel: "Dismiss",
builder: builder,
filter: filter,
semanticsDismissible: semanticsDismissible
)
);
}

}
public static Future showCupertinoDialog(
BuildContext context,
WidgetBuilder builder
BuildContext context = null,
WidgetBuilder builder =null,
bool useRootNavigator = true,
RouteSettings routeSettings = null
return _DialogRoute.showGeneralDialog(
D.assert(useRootNavigator != null);
return DialogUtils.showGeneralDialog<object>(
context: context,
barrierDismissible: false,
barrierColor: CupertinoDynamicColor.resolve(_kModalBarrierColor, context),
// This transition duration was eyeballed comparing with iOS
transitionDuration: new TimeSpan(0, 0, 0, 0, 250),
pageBuilder: (BuildContext context1, Animation<float> animation, Animation<float> secondaryAnimation)=> {
return builder(context1);
},
transitionBuilder: _buildCupertinoDialogTransitions,
useRootNavigator: useRootNavigator,
routeSettings: routeSettings
);
/*return _DialogRoute.showGeneralDialog(
context: context,
barrierDismissible: false,
barrierColor: _kModalBarrierColor,

return builder(_context);
},
transitionBuilder: _buildCupertinoDialogTransitions
);
);*/
}
}

return true;
}
return Equals(edgeGradient, other.edgeGradient);
return other is _CupertinoEdgeShadowDecoration && Equals(edgeGradient, other.edgeGradient);
}
public override bool Equals(object obj) {

bool linearTransition = isPopGestureInProgress(route);
if (route.fullscreenDialog) {
return new CupertinoFullscreenDialogTransition(
animation: animation,
child: child
//animation: animation,
//child: child
primaryRouteAnimation: animation,
secondaryRouteAnimation: secondaryAnimation,
child: child,
linearTransition: linearTransition
);
}

class CupertinoFullscreenDialogTransition : StatelessWidget {
public CupertinoFullscreenDialogTransition(
Animation<float> animation,
Widget child,
Key key = null
Key key = null,
Animation<float> primaryRouteAnimation = null,
Animation<float> secondaryRouteAnimation = null,
Widget child = null,
bool linearTransition =false
parent: animation,
parent: primaryRouteAnimation,
_secondaryPositionAnimation =
(linearTransition
? secondaryRouteAnimation
: new CurvedAnimation(
parent: secondaryRouteAnimation,
curve: Curves.linearToEaseOut,
reverseCurve: Curves.easeInToLinear
)
).drive(CupertinoRouteUtils._kMiddleLeftTween);
readonly Animation<Offset> _positionAnimation;
public readonly Animation<Offset> _positionAnimation;
public readonly Animation<Offset> _secondaryPositionAnimation;
return new SlideTransition(
/*return new SlideTransition(
);*/
D.assert(WidgetsD.debugCheckHasDirectionality(context));
TextDirection textDirection = Directionality.of(context);
return new SlideTransition(
position: _secondaryPositionAnimation,
textDirection: textDirection,
transformHitTests: false,
child: new SlideTransition(
position: _positionAnimation,
child: child
)
);
}
}

bool animateForward;
if (velocity.abs() >= CupertinoRouteUtils._kMinFlingVelocity) {
animateForward = velocity > 0 ? false : true;
animateForward = velocity <= 0;
}
else {
animateForward = controller.value > 0.5;
}
/* animateForward = velocity > 0 ? false : true;
}
}*/
if (animateForward) {
int droppedPageForwardAnimationTime = Mathf.Min(

curve: animationCurve);
}
else {
navigator.pop();
navigator.pop<object>();
if (controller.isAnimating) {
int droppedPageBackAnimationTime =

class _CupertinoModalPopupRoute : PopupRoute{
public _CupertinoModalPopupRoute(
Color barrierColor = null,
string barrierLabel = null,
string barrierLabel = null,
bool? semanticsDismissible = null,
ImageFilter filter = null,
) : base(settings: settings) {
) : base(filter:filter,settings: settings) {
this.barrierColor = barrierColor;
_semanticsDismissible = semanticsDismissible;
}
public readonly WidgetBuilder builder;

public override Color barrierColor {
public bool? _semanticsDismissible;
public new Color barrierColor;
/*{
}
}*/
public override bool barrierDismissible {
get { return true; }

get { return false; }
get { return _semanticsDismissible ?? false; }
}
public override TimeSpan transitionDuration {

public override Widget buildPage(BuildContext context, Animation<float> animation,
Animation<float> secondaryAnimation) {
return builder(context);
//return builder(context);
return new CupertinoUserInterfaceLevel(
data: CupertinoUserInterfaceLevelData.elevatedlayer,
child: new Builder(builder: builder)
);
}

3
com.unity.uiwidgets/Runtime/cupertino/text_field.cs


using Unity.UIWidgets.widgets;
using StrutStyle = Unity.UIWidgets.painting.StrutStyle;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
using Brightness = Unity.UIWidgets.ui.Brightness;
namespace Unity.UIWidgets.cupertino {
class CupertinoTextFieldUtils {

CupertinoThemeData themeData = CupertinoTheme.of(context);
TextStyle textStyle = themeData.textTheme.textStyle.merge(widget.style);
TextStyle placeholderStyle = textStyle.merge(widget.placeholderStyle);
ui.Brightness keyboardAppearance = widget.keyboardAppearance ?? themeData.brightness;
Brightness? keyboardAppearance = widget.keyboardAppearance ?? themeData.brightness;
Color cursorColor = widget.cursorColor ?? themeData.primaryColor;
Widget paddedEditable = new Padding(

33
com.unity.uiwidgets/Runtime/painting/colors.cs


return GetType() + "(primary value: " + base.ToString() + ")";
}
}
class ColorProperty : DiagnosticsProperty<Color> {
public ColorProperty(
string name = "",
Color value = null,
bool showName = true,
object defaultValue = null,
DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine,
DiagnosticLevel level = DiagnosticLevel.info
) : base(name, value,
defaultValue: defaultValue,
showName: showName,
style: style,
level: level
) {
D.assert(showName != null);
D.assert(style != null);
D.assert(level != null);
}
public override Dictionary<string, object> toJsonMap() {
Dictionary<string, object> json = base.toJsonMap();
if (value != null) {
json["valueProperties"] = new Dictionary<string, object> {
{"red", value.red},
{"green", value.green},
{"blue", value.blue},
{"alpha", value.alpha}
};
}
return json;
}
}
public static class ColorUtils {
internal static Color _colorFromHue(
float alpha,

4
com.unity.uiwidgets/Runtime/rendering/error.cs


return rendering_._kMaxHeight;
}
protected override bool sizedByParent {
/*protected override bool sizedByParent {
}
}*/
protected override bool hitTestSelf(Offset position) => true;

320
com.unity.uiwidgets/Runtime/widgets/app.cs


using System.Collections.Generic;
using System;
using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;

public readonly GenerateAppTitle onGenerateTitle;
public readonly Color color;
public readonly InspectorSelectButtonBuilder inspectorSelectButtonBuilder;
public static bool showPerformanceOverlayOverride = false;
public static bool debugShowWidgetInspectorOverride = false;
public static bool debugAllowBannerOverride = true;
public readonly bool debugShowCheckedModeBanner;
public readonly bool checkerboardRasterCacheImages;
public readonly bool checkerboardOffscreenLayers;
public readonly bool showSemanticsDebugger;
public readonly bool debugShowWidgetInspector;
public WidgetsApp(
Key key = null,

RouteFactory onUnknownRoute = null,
PageRouteFactory pageRouteBuilder = null,
PageRouteFactory pageRouteBuilder = null,
Widget home = null,
string title = "",
GenerateAppTitle onGenerateTitle = null,
Widget home = null,
Color color = null,
Locale locale = null,
List<LocalizationsDelegate> localizationsDelegates = null,
LocaleListResolutionCallback localeListResolutionCallback = null,

GenerateAppTitle onGenerateTitle = null,
string title = "",
Color color = null,
bool checkerboardRasterCacheImages = false,
bool checkerboardOffscreenLayers = false,
bool showSemanticsDebugger = false,
bool debugShowWidgetInspector = false,
bool debugShowCheckedModeBanner = true,
//shortcuts
//actions
D.assert(navigatorObservers != null);
D.assert(routes != null);
this.home = home;
this.navigatorKey = navigatorKey;
this.onGenerateRoute = onGenerateRoute;

this.localeResolutionCallback = localeResolutionCallback;
this.supportedLocales = supportedLocales;
this.showPerformanceOverlay = showPerformanceOverlay;
this.checkerboardOffscreenLayers = checkerboardOffscreenLayers;
this.checkerboardRasterCacheImages = checkerboardRasterCacheImages;
this.showSemanticsDebugger = showSemanticsDebugger;
this.debugShowWidgetInspector = debugShowWidgetInspector;
this.onGenerateTitle = onGenerateTitle;
this.title = title;

"because otherwise there is nothing to fall back on if the " +
"app is started with an intent that specifies an unknown route."
);
D.assert(
(home != null ||
routes.isNotEmpty() ||
onGenerateRoute != null ||
onUnknownRoute != null)
||
(builder != null &&
navigatorKey == null &&
initialRoute == null &&
navigatorObservers.isEmpty()),()=>
"If no route is provided using " +
"home, routes, onGenerateRoute, or onUnknownRoute, " +
"a non-null callback for the builder property must be provided, " +
"and the other navigator-related properties, " +
"navigatorKey, initialRoute, and navigatorObservers, " +
"must have their initial values " +
"(null, null, and the empty list, respectively).");
D.assert(
builder != null ||

}
class _WidgetsAppState : State<WidgetsApp>, WidgetsBindingObserver {
GlobalKey<NavigatorState> _navigator;
public Future<bool> didPopRoute() {
///async
D.assert(mounted);
var navigator = _navigator?.currentState;
if (navigator == null) {
return Future<bool>.value(false).to<bool>();
}
return navigator.maybePop<bool>();
}
public Future<bool> didPushRoute(string route) {
D.assert(mounted);
var navigator = _navigator?.currentState;
if (navigator == null) {
return Future<bool>.value(false).to<bool>();
}
navigator.pushNamed<bool>(route);
return Future<bool>.value(true).to<bool>();
}
public void didChangeMetrics() {
setState();
}

_locale =
_resolveLocales(new List<Locale> {new Locale("en", "US")}, widget.supportedLocales);
D.assert(() => {
/*D.assert(() => {
});
});*/
WidgetsBinding.instance.addObserver(this);
}

public override void dispose() {
WidgetsBinding.instance.removeObserver(this);
D.assert(() => {
/*D.assert(() => {
});
});*/
GlobalKey<NavigatorState> _navigator;
void _updateNavigator() {
_navigator = widget.navigatorKey ?? new GlobalObjectKey<NavigatorState>(this);

return null;
}
public Future<bool> didPopRoute() {
///async
D.assert(mounted);
var navigator = _navigator?.currentState;
if (navigator == null) {
return Future<bool>.value(false).to<bool>();
}
return navigator.maybePop<bool>();
}
public Future<bool> didPushRoute(string route) {
D.assert(mounted);
var navigator = _navigator?.currentState;
if (navigator == null) {
return Future<bool>.value(false).to<bool>();
}
navigator.pushNamed<bool>(route);
return Future<bool>.value(true).to<bool>();
}
Route _onUnknownRoute(RouteSettings settings) {
D.assert(() => {
if (widget.onUnknownRoute == null) {

}
Dictionary<string, Locale> allSupportedLocales = new Dictionary<string, Locale>();
Dictionary<string, Locale> languageAndCountryLocales = new Dictionary<string, Locale>();
Dictionary<string, Locale> languageAndScriptLocales = new Dictionary<string, Locale>();
allSupportedLocales.putIfAbsent(locale.languageCode + "_" + locale.countryCode, () => locale);
allSupportedLocales.putIfAbsent(
locale.languageCode + "_" + locale.scriptCode + "_" + locale.countryCode, () => locale);
languageAndScriptLocales.putIfAbsent(locale.languageCode + "_" + locale.scriptCode, () => locale);
languageAndCountryLocales.putIfAbsent(locale.languageCode + "_" + locale.countryCode, () => locale);
}
Locale matchesLanguageCode = null;

Locale userLocale = preferredLocales[localeIndex];
if (allSupportedLocales.ContainsKey(userLocale.languageCode + "_" + userLocale.countryCode)) {
if (allSupportedLocales.ContainsKey(userLocale.languageCode + "_" + userLocale.scriptCode + "_" +
userLocale.countryCode)) {
if (userLocale.scriptCode != null) {
Locale match = null;
if (languageAndScriptLocales.TryGetValue(userLocale.languageCode + "_" + userLocale.scriptCode,
out match)) {
if (match != null) {
return match;
}
}
}
if (userLocale.countryCode != null) {
//Locale match = languageAndCountryLocales['${userLocale.languageCode}_${userLocale.countryCode}'];
Locale match = null;
if (languageAndCountryLocales.TryGetValue(userLocale.languageCode + "_" + userLocale.countryCode,
out match)) {
if (match != null) {
return match;
}
}
}
if (matchesLanguageCode != null) {
return matchesLanguageCode;
}

if (localeIndex == 0 &&
!(localeIndex + 1 < preferredLocales.Count && preferredLocales[localeIndex + 1].languageCode ==
userLocale.languageCode)) {
userLocale.languageCode)) {
return matchesLanguageCode;
}
}

setState();
}
/*bool _debugCheckLocalizations(Locale appLocale) {
D.assert(() =>{
Set<Type> unsupportedTypes =
_localizationsDelegates.map<Type>((LocalizationsDelegate delegate) => delegate.type).toSet();
foreach ( LocalizationsDelegate<dynamic> delegate in _localizationsDelegates) {
if (!unsupportedTypes.contains(delegate.type))
continue;
if (delegate.isSupported(appLocale))
unsupportedTypes.remove(delegate.type);
}
if (unsupportedTypes.isEmpty)
return true;
if (listEquals(unsupportedTypes.map((Type type) => type.toString()).toList(), <String>['CupertinoLocalizations']))
return true;
StringBuffer message = new StringBuffer();
message.writeln('\u2550' * 8);
message.writeln(
"Warning: This application's locale, $appLocale, is not supported by all of its\n"
'localization delegates.'
);
foreach ( Type unsupportedType in unsupportedTypes) {
// Currently the Cupertino library only provides english localizations.
// Remove this when https://github.com/flutter/flutter/issues/23847
// is fixed.
if (unsupportedType.toString() == 'CupertinoLocalizations')
continue;
message.writeln(
'> A $unsupportedType delegate that supports the $appLocale locale was not found.'
);
}
message.writeln(
'See https://flutter.dev/tutorials/internationalization/ for more\n'
"information about configuring an app's locale, supportedLocales,\n"
'and localizationsDelegates parameters.'
);
message.writeln('\u2550' * 8);
debugPrint(message.toString());
return true;
});
return true;
}*/
RouteListFactory routeListFactory = (state, route) => {return widget.onGenerateInitialRoutes(route); };
navigator = new Navigator(
key: _navigator,
//initialRoute: widget.initialRoute ?? Navigator.defaultRouteName,

: widget.initialRoute ?? WidgetsBinding.instance.window.defaultRouteName,
onGenerateRoute: _onGenerateRoute,
onGenerateInitialRoutes:
widget.onGenerateInitialRoutes == null
onGenerateInitialRoutes:
widget.onGenerateInitialRoutes == null
: (NavigatorState navigator1, string initialRouteName) => {
return widget.onGenerateInitialRoutes(initialRouteName);
},
: routeListFactory,
onUnknownRoute: _onUnknownRoute,
observers: widget.navigatorObservers
);

if (widget.showPerformanceOverlay) {
performanceOverlay = PerformanceOverlay.allEnabled();
}
/*if (widget.showPerformanceOverlay || WidgetsApp.showPerformanceOverlayOverride) {
performanceOverlay = PerformanceOverlay.allEnabled(
checkerboardRasterCacheImages: widget.checkerboardRasterCacheImages,
checkerboardOffscreenLayers: widget.checkerboardOffscreenLayers
);
} else if (widget.checkerboardRasterCacheImages || widget.checkerboardOffscreenLayers) {
performanceOverlay = new PerformanceOverlay(
checkerboardRasterCacheImages: widget.checkerboardRasterCacheImages,
checkerboardOffscreenLayers: widget.checkerboardOffscreenLayers
);
}*/
if (performanceOverlay != null) {
result = new Stack(

});
}
/*if (widget.showSemanticsDebugger) {
result = SemanticsDebugger(
child: result,
);
}*/
/*if (widget.debugShowWidgetInspector || WidgetsApp.debugShowWidgetInspectorOverride) {
result = new WidgetInspector(
child: result,
selectButtonBuilder: widget.inspectorSelectButtonBuilder
);
}
if (widget.debugShowCheckedModeBanner && WidgetsApp.debugAllowBannerOverride) {
result = new CheckedModeBanner(
child: result
);
}*/
return true;
});

child: result
);
/*Widget title = null;
if (widget.onGenerateTitle != null) {
title = new Builder(
builder: (BuildContext context1)=> {
string title1 = widget.onGenerateTitle(context1);
D.assert(title1 != null,()=> "onGenerateTitle must return a non-null String");
return new Title(
title: title1,
color: widget.color,
child: result
);
}
);
} else {
title = new Title(
title: widget.title,
color: widget.color,
child: result
);
}*/
Locale appLocale = widget.locale != null
? _resolveLocales(new List<Locale> {widget.locale}, widget.supportedLocales)

delegates: _localizationsDelegates,
child: result)
);
/////todo
///
/*result = new Shortcuts(
shortcuts: widget.shortcuts ?? WidgetsApp.defaultShortcuts,
debugLabel: "<Default WidgetsApp Shortcuts>",
child: new Actions(
actions: widget.actions ?? WidgetsApp.defaultActions,
child: FocusTraversalGroup(
policy: ReadingOrderTraversalPolicy(),
child: _MediaQueryFromWindow(
child: new Localizations(
locale: appLocale,
delegates: _localizationsDelegates,
child: title
)
)
)
)
);*/
return result;
}

}
}
public class _MediaQueryFromWindow : StatefulWidget {
public _MediaQueryFromWindow(Key key = null, Widget child = null) : base(key: key) {
}
public readonly Widget child;
public override State createState() {
return new _MediaQueryFromWindowsState();
}
}
class _MediaQueryFromWindowsState : State<_MediaQueryFromWindow>,WidgetsBindingObserver {
public override void initState() {
base.initState();
WidgetsBinding.instance.addObserver(this);
}
public void didChangeAccessibilityFeatures() {
setState(()=> {
});
}
public void didChangeMetrics() {
setState(()=>{
});
}
public void didChangeTextScaleFactor() {
setState(()=> {
});
}
public void didChangePlatformBrightness() {
setState(()=> {
});
}
public void didChangeLocales(List<Locale> locale) {
throw new NotImplementedException();
}
public Future<bool> didPopRoute() {
throw new NotImplementedException();
}
public Future<bool> didPushRoute(string route) {
throw new NotImplementedException();
}
public override Widget build(BuildContext context) {
return new MediaQuery(
data: MediaQueryData.fromWindow(WidgetsBinding.instance.window),
child: widget.child
);
}
public override void dispose() {
WidgetsBinding.instance.removeObserver(this);
base.dispose();
}
}

5
com.unity.uiwidgets/Runtime/widgets/framework.cs


}
protected virtual Element updateChild(Element child, Widget newWidget, object newSlot) {
int p = 1;
D.assert(() => {
/*D.assert(() => {
if (newWidget != null && newWidget.key is GlobalKey) {
GlobalKey key = (GlobalKey) newWidget.key;
key._debugReserveFor(this);

});
});*/
if (newWidget == null) {
if (child != null)

232
com.unity.uiwidgets/Runtime/widgets/heroes.cs


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;

namespace Unity.UIWidgets.widgets {
public delegate Tween<Rect> CreateRectTween(Rect begin, Rect end);
public delegate Widget HeroPlaceholderBuilder(
BuildContext context,
Size heroSize,
Widget child
);
public delegate Widget HeroFlightShuttleBuilder(
BuildContext flightContext,
Animation<float> animation,

}
class HeroUtils {
public static Rect _globalBoundingBoxFor(BuildContext context) {
/*public static Rect _globalBoundingBoxFor(BuildContext context) {
}*/
public static Rect _boundingBoxFor(BuildContext context, BuildContext ancestorContext = null) {
RenderBox box = context.findRenderObject() as RenderBox;
D.assert(box != null && box.hasSize);
return MatrixUtils.transformRect(
box.getTransformTo(ancestorContext?.findRenderObject()),
Offset.zero & box.size
);
}
}

object tag = null,
CreateRectTween createRectTween = null,
HeroFlightShuttleBuilder flightShuttleBuilder = null,
TransitionBuilder placeholderBuilder = null,
HeroPlaceholderBuilder placeholderBuilder = null,
bool transitionOnUserGestures = false,
Widget child = null
) : base(key: key) {

public readonly Widget child;
public readonly HeroFlightShuttleBuilder flightShuttleBuilder;
public readonly TransitionBuilder placeholderBuilder;
public readonly HeroPlaceholderBuilder placeholderBuilder;
//public readonly TransitionBuilder placeholderBuilder;
public readonly bool transitionOnUserGestures;

D.assert(navigator != null);
Dictionary<object, _HeroState> result = new Dictionary<object, _HeroState> { };
void addHero(StatefulElement hero, object tag) {
/*void addHero(StatefulElement hero, object tag) {
D.assert(() => {
if (result.ContainsKey(tag)) {
throw new UIWidgetsError(

});
_HeroState heroState = (_HeroState) hero.state;
result[tag] = heroState;
}*/
void inviteHero(StatefulElement hero, object tag) {
D.assert(()=> {
if (result.ContainsKey(tag)) {
throw new UIWidgetsError(
"There are multiple heroes that share the same tag within a subtree.\n" +
"Within each subtree for which heroes are to be animated (typically a PageRoute subtree), " +
"each Hero must have a unique non-null tag.\n" +
$"In this case, multiple heroes had the following tag: {tag}\n" +
"Here is the subtree for one of the offending heroes:\n" +
$"{hero.toStringDeep(prefixLineOne: "# ")}"
);
}
return true;
});
Hero heroWidget = hero.widget as Hero;
_HeroState heroState = hero.state as _HeroState;
if (!isUserGestureTransition || heroWidget.transitionOnUserGestures) {
result[tag] = heroState;
} else {
// If transition is not allowed, we need to make sure hero is not hidden.
// A hero can be hidden previously due to hero transition.
heroState.ensurePlaceholderIsHidden();
}
if (element.widget is Hero) {
/*if (element.widget is Hero) {
StatefulElement hero = (StatefulElement) element;
Hero heroWidget = (Hero) element.widget;
if (!isUserGestureTransition || heroWidget.transitionOnUserGestures) {

}
}
}
}*/
Widget widget = element.widget;
if (widget is Hero) {
StatefulElement hero = element as StatefulElement;
object tag = ((Hero)widget).tag;
D.assert(tag != null);
if (Navigator.of(hero) == navigator) {
inviteHero(hero, tag);
} else {
ModalRoute heroRoute = ModalRoute.of(hero);
if (heroRoute != null && heroRoute is PageRoute && heroRoute.isCurrent) {
inviteHero(hero, tag);
}
}
}
element.visitChildren(visitor);

class _HeroState : State<Hero> {
GlobalKey _key = GlobalKey.key();
Size _placeholderSize;
public void startFlight() {
bool _shouldIncludeChild = true;
//public void startFlight() {
public void startFlight( bool shouldIncludedChildInPlaceholder = false ) {
_shouldIncludeChild = shouldIncludedChildInPlaceholder;
D.assert(mounted);
RenderBox box = (RenderBox) context.findRenderObject();
D.assert(box != null && box.hasSize);

public void endFlight() {
//public void endFlight() {
public void ensurePlaceholderIsHidden() {
public void endFlight(bool keepPlaceholder = false ) {
if (!keepPlaceholder) {
ensurePlaceholderIsHidden();
}
}
D.assert(context.ancestorWidgetOfExactType(typeof(Hero)) == null,
D.assert(
//context.ancestorWidgetOfExactType(typeof(Hero)) == null,
context.findAncestorWidgetOfExactType<Hero>() == null,
if (_placeholderSize != null) {
if (widget.placeholderBuilder == null) {
//if (_placeholderSize != null) {
// if (widget.placeholderBuilder == null) {
bool showPlaceholder = _placeholderSize != null;
if (showPlaceholder && widget.placeholderBuilder != null) {
return widget.placeholderBuilder(context, _placeholderSize, widget.child);
}
if (showPlaceholder && !_shouldIncludeChild) {
else {
return new SizedBox(
width: _placeholderSize?.width,
height: _placeholderSize?.height,
child: new Offstage(
offstage: showPlaceholder,
child: new TickerMode(
enabled: !showPlaceholder,
child: new KeyedSubtree(key: _key, child: widget.child)
)
)
);
/*else {
}
}
}*/
return new KeyedSubtree(
/*return new KeyedSubtree(
);
);*/
HeroFlightDirection type,
OverlayState overlay,
Rect navigatorRect,
PageRoute fromRoute,
PageRoute toRoute,
_HeroState fromHero,
_HeroState toHero,
CreateRectTween createRectTween,
HeroFlightShuttleBuilder shuttleBuilder,
bool isUserGestureTransition
HeroFlightDirection type = default,
OverlayState overlay = null ,
Rect navigatorRect = null,
PageRoute fromRoute = null,
PageRoute toRoute = null,
_HeroState fromHero = null,
_HeroState toHero = null,
CreateRectTween createRectTween = null,
HeroFlightShuttleBuilder shuttleBuilder = null,
bool isUserGestureTransition = false,
bool isDiverted = false
) {
D.assert(fromHero.widget.tag.Equals(toHero.widget.tag));
this.type = type;

public readonly CreateRectTween createRectTween;
public readonly HeroFlightShuttleBuilder shuttleBuilder;
public readonly bool isUserGestureTransition;
public readonly bool isDiverted;
public object tag {
get { return fromHero.widget.tag; }

return new CurvedAnimation(
parent: (type == HeroFlightDirection.push) ? toRoute.animation : fromRoute.animation,
curve: Curves.fastOutSlowIn
, reverseCurve: isDiverted ? null : Curves.fastOutSlowIn.flipped
);
}
}

Widget shuttle;
Animation<float> _heroOpacity = Animations.kAlwaysCompleteAnimation;
ProxyAnimation _proxyAnimation;
public ProxyAnimation _proxyAnimation;
public _HeroFlightManifest manifest;
public OverlayEntry overlayEntry;
bool _aborted = false;

animation: _proxyAnimation,
child: shuttle,
builder: (BuildContext _, Widget child) => {
RenderBox toHeroBox = (RenderBox) manifest.toHero.context?.findRenderObject();
//RenderBox toHeroBox = (RenderBox) manifest.toHero.context?.findRenderObject();
RenderBox toHeroBox = manifest.toHero.context?.findRenderObject() as RenderBox;
if (_aborted || toHeroBox == null || !toHeroBox.attached) {
if (_heroOpacity.isCompleted) {
_heroOpacity = _proxyAnimation.drive(

}
}
else if (toHeroBox.hasSize) {
RenderBox finalRouteBox = (RenderBox) manifest.toRoute.subtreeContext?.findRenderObject();
//RenderBox finalRouteBox = (RenderBox) manifest.toRoute.subtreeContext?.findRenderObject();
RenderBox finalRouteBox = manifest.toRoute.subtreeContext?.findRenderObject() as RenderBox;
Offset toHeroOrigin = toHeroBox.localToGlobal(Offset.zero, ancestor: finalRouteBox);
if (toHeroOrigin != heroRectTween.end.topLeft) {
Rect heroRectEnd = toHeroOrigin & heroRectTween.end.size;

);
}
void _handleAnimationUpdate(AnimationStatus status) {
public void _handleAnimationUpdate(AnimationStatus status) {
if (status == AnimationStatus.completed || status == AnimationStatus.dismissed) {
_proxyAnimation.parent = null;

manifest.fromHero.endFlight(keepPlaceholder: status == AnimationStatus.completed);
manifest.toHero.endFlight(keepPlaceholder: status == AnimationStatus.dismissed);
manifest.fromHero.endFlight();
manifest.toHero.endFlight();
//manifest.fromHero.endFlight();
//manifest.toHero.endFlight();
onFlightEnded(this);
}
}

else {
_proxyAnimation.parent = manifest.animation;
}
manifest.fromHero.startFlight();
manifest.fromHero.startFlight(shouldIncludedChildInPlaceholder: manifest.type == HeroFlightDirection.push);
//manifest.fromHero.startFlight();
HeroUtils._globalBoundingBoxFor(manifest.fromHero.context),
HeroUtils._globalBoundingBoxFor(manifest.toHero.context)
//HeroUtils._globalBoundingBoxFor(manifest.fromHero.context),
//HeroUtils._globalBoundingBoxFor(manifest.toHero.context)
HeroUtils._boundingBoxFor(manifest.fromHero.context, manifest.fromRoute.subtreeContext),
HeroUtils._boundingBoxFor(manifest.toHero.context, manifest.toRoute.subtreeContext)
);
overlayEntry = new OverlayEntry(builder: _buildOverlay);

);
if (manifest.fromHero != newManifest.toHero) {
manifest.fromHero.endFlight();
//manifest.fromHero.endFlight();
manifest.fromHero.endFlight(keepPlaceholder: true);
heroRectTween = _doCreateRectTween(heroRectTween.end,
HeroUtils._globalBoundingBoxFor(newManifest.toHero.context));
//heroRectTween = _doCreateRectTween(heroRectTween.end, HeroUtils._globalBoundingBoxFor(newManifest.toHero.context));
heroRectTween = _doCreateRectTween(
heroRectTween.end,
HeroUtils._boundingBoxFor(newManifest.toHero.context, newManifest.toRoute.subtreeContext)
);
}
else {
heroRectTween = _doCreateRectTween(heroRectTween.end, heroRectTween.begin);

D.assert(manifest.fromHero != newManifest.fromHero);
D.assert(manifest.toHero != newManifest.toHero);
heroRectTween = _doCreateRectTween(heroRectTween.evaluate(_proxyAnimation),
HeroUtils._globalBoundingBoxFor(newManifest.toHero.context));
//heroRectTween = _doCreateRectTween(heroRectTween.evaluate(_proxyAnimation), HeroUtils._globalBoundingBoxFor(newManifest.toHero.context));
heroRectTween = _doCreateRectTween(
heroRectTween.evaluate(_proxyAnimation),
HeroUtils._boundingBoxFor(newManifest.toHero.context, newManifest.toRoute.subtreeContext)
);
shuttle = null;
if (newManifest.type == HeroFlightDirection.pop) {

_proxyAnimation.parent = newManifest.animation;
}
manifest.fromHero.endFlight(keepPlaceholder: true);
manifest.toHero.endFlight(keepPlaceholder: true);
manifest.fromHero.endFlight();
manifest.toHero.endFlight();
// Let the heroes in each of the routes rebuild with their placeholders.
newManifest.fromHero.startFlight(shouldIncludedChildInPlaceholder: newManifest.type == HeroFlightDirection.push);
newManifest.fromHero.startFlight();
//manifest.fromHero.endFlight();
//manifest.toHero.endFlight();
//newManifest.fromHero.startFlight();
newManifest.toHero.startFlight();
overlayEntry.markNeedsBuild();

D.assert(route != null);
_maybeStartHeroTransition(route, previousRoute, HeroFlightDirection.pop, true);
}
void didStopUserGesture() {
if (navigator.userGestureInProgress)
return;
bool isInvalidFlight(_HeroFlight flight) {
return flight.manifest.isUserGestureTransition
&& flight.manifest.type == HeroFlightDirection.pop
&& flight._proxyAnimation.isDismissed;
}
List<_HeroFlight> invalidFlights = _flights.Values
.Where(isInvalidFlight)
.ToList();
// Treat these invalidated flights as dismissed. Calling _handleAnimationUpdate
// will also remove the flight from _flights.
foreach ( _HeroFlight flight in invalidFlights) {
flight._handleAnimationUpdate(AnimationStatus.dismissed);
}
}
void _maybeStartHeroTransition(
Route fromRoute,

return;
}
Rect navigatorRect = HeroUtils._globalBoundingBoxFor(navigator.context);
Rect navigatorRect = HeroUtils._boundingBoxFor(navigator.context);//_globalBoundingBoxFor(navigator.context);
Dictionary<object, _HeroState> fromHeroes =
Hero._allHeroesFor(from.subtreeContext, isUserGestureTransition, navigator);

if (toHeroes.ContainsKey(tag)) {
HeroFlightShuttleBuilder fromShuttleBuilder = fromHeroes[tag].widget.flightShuttleBuilder;
HeroFlightShuttleBuilder toShuttleBuilder = toHeroes[tag].widget.flightShuttleBuilder;
bool isDiverted = _flights[tag] != null;
_HeroFlightManifest manifest = new _HeroFlightManifest(
type: flightType,
overlay: navigator.overlay,

createRectTween: createRectTween,
shuttleBuilder:
toShuttleBuilder ?? fromShuttleBuilder ?? _defaultHeroFlightShuttleBuilder,
isUserGestureTransition: isUserGestureTransition
isUserGestureTransition: isUserGestureTransition,
isDiverted: isDiverted
if (_flights.TryGetValue(tag, out var result)) {
result.divert(manifest);
//if (_flights.TryGetValue(tag, out var result)) {
if (isDiverted){
_flights[tag].divert(manifest);
}
else {
_flights[tag] = new _HeroFlight(_handleFlightEnded);

else if (_flights.TryGetValue(tag, out var result)) {
result.abort();
}
}
foreach (object tag in toHeroes.Keys) {
if (fromHeroes[tag] == null)
toHeroes[tag].ensurePlaceholderIsHidden();
}
}

173
com.unity.uiwidgets/Runtime/widgets/media_query.cs


using System;
using System.Collections.Generic;
using UnityEngine;
using Brightness = Unity.UIWidgets.ui.Brightness;
namespace Unity.UIWidgets.widgets {

float devicePixelRatio = 1.0f,
float textScaleFactor = 1.0f,
Brightness platformBrightness = Brightness.light,
EdgeInsets padding = null,
EdgeInsets padding = null,
EdgeInsets systemGestureInsets = null,
EdgeInsets viewPadding = null,
float physicalDepth = float.MaxValue,
bool highContrast = false,
D.assert(size != null);
D.assert(devicePixelRatio != null);
D.assert(textScaleFactor != null);
D.assert(platformBrightness != null);
D.assert(padding != null);
D.assert(viewInsets != null);
D.assert(systemGestureInsets != null);
D.assert(viewPadding != null);
D.assert(physicalDepth != null);
D.assert(alwaysUse24HourFormat != null);
D.assert(accessibleNavigation != null);
D.assert(invertColors != null);
D.assert(highContrast != null);
D.assert(disableAnimations != null);
D.assert(boldText != null);
this.size = size ?? Size.zero;
this.devicePixelRatio = devicePixelRatio;
this.textScaleFactor = textScaleFactor;

this.systemGestureInsets = systemGestureInsets ?? EdgeInsets.zero;
this.viewPadding = viewPadding ?? EdgeInsets.zero;
this.physicalDepth = physicalDepth;
this.highContrast = highContrast;
this.disableAnimations = disableAnimations;
this.boldText = boldText;
}

size: window.physicalSize / window.devicePixelRatio,
devicePixelRatio: window.devicePixelRatio,
textScaleFactor: window.textScaleFactor,
// platformBrightness: window.platformBrightness, // TODO: remove comment when window.platformBrightness is ready
platformBrightness: window.platformBrightness, // TODO: remove comment when window.platformBrightness is ready
padding: EdgeInsets.fromWindowPadding(window.padding, window.devicePixelRatio),
viewPadding : EdgeInsets.fromWindowPadding(window.viewPadding, window.devicePixelRatio),
padding: EdgeInsets.fromWindowPadding(window.padding, window.devicePixelRatio)
// accessibleNavigation: window.accessibilityFeatures.accessibleNavigation,
// invertColors: window.accessibilityFeatures.invertColors,
// disableAnimations: window.accessibilityFeatures.disableAnimations,
// boldText: window.accessibilityFeatures.boldText,
// alwaysUse24HourFormat: window.alwaysUse24HourFormat
systemGestureInsets : EdgeInsets.fromWindowPadding(window.systemGestureInsets, window.devicePixelRatio),
physicalDepth : window.physicalDepth,
accessibleNavigation: window.accessibilityFeatures.accessibleNavigation,
invertColors: window.accessibilityFeatures.invertColors,
disableAnimations: window.accessibilityFeatures.disableAnimations,
boldText: window.accessibilityFeatures.boldText,
highContrast : window.accessibilityFeatures.highContrast,
alwaysUse24HourFormat: window.alwaysUse24HourFormat
);
}

public readonly EdgeInsets padding;
public readonly EdgeInsets systemGestureInsets;
public readonly EdgeInsets viewPadding;
public readonly float physicalDepth;
public readonly bool highContrast;
public readonly bool disableAnimations;

float? devicePixelRatio = null,
float? textScaleFactor = null,
Brightness? platformBrightness = null,
EdgeInsets viewInsets = null,
EdgeInsets viewPadding = null,
EdgeInsets viewInsets = null,
EdgeInsets systemGestureInsets = null,
float? physicalDepth = null,
bool? highContrast =null,
bool? disableAnimations = null,
bool? invertColors = null,
bool? invertColors = null,
bool? disableAnimations = null,
bool? boldText = null
) {
return new MediaQueryData(

platformBrightness: platformBrightness ?? this.platformBrightness,
padding: padding ?? this.padding,
viewPadding: viewPadding ?? this.viewPadding,
padding: padding ?? this.padding,
systemGestureInsets: systemGestureInsets ?? this.systemGestureInsets,
physicalDepth: physicalDepth ?? this.physicalDepth,
accessibleNavigation: accessibleNavigation ?? this.accessibleNavigation,
highContrast: highContrast ?? this.highContrast,
accessibleNavigation: accessibleNavigation ?? this.accessibleNavigation,
boldText: boldText ?? this.boldText
);
}

top: removeTop ? (float?) 0.0 : null,
right: removeRight ? (float?) 0.0 : null,
bottom: removeBottom ? (float?) 0.0 : null
),
viewPadding: viewPadding.copyWith(
left: removeLeft ? (float?)Mathf.Max(0.0f, viewPadding.left - padding.left) : null,
top: removeTop ? (float?)Mathf.Max(0.0f, viewPadding.top - padding.top) : null,
right: removeRight ? (float?)Mathf.Max(0.0f, viewPadding.right - padding.right) : null,
bottom: removeBottom ? (float?)Mathf.Max(0.0f, viewPadding.bottom - padding.bottom) : null
highContrast: highContrast,
disableAnimations: disableAnimations,
invertColors: invertColors,
accessibleNavigation: accessibleNavigation,

right: removeRight ? (float?) 0.0 : null,
bottom: removeBottom ? (float?) 0.0 : null
),
viewPadding: viewPadding.copyWith(
left: removeLeft ? (float?)Mathf.Max(0.0f, viewPadding.left - viewInsets.left) : null,
top: removeTop ? (float?)Mathf.Max(0.0f, viewPadding.top - viewInsets.top) : null,
right: removeRight ? (float?)Mathf.Max(0.0f, viewPadding.right - viewInsets.right) : null,
bottom: removeBottom ? (float?)Mathf.Max(0.0f, viewPadding.bottom - viewInsets.bottom) : null
),
highContrast: highContrast,
disableAnimations: disableAnimations,
invertColors: invertColors,
accessibleNavigation: accessibleNavigation,
boldText: boldText
);
}
public MediaQueryData removeViewPadding(
bool removeLeft = false,
bool removeTop = false,
bool removeRight = false,
bool removeBottom = false
) {
if (!(removeLeft || removeTop || removeRight || removeBottom))
return this;
return new MediaQueryData(
size: size,
devicePixelRatio: devicePixelRatio,
textScaleFactor: textScaleFactor,
platformBrightness: platformBrightness,
padding: padding.copyWith(
left: removeLeft ?(float?) 0.0 : null,
top: removeTop ? (float?)0.0 : null,
right: removeRight ? (float?)0.0 : null,
bottom: removeBottom ?(float?) 0.0 : null
),
viewInsets: viewInsets,
viewPadding: viewPadding.copyWith(
left: removeLeft ? (float?)0.0 : null,
top: removeTop ? (float?)0.0 : null,
right: removeRight ? (float?)0.0 : null,
bottom: removeBottom ? (float?)0.0 : null
),
alwaysUse24HourFormat: alwaysUse24HourFormat,
highContrast: highContrast,
disableAnimations: disableAnimations,
invertColors: invertColors,
accessibleNavigation: accessibleNavigation,

return true;
}
return Equals(size, other.size) && devicePixelRatio.Equals(other.devicePixelRatio) &&
textScaleFactor.Equals(other.textScaleFactor) &&
Equals(platformBrightness, other.platformBrightness) &&
Equals(viewInsets, other.viewInsets) &&
Equals(padding, other.padding) &&
alwaysUse24HourFormat == other.alwaysUse24HourFormat &&
accessibleNavigation == other.accessibleNavigation && invertColors == other.invertColors &&
disableAnimations == other.disableAnimations && boldText == other.boldText;
return other is MediaQueryData
&& Equals(size, other.size)
&& devicePixelRatio.Equals(other.devicePixelRatio)
&& textScaleFactor.Equals(other.textScaleFactor)
&& Equals(platformBrightness, other.platformBrightness)
&& Equals(padding, other.padding)
&& Equals(viewPadding, other.viewPadding)
&& Equals(viewInsets, other.viewInsets)
&& physicalDepth == other.physicalDepth
&& alwaysUse24HourFormat == other.alwaysUse24HourFormat
&& highContrast == other.highContrast
&& accessibleNavigation == other.accessibleNavigation
&& invertColors == other.invertColors
&& disableAnimations == other.disableAnimations
&& boldText == other.boldText;
}
public override bool Equals(object obj) {

hashCode = (hashCode * 397) ^ textScaleFactor.GetHashCode();
hashCode = (hashCode * 397) ^ platformBrightness.GetHashCode();
hashCode = (hashCode * 397) ^ (viewInsets != null ? viewInsets.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (viewPadding != null ? viewPadding.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ physicalDepth.GetHashCode() ;
hashCode = (hashCode * 397) ^ highContrast.GetHashCode() ;
hashCode = (hashCode * 397) ^ accessibleNavigation.GetHashCode();
hashCode = (hashCode * 397) ^ invertColors.GetHashCode();
hashCode = (hashCode * 397) ^ disableAnimations.GetHashCode();

$"platformBrightness: {platformBrightness}, " +
$"padding: {padding}, " +
$"viewInsets: {viewInsets}, " +
$"viewPadding: {viewPadding}, " +
$"physicalDepth: {physicalDepth}, " +
$"highContrast: {highContrast}, " +
$"disableAnimations: {disableAnimations}" +
$"invertColors: {invertColors}" +
$"boldText: {boldText}" +

child: child
);
}
public static MediaQuery removeViewPadding(
Key key = null,
BuildContext context = null,
bool removeLeft = false,
bool removeTop = false,
bool removeRight = false,
bool removeBottom = false,
Widget child = null
) {
return new MediaQuery(
key: key,
data: MediaQuery.of(context).removeViewPadding(
removeLeft: removeLeft,
removeTop: removeTop,
removeRight: removeRight,
removeBottom: removeBottom
),
child: child
);
}
MediaQuery query = (MediaQuery) context.inheritFromWidgetOfExactType(typeof(MediaQuery));
MediaQuery query = context.dependOnInheritedWidgetOfExactType<MediaQuery>();
//MediaQuery query = (MediaQuery) context.inheritFromWidgetOfExactType(typeof(MediaQuery));
if (query != null) {
return query.data;
}

2
com.unity.uiwidgets/Runtime/widgets/modal_barrier.cs


return new GestureDetector(
onTapDown: details => {
if (dismissible) {
Navigator.maybePop(context);
Navigator.maybePop<object>(context);
}
},
behavior: HitTestBehavior.opaque,

230
com.unity.uiwidgets/Runtime/widgets/navigator.cs


public delegate Route<T> RouteBuilder<T>(BuildContext context, RouteSettings settings);
public delegate List<Route<object>> RouteListFactory(NavigatorState navigator, string initialRoute);
public delegate List<Route> RouteListFactory(NavigatorState navigator, string initialRoute);
//public delegate bool RoutePredicate(Route<object> route);
//public delegate bool RoutePredicate(Route route);
public delegate bool PopPageCallback(Route<object> route, object result);
public delegate bool PopPageCallback(Route route, object result);
public delegate Future<bool> WillPopCallback();

}
}
public List<OverlayEntry> overlayEntries {
public virtual List<OverlayEntry> overlayEntries {
get { return new List<OverlayEntry>(); }
}

TickerFuture.complete().then(_ => { navigator.focusScopeNode.requestFocus(); });
}
protected internal virtual void didReplace(Route oldRoute) {
}
public virtual Future<RoutePopDisposition> willPop() {
/// async

public virtual object currentResult {
get { return null; }
}
internal readonly Completer _popCompleter = Completer.create();
protected internal virtual void didComplete(object result) {
protected internal virtual void didComplete(object result ) {
internal readonly Completer _popCompleter = Completer.create();
protected internal virtual void didReplace(Route oldRoute) {
}
protected internal virtual void didPopNext(Route nextRoute) {
}

_RouteEntry routeEntry = null;
foreach (var historyEntry in _navigator._history) {
if (_RouteEntry.isRoutePredicate(this)(historyEntry)) {
//Route<object>
//Route
routeEntry = historyEntry;
break;
}

}
public class Route<T> : Route {
readonly Route _route;
public Route(Route route) {
_route = route;
public Route(RouteSettings settings = null) {
_settings = settings ?? new RouteSettings();
public T currentResult {
get { return default(T); }
}
public Future<T> popped {
get { return _popCompleter.future.to<T>(); }
}
protected internal virtual bool didPop(T result) {
didComplete(result);
return true;
}
protected internal void didComplete(T result ) {
if (default(T) == null) {
_popCompleter.complete(FutureOr.value(currentResult));
}
else {
_popCompleter.complete(FutureOr.value(result));
}
}
}
public class RouteSettings {

public abstract class RouteTransitionRecord {
public Route<object> route;
public Route route;
public bool isEntering;

return Navigator.of(context).pushAndRemoveUntil<T>(newRoute, predicate);
}
public static void replace<T>(BuildContext context, Route<object> oldRoute, Route<T> newRoute ) {
public static void replace<T>(BuildContext context, Route oldRoute, Route<T> newRoute ) {
public static void replaceRouteBelow<T>(BuildContext context, Route<object> anchorRoute, Route<T> newRoute ) {
public static void replaceRouteBelow<T>(BuildContext context, Route anchorRoute, Route<T> newRoute ) {
Navigator.of(context).replaceRouteBelow<T>(anchorRoute: anchorRoute, newRoute: newRoute);
}

}
public static Future<bool> maybePop<T>(BuildContext context, T result ) {
public static Future<bool> maybePop<T>(BuildContext context, T result = default(T)) {
/*public static Future<bool> maybePop(BuildContext context, object result = null) {
return Navigator.of(context).maybePop(result);
}*/
public static void pop<T>(BuildContext context, T result ) {
Navigator.of(context).pop<T>(result);

Navigator.of(context).popUntil(predicate);
}
public static void removeRoute(BuildContext context, Route<object> route) {
public static void removeRoute(BuildContext context, Route route) {
public static void removeRouteBelow(BuildContext context, Route<object> anchorRoute) {
public static void removeRouteBelow(BuildContext context, Route anchorRoute) {
Navigator.of(context).removeRouteBelow(anchorRoute);
}
/*public static void replace(BuildContext context, Route oldRoute = null, Route newRoute = null) {

return navigator;
}
public static List<Route<object>> defaultGenerateInitialRoutes(NavigatorState navigator, string initialRouteName) {
List<Route<object>> result = new List<Route<object>>();
public static List<Route> defaultGenerateInitialRoutes(NavigatorState navigator, string initialRouteName) {
List<Route> result = new List<Route>();
if (initialRouteName.StartsWith("/") && initialRouteName.Length > 1) {
initialRouteName = initialRouteName.Substring(1); // strip leading "/"
D.assert(Navigator.defaultRouteName == "/");

public class _RouteEntry : RouteTransitionRecord {
public _RouteEntry(
Route<object> route,
Route route,
_RouteLifecycle initialState
) {

currentState = initialState;
}
public Route<object> route;
public Route route;
public Route<object> lastAnnouncedPreviousRoute; // last argument to Route.didChangePrevious
public Route<object> lastAnnouncedPoppedNextRoute; // last argument to Route.didPopNext
public Route<object> lastAnnouncedNextRoute; // last argument to Route.didChangeNext
public Route lastAnnouncedPreviousRoute; // last argument to Route.didChangePrevious
public Route lastAnnouncedPoppedNextRoute; // last argument to Route.didPopNext
public Route lastAnnouncedNextRoute; // last argument to Route.didChangeNext
public bool hasPage {
get { return route.settings is Page<object>; }

currentState = _RouteLifecycle.adding;
}
public void handlePush(NavigatorState navigator, bool isNewFirst, Route<object> previous = null,
Route<object> previousPresent = null) {
public void handlePush(NavigatorState navigator, bool isNewFirst, Route previous = null,
Route previousPresent = null) {
D.assert(currentState == _RouteLifecycle.push || currentState == _RouteLifecycle.pushReplace ||
currentState == _RouteLifecycle.replace);
D.assert(navigator != null);

}
}
public void handleDidPopNext(Route<object> poppedRoute) {
public void handleDidPopNext(Route poppedRoute) {
public void handlePop(NavigatorState navigator, Route<object> previousPresent) {
public void handlePop(NavigatorState navigator, Route previousPresent) {
D.assert(navigator != null);
D.assert(navigator._debugLocked);
D.assert(route._navigator == navigator);

}
public void handleRemoval(NavigatorState navigator, Route<object> previousPresent) {
public void handleRemoval(NavigatorState navigator, Route previousPresent) {
D.assert(navigator != null);
D.assert(navigator._debugLocked);
D.assert(route._navigator == navigator);

public bool doingPop = false;
public void didAdd(NavigatorState navigator, bool isNewFirst, Route<object> previous, Route<object> previousPresent) {
public void didAdd(NavigatorState navigator, bool isNewFirst, Route previous, Route previousPresent) {
route.didAdd();
currentState = _RouteLifecycle.idle;
if (isNewFirst) {

}
public bool shouldAnnounceChangeToNext(Route<object> nextRoute) {
public bool shouldAnnounceChangeToNext(Route nextRoute) {
D.assert(nextRoute != lastAnnouncedNextRoute);
return !(
nextRoute == null &&

public readonly static _RouteEntryPredicate willBePresentPredicate = (_RouteEntry entry) => entry.willBePresent;
public static _RouteEntryPredicate isRoutePredicate(Route<object> route) {
public static _RouteEntryPredicate isRoutePredicate(Route route) {
return (_RouteEntry entry) => entry.route == route;
}

}
if (initialRoute != null) {
foreach (Route<object> route in
foreach (Route route in
(widget.onGenerateInitialRoutes(this, widget.initialRoute
?? Navigator.defaultRouteName))) {
_history.Add(

});
foreach (NavigatorObserver observer in widget.observers)
observer._navigator = null;
focusScopeNode.dispose();/// focus manager
focusScopeNode.detach();/// focus manager dispose
foreach (_RouteEntry entry in _history)
entry.dispose();
base.dispose();

get { return _overlayKey.currentState; }
}
public IEnumerable<OverlayEntry> _allRouteOverlayEntries { ///sync
public List<OverlayEntry> _allRouteOverlayEntries { ///sync
List<OverlayEntry> entries = new List<OverlayEntry>();
List<OverlayEntry> overlayEntries = new List<OverlayEntry>();
yield* entry.route.overlayEntries;
//entries.Add(historyEntry.route.overlayEntries);
/*foreach (var overlayEntry in historyEntry.route.overlayEntries) {
entries.Add(overlayEntry);
//yield* entry.route.overlayEntries;
/*foreach (var historyOverlayEntry in historyEntry.route.overlayEntries) {
yield return historyOverlayEntry;
overlayEntries.AddRange(historyEntry.route.overlayEntries);
return entries;
return overlayEntries;
}
}

bool
canRemoveOrAdd =
false; // Whether there is a fully opaque route on top to silently remove or add route underneath.
Route<object> poppedRoute = null; // The route that should trigger didPopNext on the top active route.
Route poppedRoute = null; // The route that should trigger didPopNext on the top active route.
bool seenTopActiveRoute = false; // Whether we"ve seen the route that would get didPopNext.
List<_RouteEntry> toBeDisposed = new List<_RouteEntry>();
while (index >= 0) {

lastEntry = historyEntry;
}
}
String routeName = lastEntry?.route?.settings?.name;
string routeName = lastEntry?.route?.settings?.name;
RouteNotificationMessages.maybeNotifyRouteChange(routeName, _lastAnnouncedRouteName);
//RouteNotificationMessages.maybeNotifyRouteChange(routeName, _lastAnnouncedRouteName);
_lastAnnouncedRouteName = routeName;
}

) {
return pushAndRemoveUntil<T>(_routeNamed<T>(newRouteName, arguments: arguments), predicate);
}
public Future push(Route route) {
D.assert(!_debugLocked);
D.assert(() => {
_debugLocked = true;
return true;
});
D.assert(route != null);
D.assert(route._navigator == null);
_history.Add(new _RouteEntry(route, initialState: _RouteLifecycle.push));
_flushHistoryUpdates();
D.assert(() => {
_debugLocked = false;
return true;
});
_afterNavigation(route);
return route.popped;
}
public Future<T> push<T>(Route<T> route) {
D.assert(!_debugLocked);

return route.popped.to<T>();
}
void _afterNavigation<T>(Route<T> route) {
void _afterNavigation(Route route) {
/*if (!kReleaseMode) {
Dictionary<string, object> routeJsonable = new Dictionary<string, object>();
if (route != null) {

return newRoute.popped.to<T>();
}
public void replace<T>(Route<object> oldRoute, Route<T> newRoute) {
public void replace<T>(Route oldRoute, Route<T> newRoute) {
D.assert(!_debugLocked);
D.assert(oldRoute != null);
D.assert(newRoute != null);

_afterNavigation(newRoute);
}
public void replaceRouteBelow<T>(Route<object> anchorRoute, Route<T> newRoute) {
public void replaceRouteBelow<T>(Route anchorRoute, Route<T> newRoute) {
D.assert(!_debugLocked);
D.assert(() => {
_debugLocked = true;

return true; // there"s at least two routes, so we can pop
}
public Future<bool> maybePop<T>(T result = default) {
public Future<bool> maybePop<T>(T result = default(T)) {
var popResult = false;
_RouteEntry lastEntry = null; //_history.Where(_RouteEntry.isPresentPredicate);
foreach (_RouteEntry routeEntry in _history) {
if (_RouteEntry.isPresentPredicate(routeEntry)) {

if (lastEntry == null) {
popResult = false;
return false;
}
RoutePopDisposition disposition = lastEntry.route.willPop(); // this is asynchronous // await
D.assert(disposition != null);
if (!mounted)
return true; // forget about this pop, we were disposed in the meantime
_RouteEntry newLastEntry = null;
// this is asynchronous // await
return lastEntry.route.willPop().then_(disposition => {
if (lastEntry == null) {
return false;
}
D.assert(disposition != null);
if (!mounted)
return true; // forget about this pop, we were disposed in the meantime
_RouteEntry newLastEntry = null;
foreach (_RouteEntry history in _history) {
if (_RouteEntry.isPresentPredicate(history)) {
newLastEntry = history;
}
}
foreach (_RouteEntry history in _history) {
if (_RouteEntry.isPresentPredicate(history)) {
newLastEntry = history;
}
}
if (lastEntry != newLastEntry)
return true; // forget about this pop, something happened to our history in the meantime
switch (disposition) {
case RoutePopDisposition.bubble:
return false;
case RoutePopDisposition.pop:
pop(result);
return true;
case RoutePopDisposition.doNotPop:
return true;
}
if (lastEntry != newLastEntry)
return true; // forget about this pop, something happened to our history in the meantime
switch (disposition) {
case RoutePopDisposition.bubble:
return false;
case RoutePopDisposition.pop:
pop(result);
return true;
case RoutePopDisposition.doNotPop:
return true;
}
return false;
return null;
}).to<bool>();
}
public void pop<T>(T result = default) {

_debugLocked = false;
return true;
});
_afterNavigation<object>(entry.route);
_afterNavigation(entry.route);
}

}
}
public void removeRoute(Route<object> route) {
public void removeRoute(Route route) {
D.assert(route != null);
D.assert(!_debugLocked);
D.assert(() => {

}
}
_afterNavigation<object>(
_afterNavigation(
lastEntry?.route
);
}

public void removeRouteBelow(Route<object> anchorRoute) {
public void removeRouteBelow(Route anchorRoute) {
D.assert(!_debugLocked);
D.assert(() => {
_debugLocked = true;

});
}
public void finalizeRoute(Route<object> route) {
public void finalizeRoute(Route route) {
bool wasDebugLocked;
D.assert(() => {

}
public ValueNotifier<bool> userGestureInProgressNotifier = new ValueNotifier<bool>(false);
ValueNotifier<bool> userGestureInProgressNotifier = new ValueNotifier<bool>(false);
void didStartUserGesture() {
public void didStartUserGesture() {
_userGesturesInProgress += 1;
if (_userGesturesInProgress == 1) {
int routeIndex = _getIndexBefore(

D.assert(routeIndex != null);
Route<object> route = _history[routeIndex].route;
Route<object> previousRoute = null;
Route route = _history[routeIndex].route;
Route previousRoute = null;
previousRoute = _getRouteBefore(
previousRoute = (Route) _getRouteBefore(
routeIndex - 1,
_RouteEntry.willBePresentPredicate
).route;

}
}
void didStopUserGesture() {
public void didStopUserGesture() {
D.assert(_userGesturesInProgress > 0);
_userGesturesInProgress -= 1;
if (_userGesturesInProgress == 0) {

2
com.unity.uiwidgets/Runtime/widgets/preferred_size.cs


Size preferredSize { get; }
}
public abstract class PreferredSizeWidget : Widget{ //StatefulWidget, SizePreferred {
public abstract class PreferredSizeWidget : StatefulWidget{//Widget{ //StatefulWidget, SizePreferred {
protected PreferredSizeWidget(Key key = null) : base(key: key) {
}

483
com.unity.uiwidgets/Runtime/widgets/routes.cs


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;

public OverlayRoute(
RouteSettings settings = null
) : base(settings) {
) : base(settings : settings) {
}
public override List<OverlayEntry> overlayEntries {
get { return _overlayEntries; }

public abstract ICollection<OverlayEntry> createOverlayEntries();
protected internal override void install(OverlayEntry insertionPoint) {
protected internal override void install(){//(OverlayEntry insertionPoint) {
navigator.overlay?.insertAll(_overlayEntries, above: insertionPoint);
base.install(insertionPoint);
}
navigator.overlay?.insertAll(_overlayEntries);
base.install();
}
protected internal override bool didPop(object result) {
var returnValue = base.didPop(result);
D.assert(returnValue);

public Future completed {
get { return _transitionCompleter.future; }
}
public TimeSpan reverseTransitionDuration {
get { return transitionDuration; }
}
public virtual bool opaque { get; }

public virtual Animation<float> animation {
get { return _animation; }
}
public virtual Animation<float> secondaryAnimation {
get { return _secondaryAnimation; }
}
readonly ProxyAnimation _secondaryAnimation = new ProxyAnimation(Animations.kAlwaysDismissedAnimation);
D.assert(duration >= TimeSpan.Zero);
TimeSpan reverseDuration = reverseTransitionDuration;
D.assert(duration >= TimeSpan.Zero && duration != null);
//reverseDuration: reverseDuration, /// todo
debugLabel: debugLabel,
vsync: navigator
);

if (overlayEntries.isNotEmpty()) {
overlayEntries.first().opaque = opaque;
}
case AnimationStatus.forward:
case AnimationStatus.reverse:
if (overlayEntries.isNotEmpty()) {

break;
case AnimationStatus.dismissed:
// We might still be an active route if a subclass is controlling the
// the transition and hits the dismissed status. For example, the iOS
// back gesture drives this animation to the dismissed status before
// popping the navigator.
if (!isActive) {
navigator.finalizeRoute(this);
D.assert(overlayEntries.isEmpty());

changedInternalState();
}
public virtual Animation<float> secondaryAnimation {
get { return _secondaryAnimation; }
}
readonly ProxyAnimation _secondaryAnimation = new ProxyAnimation(Animations.kAlwaysDismissedAnimation);
protected internal override void install(OverlayEntry insertionPoint) {
protected internal override void install() {
base.install(insertionPoint);
base.install();
}
protected internal override TickerFuture didPush() {

_animation.addStatusListener(_handleStatusChanged);
//_animation.addStatusListener(_handleStatusChanged);
//return _controller.forward();
_didPushOrReplace();
base.didPush();
protected internal override void didAdd() {
D.assert(_controller != null,
() => $"{GetType()}.didPush called before calling install() or after calling dispose().");
D.assert(!_transitionCompleter.isCompleted, () => $"Cannot reuse a {GetType()} after disposing it.");
_didPushOrReplace();
base.didAdd();
_controller.setValue(_controller.upperBound); //_controller.upperBound;
}
if (oldRoute is TransitionRoute route) {
_controller.setValue(route._controller.value);
if (oldRoute is TransitionRoute) {
_controller.setValue(((TransitionRoute)oldRoute)._controller.value);
public void _didPushOrReplace() {
_animation.addStatusListener(_handleStatusChanged);
if (_animation.isCompleted && overlayEntries.isNotEmpty()) {
overlayEntries[0].opaque = opaque;
}
}
protected internal override bool didPop(object result) {
D.assert(_controller != null,
() => $"{GetType()}.didPop called before calling install() or after calling dispose().");

_updateSecondaryAnimation(nextRoute);
base.didChangeNext(nextRoute);
}
VoidCallback _trainHoppingListenerRemover;
VoidCallback previousTrainHoppingListenerRemover = _trainHoppingListenerRemover;
_trainHoppingListenerRemover = null;
if (current is TrainHoppingAnimation) {
TrainHoppingAnimation newAnimation = null;
newAnimation = new TrainHoppingAnimation(
((TrainHoppingAnimation) current).currentTrain,
((TransitionRoute) nextRoute)._animation,
onSwitchedTrain: () => {
D.assert(_secondaryAnimation.parent == newAnimation);
D.assert(newAnimation.currentTrain == ((TransitionRoute) nextRoute)._animation);
_secondaryAnimation.parent = newAnimation.currentTrain;
newAnimation.dispose();
Animation<float> currentTrain = current is TrainHoppingAnimation ? ((TrainHoppingAnimation)current).currentTrain : current;
Animation<float> nextTrain = ((TransitionRoute)nextRoute)._animation;
if (
currentTrain.value == nextTrain.value ||
nextTrain.status == AnimationStatus.completed ||
nextTrain.status == AnimationStatus.dismissed
) {
_setSecondaryAnimation(nextTrain, ((TransitionRoute)nextRoute).completed);
} else {
TrainHoppingAnimation newAnimation = null;
void _jumpOnAnimationEnd(AnimationStatus status) {
switch (status) {
case AnimationStatus.completed:
case AnimationStatus.dismissed:
_setSecondaryAnimation(nextTrain, ((TransitionRoute)nextRoute).completed);
if (_trainHoppingListenerRemover != null) {
_trainHoppingListenerRemover();
_trainHoppingListenerRemover = null;
);
_secondaryAnimation.parent = newAnimation;
((TrainHoppingAnimation) current).dispose();
}
else {
_secondaryAnimation.parent =
new TrainHoppingAnimation(current, ((TransitionRoute) nextRoute)._animation);
break;
case AnimationStatus.forward:
case AnimationStatus.reverse:
break;
}
}
_trainHoppingListenerRemover = ()=> {
nextTrain.removeStatusListener(_jumpOnAnimationEnd);
newAnimation?.dispose();
};
nextTrain.addStatusListener(_jumpOnAnimationEnd);
newAnimation = new TrainHoppingAnimation(
currentTrain,
nextTrain,
onSwitchedTrain: ()=> {
D.assert(_secondaryAnimation.parent == newAnimation);
D.assert(newAnimation.currentTrain == ((TransitionRoute)nextRoute)._animation);
_setSecondaryAnimation(newAnimation.currentTrain, ((TransitionRoute)nextRoute).completed);
if (_trainHoppingListenerRemover != null) {
_trainHoppingListenerRemover();
_trainHoppingListenerRemover = null;
}
}
);
_setSecondaryAnimation(newAnimation, ((TransitionRoute)nextRoute).completed);
}
else {
_secondaryAnimation.parent = ((TransitionRoute) nextRoute)._animation;
} else {
_setSecondaryAnimation(((TransitionRoute)nextRoute)._animation, ((TransitionRoute)nextRoute).completed);
} else {
_setSecondaryAnimation(Animations.kAlwaysDismissedAnimation);
else {
_secondaryAnimation.parent = Animations.kAlwaysDismissedAnimation;
if (previousTrainHoppingListenerRemover != null) {
previousTrainHoppingListenerRemover();
public void _setSecondaryAnimation(Animation<float> animation, Future disposed = null) {
_secondaryAnimation.parent = animation;
disposed?.then(( _) =>{
if (_secondaryAnimation.parent == animation) {
_secondaryAnimation.parent = Animations.kAlwaysDismissedAnimation;
if (animation is TrainHoppingAnimation) {
((TrainHoppingAnimation)animation).dispose();
}
}
});
}
public virtual bool canTransitionTo(TransitionRoute nextRoute) {
return true;

onRemove?.Invoke();
}
}
public interface LocalHistoryRoute {
void addLocalHistoryEntry(LocalHistoryEntry entry);
void removeLocalHistoryEntry(LocalHistoryEntry entry);

entry._owner = null;
entry._notifyRemoved();
if (_localHistory.isEmpty()) {
changedInternalState();
//changedInternalState();
if (SchedulerBinding.instance.schedulerPhase == SchedulerPhase.persistentCallbacks) {
SchedulerBinding.instance.addPostFrameCallback((TimeSpan timestamp) =>{
changedInternalState();
});
} else {
changedInternalState();
}
//async
if (willHandlePopInternally) {
return Future<RoutePopDisposition>.value(RoutePopDisposition.pop).to<RoutePopDisposition>();
}

public class _ModalScopeStatus : InheritedWidget {
public _ModalScopeStatus(Key key = null, bool isCurrent = false,
bool canPop = false, Route route = null, Widget child = null) : base(key: key, child: child) {
public _ModalScopeStatus(
Key key = null,
bool isCurrent = false,
bool canPop = false,
Route route = null,
Widget child = null)
: base(key: key, child: child) {
D.assert(route != null);
D.assert(child != null);

}
}
public class _ModalScope<T> : StatefulWidget {
public _ModalScope(Key key = null, ModalRoute<T> route = null) : base(key) {
public class _ModalScope : StatefulWidget {
public _ModalScope(
Key key = null,
ModalRoute route = null)
: base(key) {
public readonly ModalRoute<T> route;
public readonly ModalRoute route;
public override State createState() {
return new _ModalScopeState();
}
}
public class _ModalScope<T> : _ModalScope {
public _ModalScope(
Key key = null,
ModalRoute<T> route = null)
: base(key) {
this.route = route;
}
public readonly new ModalRoute<T> route;
public class _ModalScopeState<T> : State<_ModalScope<T>> {
public class _ModalScopeState : State<_ModalScope> {
//public readonly FocusScopeNode focusScopeNode = new FocusScopeNode(debugLabel: "$_ModalScopeState Focus Scope");
public readonly FocusScopeNode focusScopeNode = new FocusScopeNode();//debugLabel: "$_ModalScopeState Focus Scope");
public override void initState() {
base.initState();
var animations = new List<Listenable> { };

if (widget.route.secondaryAnimation != null) {
animations.Add(widget.route.secondaryAnimation);
}
if (widget.route.isCurrent) {
widget.route.navigator.focusScopeNode.setFirstFocus(focusScopeNode);
}
D.assert(widget.route == ((_ModalScope<T>) oldWidget).route);
/*if (widget.route.isCurrent) {
D.assert(widget.route == ((_ModalScope) oldWidget).route);
if (widget.route.isCurrent) {
}*/
}
}
public override void didChangeDependencies() {

internal void _forceRebuildPage() {
setState(() => { _page = null; });
}
public override void dispose() {
focusScopeNode.detach();//todo : dispose
base.dispose();
}
bool _shouldIgnoreFocusRequest {
get {
return widget.route.animation?.status == AnimationStatus.reverse ||
(widget.route.navigator?.userGestureInProgress ?? false);
}
}
if (widget.route.isCurrent && !_shouldIgnoreFocusRequest) {
widget.route.navigator.focusScopeNode.setFirstFocus(focusScopeNode);
}
setState(fn);
}

_context,
widget.route.animation,
widget.route.secondaryAnimation,
new IgnorePointer(
new AnimatedBuilder(
animation: widget.route.navigator?.userGestureInProgressNotifier ?? new ValueNotifier<bool>(false),
builder: (BuildContext context1, Widget child1) =>{
bool ignoreEvents = _shouldIgnoreFocusRequest;
//focusScopeNode.canRequestFocus = !ignoreEvents; // todo
return new IgnorePointer(
ignoring: ignoreEvents,
child: child1
);
},
child: child
)
/*new IgnorePointer(
)
)*/
),
child: _page
)

}
}
public abstract class ModalRoute<T> : LocalHistoryRouteTransitionRoute {
protected ModalRoute() {
public class _ModalScopeState<T> : _ModalScopeState {
public override void didUpdateWidget(StatefulWidget oldWidget) {
base.didUpdateWidget(oldWidget);
D.assert(widget.route == ((_ModalScope<T>) oldWidget).route);
if (widget.route.isCurrent) {
widget.route.navigator.focusScopeNode.setFirstFocus(focusScopeNode);
}
}
protected ModalRoute(RouteSettings settings) : base(settings) {
public abstract class ModalRoute : LocalHistoryRouteTransitionRoute {
protected ModalRoute(
RouteSettings settings = null,
ImageFilter filter = null
) : base(settings) {
_filter = filter;
public ImageFilter _filter;
public static ModalRoute<T> of(BuildContext context) {
_ModalScopeStatus widget =
(_ModalScopeStatus) context.inheritFromWidgetOfExactType(typeof(_ModalScopeStatus));
return (ModalRoute<T>) widget?.route;
public static ModalRoute of(BuildContext context) {
//_ModalScopeStatus widget = (_ModalScopeStatus) context.inheritFromWidgetOfExactType(typeof(_ModalScopeStatus));
//return (ModalRoute<T>) widget?.route;
_ModalScopeStatus widget = context.dependOnInheritedWidgetOfExactType<_ModalScopeStatus>();
return widget?.route as ModalRoute;
}
protected virtual void setState(VoidCallback fn) {

public readonly FocusScopeNode focusScopeNode = new FocusScopeNode();
protected internal override void install(OverlayEntry insertionPoint) {
base.install(insertionPoint);
protected internal override void install() {
base.install();
navigator.focusScopeNode.setFirstFocus(focusScopeNode);
if (_scopeKey.currentState != null) {
navigator.focusScopeNode.setFirstFocus(_scopeKey.currentState.focusScopeNode);
}
protected internal override void didAdd() {
if (_scopeKey.currentState != null) {
navigator.focusScopeNode.setFirstFocus(_scopeKey.currentState.focusScopeNode);
}
base.didAdd();
}
protected internal override void dispose() {
focusScopeNode.detach();
base.dispose();

public virtual bool semanticsDismissible {
get { return true; }
}
public virtual string barrierLabel { get; }
public virtual Curve barrierCurve {
get { return Curves.ease;}
}
public virtual bool maintainState { get; }
public bool offstage {

public override Animation<float> animation {
get { return _animationProxy; }
}
readonly List<WillPopCallback> _willPopCallbacks = new List<WillPopCallback>();
public readonly List<WillPopCallback> _willPopCallbacks = new List<WillPopCallback>();
_ModalScopeState<T> scope = _scopeKey.currentState as _ModalScopeState<T> ;
//async
_ModalScopeState scope = _scopeKey.currentState as _ModalScopeState ;
D.assert(scope != null);
bool result = false;

}
return base.willPop();
// var callbacks = new List<WillPopCallback>(_willPopCallbacks);
// Promise<RoutePopDisposition> result = new Promise<RoutePopDisposition>();
// Action<int> fn = null;
// fn = (int index) => {
// if (index < callbacks.Count) {
// callbacks[index]().Then((pop) => {
// if (!pop) {
// result.Resolve(RoutePopDisposition.doNotPop);
// }
// else {
// fn(index + 1);
// }
// });
// }
// else {
// base.willPop().Then((pop) => result.Resolve(pop));
// }
// };
// fn(0);
// return result;
}
public void addScopedWillPopCallback(WillPopCallback callback) {

protected internal override void changedExternalState() {
base.changedExternalState();
_scopeKey.currentState?._forceRebuildPage();
//_scopeKey.currentState?._forceRebuildPage();
if (_scopeKey.currentState != null)
_scopeKey.currentState._forceRebuildPage();
}
public bool canPop {

readonly GlobalKey<_ModalScopeState<T>> _scopeKey = new LabeledGlobalKey<_ModalScopeState<T>>();
internal readonly GlobalKey _subtreeKey = new LabeledGlobalKey<T>();
public readonly GlobalKey<_ModalScopeState> _scopeKey = new LabeledGlobalKey<_ModalScopeState>();
internal readonly GlobalKey _subtreeKey = GlobalKey.key();
static readonly Animatable<float> _easeCurveTween = new CurveTween(curve: Curves.ease);
//static readonly Animatable<float> _easeCurveTween = new CurveTween(curve: Curves.ease);
OverlayEntry _modalBarrier;
Widget _buildModalBarrier(BuildContext context) {

D.assert(barrierColor != _kTransparent);
Animation<Color> color =
new ColorTween(
animation.drive(new ColorTween(
).chain(_easeCurveTween).animate(animation);
).chain(new CurveTween(curve: barrierCurve)));//.animate(animation);
//,semanticsLabel: barrierLabel, // changedInternalState is called if barrierLabel updates
//barrierSemanticsDismissible: semanticsDismissible
//semanticsLabel: barrierLabel, // changedInternalState is called if barrierLabel updates
//barrierSemanticsDismissible: semanticsDismissible,
);
}
if (_filter != null) {
barrier = new BackdropFilter(
filter: _filter,
child: barrier
return new IgnorePointer(
ignoring: animation.status == AnimationStatus.reverse ||
animation.status == AnimationStatus.dismissed,

Widget _modalScopeCache;
public Widget _modalScopeCache;
Widget _buildModalScope(BuildContext context) {
return _modalScopeCache = _modalScopeCache ?? new _ModalScope<T>(
public virtual Widget _buildModalScope(BuildContext context) {
return _modalScopeCache = _modalScopeCache ?? new _ModalScope(
key: _scopeKey,
route: this
// _ModalScope calls buildTransitions() and buildChild(), defined above

return $"{GetType()}({settings}, animation: {_animation})";
}
}
public abstract class ModalRoute<T> : ModalRoute {
public abstract class PopupRoute<T> : ModalRoute<T> {
public ModalRoute(
RouteSettings settings = null,
ImageFilter filter = null
) : base(settings) {
_filter = filter;
}
public static ModalRoute<T> of<T>(BuildContext context) {
_ModalScopeStatus widget = context.dependOnInheritedWidgetOfExactType<_ModalScopeStatus>();
return widget?.route as ModalRoute<T>;
}
public new GlobalKey<_ModalScopeState<T>> _scopeKey = new LabeledGlobalKey<_ModalScopeState<T>>();
public override Future<RoutePopDisposition> willPop() {
//async
_ModalScopeState<T> scope = _scopeKey.currentState as _ModalScopeState<T> ;
D.assert(scope != null);
bool result = false;
foreach (WillPopCallback callback in _willPopCallbacks) {
callback.Invoke().then(v => result = !(bool)v);
if (result) {
return Future<RoutePopDisposition>.value(RoutePopDisposition.doNotPop).to<RoutePopDisposition>();
}
}
return base.willPop();
}
public override Widget _buildModalScope(BuildContext context) {
return _modalScopeCache = _modalScopeCache ?? new _ModalScope<T>(
key: _scopeKey,
route: this
// _ModalScope calls buildTransitions() and buildChild(), defined above
);
}
}
public abstract class PopupRoute : ModalRoute {
RouteSettings settings = null
) : base(settings: settings) {
RouteSettings settings = null,
ImageFilter filter = null
) : base(settings: settings,filter:filter) {
}
public override bool opaque {

get { return true; }
}
}
public class RouteObserve<R> : NavigatorObserver where R : Route {
readonly Dictionary<R, HashSet<RouteAware>> _listeners = new Dictionary<R, HashSet<RouteAware>>();

}
}
var subscribers = _listeners.getOrDefault((R) route);
var subscribers =_listeners.getOrDefault((R) route);
/* foreach (var key in _listeners.Keys) {
subscribers.Add(_listeners[key].ToList());
}*/
if (subscribers != null) {
foreach (RouteAware routeAware in subscribers) {
routeAware.didPop();

void didPushNext();
}
class _DialogRoute<T> : PopupRoute<T> {
internal _DialogRoute(RoutePageBuilder pageBuilder = null, bool barrierDismissible = true,
class _DialogRoute : PopupRoute {
internal _DialogRoute(
RoutePageBuilder pageBuilder = null,
bool barrierDismissible = true,
string barrierLabel = null,
RouteSettings setting = null) : base(settings: setting) {
RouteSettings settings = null
) : base(settings: settings) {
D.assert(barrierDismissible != null);
this.barrierDismissible = barrierDismissible;
this.barrierColor = barrierColor ?? new Color(0x80000000);
this.transitionDuration = transitionDuration ?? TimeSpan.FromMilliseconds(200);
_barrierLabel = barrierLabel;
_barrierDismissible = barrierDismissible;
_barrierColor = barrierColor ?? new Color(0x80000000);
_transitionDuration = transitionDuration ?? TimeSpan.FromMilliseconds(200);
public override bool barrierDismissible { get; }
public override bool barrierDismissible {
get { return _barrierDismissible; }
}
public readonly bool _barrierDismissible;
public override Color barrierColor { get; }
public override string barrierLabel {
get { return _barrierLabel;}
}
public readonly string _barrierLabel;
public override TimeSpan transitionDuration { get; }
public override Color barrierColor {
get { return _barrierColor; }
}
public readonly Color _barrierColor;
public override TimeSpan transitionDuration {
get { return _transitionDuration; }
}
public readonly TimeSpan _transitionDuration;
public override Widget buildPage(BuildContext context, Animation<float> animation,
public override Widget buildPage(
BuildContext context,
Animation<float> animation,
//TODO SEMANTICS
public override Widget buildTransitions(BuildContext context, Animation<float> animation,
Animation<float> secondaryAnimation, Widget child) {
public override Widget buildTransitions(
BuildContext context,
Animation<float> animation,
Animation<float> secondaryAnimation,
Widget child) {
if (_transitionBuilder == null) {
return new FadeTransition(
opacity: new CurvedAnimation(

BuildContext context = null,
RoutePageBuilder pageBuilder = null,
bool barrierDismissible = false,
string barrierLabel = null,
RouteTransitionsBuilder transitionBuilder = null
RouteTransitionsBuilder transitionBuilder = null,
bool useRootNavigator = true,
RouteSettings routeSettings = null
return Navigator.of(context, rootNavigator: true).push<T>(new _DialogRoute(
return Navigator.of(context, rootNavigator: true).push<T>(
new _DialogRoute(
barrierLabel: barrierLabel,
transitionBuilder: transitionBuilder
)); //.to<object>();
transitionBuilder: transitionBuilder,
settings: routeSettings) as Route<T>
); //.to<object>();
}
}

6
com.unity.uiwidgets/Runtime/widgets/widget_inspector.cs


public class WidgetInspector : StatefulWidget {
public readonly Widget child;
public WidgetInspector(Key key, Widget child, InspectorSelectButtonBuilder selectButtonBuilder) : base(key) {
public WidgetInspector(
Key key,
Widget child,
InspectorSelectButtonBuilder selectButtonBuilder
) : base(key) {
D.assert(child != null);
this.child = child;
this.selectButtonBuilder = selectButtonBuilder;

117
com.unity.uiwidgets/Runtime/animation/tween_sequence.cs


using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using Unity.UIWidgets.scheduler2;
using System;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;
using Rect = Unity.UIWidgets.ui.Rect;
using Transform = Unity.UIWidgets.widgets.Transform;
namespace Unity.UIWidgets.animation {
class TweenSequence<T> : Animatable<T> {
public TweenSequence(List<TweenSequenceItem<T>> items) {
D.assert(items != null);
D.assert(items.isNotEmpty);
foreach (var item in items) {
_items.Add(item);
}
//_items.addAll(items);
float totalWeight = 0.0f;
foreach (TweenSequenceItem<T> item in _items)
totalWeight += item.weight;
D.assert(totalWeight > 0.0f);
float start = 0.0f;
for (int i = 0; i < _items.Count; i += 1) {
float end = i == _items.Count - 1 ? 1.0f : start + _items[i].weight / totalWeight;
_intervals.Add(new _Interval(start, end));
start = end;
}
}
public readonly List<TweenSequenceItem<T>> _items = new List<TweenSequenceItem<T>>();
public readonly List<_Interval> _intervals = new List<_Interval>();
public T _evaluateAt(float t, int index) {
TweenSequenceItem<T> element = _items[index];
float tInterval = _intervals[index].value(t);
return element.tween.transform(tInterval);
}
public override T transform(float t) {
D.assert(t >= 0.0 && t <= 1.0);
if (t == 1.0)
return _evaluateAt(t, _items.Count - 1);
for (int index = 0; index < _items.Count; index++) {
if (_intervals[index].contains(t))
return _evaluateAt(t, index);
}
D.assert(false, ()=>"TweenSequence.evaluate() could not find an interval for $t");
return default(T);
}
public override string ToString(){
return $"TweenSequence({_items.Count} items)";
}
}
class FlippedTweenSequence : TweenSequence<float> {
FlippedTweenSequence(List<TweenSequenceItem<float>> items)
: base(items) {
D.assert(items != null);
}
public override float transform(float t) => 1 - base.transform(1 - t);
}
class TweenSequenceItem<T> {
public TweenSequenceItem(
Animatable<T> tween = null,
float weight = 0.0f
) {
this.tween = tween;
this.weight = weight;
D.assert(tween != null);
D.assert(weight != null);
D.assert(weight > 0.0);
}
public readonly Animatable<T> tween;
public readonly float weight;
}
public class _Interval {
public _Interval(float start, float end) {
this.start = start;
this.end = end;
D.assert(end > start);
}
public readonly float start;
public readonly float end;
public bool contains(float t) {
return t >= start && t < end;
}
public float value(float t) {
return (t - start) / (end - start);
}
public override string ToString() {
return $"<{start}," + $" {end}>";
}
}
}

11
com.unity.uiwidgets/Runtime/animation/tween_sequence.cs.meta


fileFormatVersion: 2
guid: be2249b4f0c57714f98826849a6532ba
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

38
com.unity.uiwidgets/Runtime/widgets/route_notification_messages.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using UnityEngine;
namespace Unity.UIWidgets.widgets {
class RouteNotificationMessages {
public RouteNotificationMessages() {
}
/// When the engine is Web notify the platform for a route change.
/*public static void maybeNotifyRouteChange(string routeName, string previousRouteName) {
if(kIsWeb) {
_notifyRouteChange(routeName, previousRouteName);
} else {
// No op.
}
}*/
/*public static void _notifyRouteChange(string routeName, string previousRouteName) {
SystemChannels.navigation.invokeMethod<void>(
'routeUpdated',
<string, dynamic>{
'previousRouteName': previousRouteName,
'routeName': routeName,
},
);
}*/
}
}

11
com.unity.uiwidgets/Runtime/widgets/route_notification_messages.cs.meta


fileFormatVersion: 2
guid: ac1cab99f5369e943b27cdc6c354055c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

31
com.unity.uiwidgets/Runtime/widgets/spacer.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;
using UnityEngine;
using Brightness = Unity.UIWidgets.ui.Brightness;
namespace Unity.UIWidgets.widgets {
public class Spacer : StatelessWidget {
public Spacer(
Key key = null,
int flex = 1)
: base(key: key) {
this.flex = flex;
D.assert(flex != null);
D.assert(flex > 0);
}
public readonly int flex;
public override Widget build(BuildContext context) {
return new Expanded(
flex: flex,
child: SizedBox.shrink()
);
}
}
}

11
com.unity.uiwidgets/Runtime/widgets/spacer.cs.meta


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