浏览代码

temporary before mixin

/siyaoH-1.17-PlatformMessage
Shiyun Wen 4 年前
当前提交
52d80fd9
共有 25 个文件被更改,包括 1085 次插入628 次删除
  1. 145
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsExample.cs
  2. 4
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_navigation_demo.cs
  3. 8
      com.unity.uiwidgets/Runtime/cupertino/app.cs
  4. 2
      com.unity.uiwidgets/Runtime/cupertino/bottom_tab_bar.cs
  5. 4
      com.unity.uiwidgets/Runtime/cupertino/button.cs
  6. 248
      com.unity.uiwidgets/Runtime/cupertino/colors.cs
  7. 3
      com.unity.uiwidgets/Runtime/cupertino/context_menu.cs
  8. 4
      com.unity.uiwidgets/Runtime/cupertino/dialog.cs
  9. 2
      com.unity.uiwidgets/Runtime/cupertino/route.cs
  10. 208
      com.unity.uiwidgets/Runtime/cupertino/tab_scaffold.cs
  11. 402
      com.unity.uiwidgets/Runtime/cupertino/text_selection.cs
  12. 98
      com.unity.uiwidgets/Runtime/cupertino/text_theme.cs
  13. 177
      com.unity.uiwidgets/Runtime/cupertino/theme.cs
  14. 3
      com.unity.uiwidgets/Runtime/rendering/object.mixin.gen.cs
  15. 22
      com.unity.uiwidgets/Runtime/rendering/sliver_multi_box_adaptor.cs
  16. 2
      com.unity.uiwidgets/Runtime/ui2/painting.cs
  17. 30
      com.unity.uiwidgets/Runtime/widgets/app.cs
  18. 25
      com.unity.uiwidgets/Runtime/widgets/automatic_keep_alive.cs
  19. 48
      com.unity.uiwidgets/Runtime/widgets/framework.cs
  20. 3
      com.unity.uiwidgets/Runtime/widgets/heroes.cs
  21. 77
      com.unity.uiwidgets/Runtime/widgets/media_query.cs
  22. 126
      com.unity.uiwidgets/Runtime/widgets/navigator.cs
  23. 40
      com.unity.uiwidgets/Runtime/widgets/overlay.cs
  24. 13
      com.unity.uiwidgets/Runtime/widgets/routes.cs
  25. 19
      com.unity.uiwidgets/Runtime/widgets/sliver.cs

145
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsExample.cs


new CupertinoPageRoute(builder: (contex3) =>
{
return
new CupertinoTextFieldDemo();
new CupertinoAlertDemo();
})
);
}

middle: (index == 0) ? new Text("views") : new Text("articles")
),
child: new Center(
/*child: new Text(
"THIS IS TAB #" + index,
style: CupertinoTheme.of(contex1)
.textTheme
.navTitleTextStyle
//.copyWith(fontSize:32)
)*/
child: new CupertinoButton(
child: new Text(
"THIS IS TAB #",

new CupertinoPageRoute(builder: (contex3) =>
{
return
new DetailScreen1(index == 0 ? "views" : "articles");
new CupertinoAlertDemo(); //DetailScreen1(index == 0 ? "views" : "articles");
})
);
}

}
}
public class DetailScreen : StatefulWidget
{
public DetailScreen(string topic)
{
this.topic = topic;
}
public string topic;
public override State createState()
{
return new DetailScreenState();
}
}
public class DetailScreenState : State<DetailScreen>
{
public bool switchValue = false;
private float frame = 0;
public override Widget build(BuildContext context)
{
return new Container(
color: Colors.green,
child: new Column(
children: new List<Widget>
{
AnimatedLottie.file("wine.json", frame: frame, curve: Curves.linear),
new Container(
width: 100,
height: 100,
decoration: new BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(8))
),
child: Image.file("test.gif", gaplessPlayback: true)
),
new Container(
width: 200,
height: 100,
decoration: new BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(8))
),
child: Image.network(
"https://unity-cn-cms-prd-1254078910.cos.ap-shanghai.myqcloud.com/assetstore-cms-media/img-7dfe215f-0075-4f9c-9b5a-be5ee88b866b",
gaplessPlayback: true)
),
new Text("Counter: " + counter,
style: new TextStyle(fontSize: 18, fontWeight: FontWeight.w100)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "racher", fontSize: 18, fontWeight: FontWeight.w100)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "roboto", fontSize: 18, fontWeight: FontWeight.w200)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "roboto", fontSize: 18, fontWeight: FontWeight.w300)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "roboto", fontSize: 18, fontWeight: FontWeight.w400)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "roboto", fontSize: 18, fontWeight: FontWeight.w500)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "roboto", fontSize: 18, fontWeight: FontWeight.w600)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "roboto", fontSize: 18, fontWeight: FontWeight.w700)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "roboto", fontSize: 18, fontWeight: FontWeight.w800)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "roboto", fontSize: 18, fontWeight: FontWeight.w900)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "roboto", fontSize: 18, fontWeight: FontWeight.w900,
fontStyle: FontStyle.italic)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "roboto", fontSize: 18, fontWeight: FontWeight.w100)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "roboto", fontSize: 18, fontWeight: FontWeight.w900)),
new Text("-----"),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "robotox", fontSize: 18, fontWeight: FontWeight.w200)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "robotox", fontSize: 18, fontWeight: FontWeight.w300)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "robotox", fontSize: 18, fontWeight: FontWeight.w400)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "robotox", fontSize: 18, fontWeight: FontWeight.w500)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "robotox", fontSize: 18, fontWeight: FontWeight.w600)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "robotox", fontSize: 18, fontWeight: FontWeight.w700)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "robotox", fontSize: 18, fontWeight: FontWeight.w800)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "robotox", fontSize: 18, fontWeight: FontWeight.w900)),
new Text("Counter: " + counter + (char) 0xf472 + (char) 0xf442 + (char) 0xf43b,
style: new TextStyle(fontFamily: "robotox", fontSize: 18, fontWeight: FontWeight.w900,
fontStyle: FontStyle.italic)),
new Text("Counter: " + counter + (char) 0xf472 + (char) 0xf442 + (char) 0xf43b,
style: new TextStyle(fontFamily: "CupertinoIcons", fontSize: 18)),
new GestureDetector(
onTap: () =>
{
setState(() =>
{
counter++;
frame += 1;
});
},
child: new Container(
padding: EdgeInsets.symmetric(20, 20),
color: counter % 2 == 0 ? Colors.blue : Colors.red,
child: new Text("Click Me",
style: new TextStyle(fontFamily: "racher", fontWeight: FontWeight.w100))
)
)
}
)
/*,
navigationBar: new CupertinoNavigationBar(
middle: new Text("hello world")
)*/
);
}
}
}

4
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_navigation_demo.cs


return new CupertinoButton(
padding: EdgeInsets.zero,
child: new Text("Exit"),
onPressed: () => { Navigator.of(context, rootNavigator: true).pop(); }
onPressed: () => { Navigator.of(context, rootNavigator: true).pop<object>(); }
);
}
}

new Padding(padding: EdgeInsets.only(top: 18.0f)),
CupertinoButton.filled(
child: new Text("Sign in"),
onPressed: () => { Navigator.pop(context); }
onPressed: () => { Navigator.pop<object>(context); }
),
}
)

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


//Dictionary<LogicalKeySet, Intent> shortcuts = null,
//Dictionary<LocalKey, ActionFactory> actions = null
) : base(key: key) {
D.assert(routes != null);
D.assert(navigatorObservers != null);
//D.assert(routes != null);
//D.assert(navigatorObservers != null);
D.assert(title != null);
D.assert(showPerformanceOverlay != null);
D.assert(checkerboardRasterCacheImages != null);

builder: widget.builder,
title: widget.title,
onGenerateTitle: widget.onGenerateTitle,
textStyle: CupertinoTheme.of(context).textTheme.textStyle,
color: CupertinoDynamicColor.resolve(widget.color ?? effectiveThemeData.primaryColor, context),
textStyle: CupertinoTheme.of(context1).textTheme.textStyle,
color: CupertinoDynamicColor.resolve(widget.color ?? effectiveThemeData.primaryColor, context1),
locale: widget.locale,
localizationsDelegates: _localizationsDelegates,
localeResolutionCallback: widget.localeResolutionCallback,

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


}
public bool opaque(BuildContext context) {
return CupertinoDynamicColor.resolve(backgroundColor, context).alpha == 0xFF;
}

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


VoidCallback onPressed = null
) : base(key: key) {
D.assert((pressedOpacity >= 0.0 && pressedOpacity <= 1.0) || pressedOpacity == null );
D.assert(disabledColor != null);
//D.assert(disabledColor != null);
_filled = false;
this.child = child;
this.onPressed = onPressed;

BorderRadius borderRadius = null,
VoidCallback onPressed = null
) {
disabledColor = disabledColor ?? CupertinoColors.quaternarySystemFill;
D.assert(pressedOpacity >= 0.0 && pressedOpacity <= 1.0);
D.assert(disabledColor != null);

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


using Unity.UIWidgets.painting;
namespace Unity.UIWidgets.cupertino {
public class CupertinoColors {
public static CupertinoDynamicColor activeBlue = systemBlue;
public static CupertinoDynamicColor activeGreen = systemGreen;
public static CupertinoDynamicColor activeOrange = systemOrange;
public static readonly CupertinoDynamicColor activeBlue = systemBlue;
public static readonly CupertinoDynamicColor activeGreen = systemGreen;
public static readonly CupertinoDynamicColor activeOrange = systemOrange;
public static Color white = new Color(0xFFFFFFFF);
public static Color black = new Color(0xFF000000);

public static CupertinoDynamicColor inactiveGray = CupertinoDynamicColor.withBrightness(
public static readonly CupertinoDynamicColor inactiveGray = CupertinoDynamicColor.withBrightness(
public static CupertinoDynamicColor destructiveRed = systemRed;
public static readonly CupertinoDynamicColor destructiveRed = systemRed;
public static CupertinoDynamicColor systemBlue = CupertinoDynamicColor.withBrightnessAndContrast(
public static readonly CupertinoDynamicColor systemBlue = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemBlue",
color: Color.fromARGB(255, 0, 122, 255),
darkColor: Color.fromARGB(255, 10, 132, 255),

public static CupertinoDynamicColor systemGreen = CupertinoDynamicColor.withBrightnessAndContrast(
public static readonly CupertinoDynamicColor systemGreen = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemGreen",
color: Color.fromARGB(255, 52, 199, 89),
darkColor: Color.fromARGB(255, 48, 209, 88),

public static CupertinoDynamicColor systemIndigo = CupertinoDynamicColor.withBrightnessAndContrast(
public static readonly CupertinoDynamicColor systemIndigo = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemIndigo",
color: Color.fromARGB(255, 88, 86, 214),
darkColor: Color.fromARGB(255, 94, 92, 230),

public static CupertinoDynamicColor systemOrange = CupertinoDynamicColor.withBrightnessAndContrast(
public static readonly CupertinoDynamicColor systemOrange = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemOrange",
color: Color.fromARGB(255, 255, 149, 0),
darkColor: Color.fromARGB(255, 255, 159, 10),

public static CupertinoDynamicColor systemPink = CupertinoDynamicColor.withBrightnessAndContrast(
public static readonly CupertinoDynamicColor systemPink = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemPink",
color: Color.fromARGB(255, 255, 45, 85),
darkColor: Color.fromARGB(255, 255, 55, 95),

public static CupertinoDynamicColor systemPurple = CupertinoDynamicColor.withBrightnessAndContrast(
public static readonly CupertinoDynamicColor systemPurple = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemPurple",
color: Color.fromARGB(255, 175, 82, 222),
darkColor: Color.fromARGB(255, 191, 90, 242),

public static CupertinoDynamicColor systemRed = CupertinoDynamicColor.withBrightnessAndContrast(
public static readonly CupertinoDynamicColor systemRed = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemRed",
color: Color.fromARGB(255, 255, 59, 48),
darkColor: Color.fromARGB(255, 255, 69, 58),

public static CupertinoDynamicColor systemTeal = CupertinoDynamicColor.withBrightnessAndContrast(
public static readonly CupertinoDynamicColor systemTeal = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemTeal",
color: Color.fromARGB(255, 90, 200, 250),
darkColor: Color.fromARGB(255, 100, 210, 255),

public static CupertinoDynamicColor systemYellow = CupertinoDynamicColor.withBrightnessAndContrast(
public static readonly CupertinoDynamicColor systemYellow = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemYellow",
color: Color.fromARGB(255, 255, 204, 0),
darkColor: Color.fromARGB(255, 255, 214, 10),

public static CupertinoDynamicColor systemGrey = CupertinoDynamicColor.withBrightnessAndContrast(
public static readonly CupertinoDynamicColor systemGrey = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemGrey",
color: Color.fromARGB(255, 142, 142, 147),
darkColor: Color.fromARGB(255, 142, 142, 147),

public static CupertinoDynamicColor systemGrey2 = CupertinoDynamicColor.withBrightnessAndContrast(
public static readonly CupertinoDynamicColor systemGrey2 = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemGrey2",
color: Color.fromARGB(255, 174, 174, 178),
darkColor: Color.fromARGB(255, 99, 99, 102),

public static CupertinoDynamicColor systemGrey3 = CupertinoDynamicColor.withBrightnessAndContrast(
public static readonly CupertinoDynamicColor systemGrey3 = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemGrey3",
color: Color.fromARGB(255, 199, 199, 204),
darkColor: Color.fromARGB(255, 72, 72, 74),

public static CupertinoDynamicColor systemGrey4 = CupertinoDynamicColor.withBrightnessAndContrast(
public static readonly CupertinoDynamicColor systemGrey4 = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemGrey4",
color: Color.fromARGB(255, 209, 209, 214),
darkColor: Color.fromARGB(255, 58, 58, 60),

public static CupertinoDynamicColor systemGrey5 = CupertinoDynamicColor.withBrightnessAndContrast(
public static readonly CupertinoDynamicColor systemGrey5 = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemGrey5",
color: Color.fromARGB(255, 229, 229, 234),
darkColor: Color.fromARGB(255, 44, 44, 46),

public static CupertinoDynamicColor systemGrey6 = CupertinoDynamicColor.withBrightnessAndContrast(
public static readonly CupertinoDynamicColor systemGrey6 = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: "systemGrey6",
color: Color.fromARGB(255, 242, 242, 247),
darkColor: Color.fromARGB(255, 28, 28, 30),

public static CupertinoDynamicColor label = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor label = new CupertinoDynamicColor(
//effectiveColor:Color.fromARGB(255, 0, 0, 0),
color: Color.fromARGB(255, 0, 0, 0),
darkColor: Color.fromARGB(255, 255, 255, 255),
highContrastColor: Color.fromARGB(255, 0, 0, 0),

darkHighContrastElevatedColor: Color.fromARGB(255, 255, 255, 255)
);
public static CupertinoDynamicColor secondaryLabel = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor secondaryLabel = new CupertinoDynamicColor(
//effectiveColor:Color.fromARGB(153, 60, 60, 67),
color: Color.fromARGB(153, 60, 60, 67),
darkColor: Color.fromARGB(153, 235, 235, 245),
highContrastColor: Color.fromARGB(173, 60, 60, 67),

/// The color for text labels containing tertiary content, equivalent to
/// [UIColor.tertiaryLabel](https://developer.apple.com/documentation/uikit/uicolor/3173153-tertiarylabel).
public static CupertinoDynamicColor tertiaryLabel = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor tertiaryLabel = new CupertinoDynamicColor(
//effectiveColor: Color.fromARGB(76, 60, 60, 67),
color: Color.fromARGB(76, 60, 60, 67),
darkColor: Color.fromARGB(76, 235, 235, 245),
highContrastColor: Color.fromARGB(96, 60, 60, 67),

darkHighContrastElevatedColor: Color.fromARGB(96, 235, 235, 245)
);
public static CupertinoDynamicColor quaternaryLabel = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor quaternaryLabel = new CupertinoDynamicColor(
//effectiveColor:Color.fromARGB(45, 60, 60, 67),
color: Color.fromARGB(45, 60, 60, 67),
darkColor: Color.fromARGB(40, 235, 235, 245),
highContrastColor: Color.fromARGB(66, 60, 60, 67),

darkHighContrastElevatedColor: Color.fromARGB(61, 235, 235, 245)
);
public static CupertinoDynamicColor systemFill = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor systemFill = new CupertinoDynamicColor(
//effectiveColor:Color.fromARGB(51, 120, 120, 128),
color: Color.fromARGB(51, 120, 120, 128),
darkColor: Color.fromARGB(91, 120, 120, 128),
highContrastColor: Color.fromARGB(71, 120, 120, 128),

darkHighContrastElevatedColor: Color.fromARGB(112, 120, 120, 128)
);
public static CupertinoDynamicColor secondarySystemFill = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor secondarySystemFill = new CupertinoDynamicColor(
//effectiveColor: Color.fromARGB(40, 120, 120, 128),
color: Color.fromARGB(40, 120, 120, 128),
darkColor: Color.fromARGB(81, 120, 120, 128),
highContrastColor: Color.fromARGB(61, 120, 120, 128),

darkHighContrastElevatedColor: Color.fromARGB(102, 120, 120, 128)
);
public static CupertinoDynamicColor tertiarySystemFill = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor tertiarySystemFill = new CupertinoDynamicColor(
//effectiveColor:Color.fromARGB(30, 118, 118, 128),
color: Color.fromARGB(30, 118, 118, 128),
darkColor: Color.fromARGB(61, 118, 118, 128),
highContrastColor: Color.fromARGB(51, 118, 118, 128),

darkHighContrastElevatedColor: Color.fromARGB(81, 118, 118, 128)
);
public static CupertinoDynamicColor quaternarySystemFill = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor quaternarySystemFill = new CupertinoDynamicColor(
//effectiveColor:Color.fromARGB(20, 116, 116, 128),
color: Color.fromARGB(20, 116, 116, 128),
darkColor: Color.fromARGB(45, 118, 118, 128),
highContrastColor: Color.fromARGB(40, 116, 116, 128),

/// The color for placeholder text in controls or text views, equivalent to
/// [UIColor.placeholderText](https://developer.apple.com/documentation/uikit/uicolor/3173134-placeholdertext).
public static CupertinoDynamicColor placeholderText = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor placeholderText = new CupertinoDynamicColor(
//effectiveColor:Color.fromARGB(76, 60, 60, 67),
color: Color.fromARGB(76, 60, 60, 67),
darkColor: Color.fromARGB(76, 235, 235, 245),
highContrastColor: Color.fromARGB(96, 60, 60, 67),

darkHighContrastElevatedColor: Color.fromARGB(96, 235, 235, 245)
);
public static CupertinoDynamicColor systemBackground = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor systemBackground = new CupertinoDynamicColor(
//effectiveColor:Color.fromARGB(255, 255, 255, 255),
color: Color.fromARGB(255, 255, 255, 255),
darkColor: Color.fromARGB(255, 0, 0, 0),
highContrastColor: Color.fromARGB(255, 255, 255, 255),

darkHighContrastElevatedColor: Color.fromARGB(255, 36, 36, 38)
);
public static CupertinoDynamicColor secondarySystemBackground = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor secondarySystemBackground = new CupertinoDynamicColor(
//effectiveColor:Color.fromARGB(255, 242, 242, 247),
color: Color.fromARGB(255, 242, 242, 247),
darkColor: Color.fromARGB(255, 28, 28, 30),
highContrastColor: Color.fromARGB(255, 235, 235, 240),

darkHighContrastElevatedColor: Color.fromARGB(255, 54, 54, 56)
);
public static CupertinoDynamicColor tertiarySystemBackground = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor tertiarySystemBackground = new CupertinoDynamicColor(
//effectiveColor:Color.fromARGB(255, 255, 255, 255),
color: Color.fromARGB(255, 255, 255, 255),
darkColor: Color.fromARGB(255, 44, 44, 46),
highContrastColor: Color.fromARGB(255, 255, 255, 255),

darkHighContrastElevatedColor: Color.fromARGB(255, 68, 68, 70)
);
public static CupertinoDynamicColor systemGroupedBackground = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor systemGroupedBackground = new CupertinoDynamicColor(
//effectiveColor:Color.fromARGB(255, 242, 242, 247),
color: Color.fromARGB(255, 242, 242, 247),
darkColor: Color.fromARGB(255, 0, 0, 0),
highContrastColor: Color.fromARGB(255, 235, 235, 240),

darkHighContrastElevatedColor: Color.fromARGB(255, 36, 36, 38)
);
public static CupertinoDynamicColor secondarySystemGroupedBackground = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor secondarySystemGroupedBackground = new CupertinoDynamicColor(
//effectiveColor:Color.fromARGB(255, 255, 255, 255),
color: Color.fromARGB(255, 255, 255, 255),
darkColor: Color.fromARGB(255, 28, 28, 30),
highContrastColor: Color.fromARGB(255, 255, 255, 255),

darkHighContrastElevatedColor: Color.fromARGB(255, 54, 54, 56)
);
public static CupertinoDynamicColor tertiarySystemGroupedBackground = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor tertiarySystemGroupedBackground = new CupertinoDynamicColor(
//effectiveColor:Color.fromARGB(255, 242, 242, 247),
color: Color.fromARGB(255, 242, 242, 247),
darkColor: Color.fromARGB(255, 44, 44, 46),
highContrastColor: Color.fromARGB(255, 235, 235, 240),

darkHighContrastElevatedColor: Color.fromARGB(255, 68, 68, 70)
);
public static CupertinoDynamicColor separator = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor separator = new CupertinoDynamicColor(
//effectiveColor:Color.fromARGB(73, 60, 60, 67),
color: Color.fromARGB(73, 60, 60, 67),
darkColor: Color.fromARGB(153, 84, 84, 88),
highContrastColor: Color.fromARGB(94, 60, 60, 67),

/// The color for borders or divider lines that hide any underlying content,
/// equivalent to [UIColor.opaqueSeparator](https://developer.apple.com/documentation/uikit/uicolor/3173133-opaqueseparator).
public static CupertinoDynamicColor opaqueSeparator = new CupertinoDynamicColor(
public static readonly CupertinoDynamicColor opaqueSeparator = new CupertinoDynamicColor(
//effectiveColor:Color.fromARGB(255, 198, 198, 200),
color: Color.fromARGB(255, 198, 198, 200),
darkColor: Color.fromARGB(255, 56, 56, 58),
highContrastColor: Color.fromARGB(255, 198, 198, 200),

darkHighContrastElevatedColor: Color.fromARGB(255, 56, 56, 58)
);
public static CupertinoDynamicColor link =
public static readonly CupertinoDynamicColor link =
//effectiveColor:Color.fromARGB(255, 0, 122, 255),
color: Color.fromARGB(255, 0, 122, 255),
darkColor: Color.fromARGB(255, 9, 132, 255),
highContrastColor: Color.fromARGB(255, 0, 122, 255),

);
}
public class CupertinoDynamicColor : Color,Diagnosticable {
public class CupertinoDynamicColor : Color { //, Diagnosticable {
Color effectiveColor = null,
Color color = null,
Color darkColor = null,
Color highContrastColor = null,

Color highContrastElevatedColor = null,
Color darkHighContrastElevatedColor = null
) : base(0) {
/// ._
D.assert(color != null);
D.assert(darkColor != null);
D.assert(highContrastColor != null);
D.assert(darkHighContrastColor != null);
D.assert(elevatedColor != null);
D.assert(darkElevatedColor != null);
D.assert(highContrastElevatedColor != null);
D.assert(darkHighContrastElevatedColor != null);
D.assert(_effectiveColor != null);
_effectiveColor = color;
Color darkHighContrastElevatedColor = null,
Element debugResolveContext = null
): base(0)
{
D.assert(color != null,()=>"color8 == null");
D.assert(darkColor != null,()=>"color7 == null");
D.assert(highContrastColor != null,()=>"color6 == null");
D.assert(darkHighContrastColor != null,()=>"color5 == null");
D.assert(elevatedColor != null,()=>"color4 == null");
D.assert(darkElevatedColor != null,()=>"color3 == null");
D.assert(highContrastElevatedColor != null,()=>"color2 == null");
D.assert(darkHighContrastElevatedColor != null,()=>"color1 == null");
//D.assert(effectiveColor != null);
_effectiveColor = effectiveColor ?? color;
this.color = color;
this.darkColor = darkColor;
this.highContrastColor = highContrastColor;

this.highContrastElevatedColor = highContrastElevatedColor;
this.darkHighContrastElevatedColor = darkHighContrastElevatedColor;
_debugResolveContext = null;
_debugResolveContext = debugResolveContext;
base.value = _effectiveColor.value;
//base(_effectiveColor.value);
public static CupertinoDynamicColor create(
Color _effectiveColor,
Color color,
Color darkColor ,
Color highContrastColor ,
Color darkHighContrastColor ,
Color elevatedColor ,
Color darkElevatedColor ,
Color highContrastElevatedColor ,
Color darkHighContrastElevatedColor ,
Element _debugResolveContext ,
string _debugLabel
) {
var dynamicColor = new CupertinoDynamicColor(
debugLabel: _debugLabel,
color: color,
darkColor: darkColor,
highContrastColor: color,
darkHighContrastColor: darkColor,
elevatedColor: color,
darkElevatedColor: darkColor,
highContrastElevatedColor: color,
darkHighContrastElevatedColor: darkColor
);
dynamicColor._effectiveColor = _effectiveColor;
dynamicColor._debugResolveContext = _debugResolveContext;
return dynamicColor;
}
string debugLabel = null,
Color color = null,
Color darkColor = null,
Color highContrastColor = null,
Color darkHighContrastColor = null
string debugLabel ,
Color color ,
Color darkColor ,
Color highContrastColor ,
Color darkHighContrastColor
return new CupertinoDynamicColor(
debugLabel: debugLabel,
color: color,

elevatedColor: color,
darkElevatedColor: darkColor,
highContrastElevatedColor: highContrastColor,
darkHighContrastElevatedColor: darkHighContrastColor
darkHighContrastElevatedColor: darkHighContrastColor,
debugResolveContext: null
);
}

elevatedColor: color,
darkElevatedColor: darkColor,
highContrastElevatedColor: color,
darkHighContrastElevatedColor: darkColor);
darkHighContrastElevatedColor: darkColor,
debugResolveContext: null
);
public Color _effectiveColor;
public int value {
get { return (int) _effectiveColor.value; }
public readonly Color _effectiveColor;
public uint value {
get {
return _effectiveColor.value;
}
public Element _debugResolveContext;
public readonly Element _debugResolveContext;
public readonly Color color;
public readonly Color darkColor;

if (resolvable == null)
return null;
D.assert(context != null);
return (resolvable is CupertinoDynamicColor)
? ((CupertinoDynamicColor) resolvable).resolveFrom(context, nullOk: nullOk)
var resolveColor = (resolvable is CupertinoDynamicColor)
? ((CupertinoDynamicColor)resolvable).resolveFrom(context, nullOk: nullOk)
return resolveColor;
}
public bool _isPlatformBrightnessDependent {

}
public CupertinoDynamicColor resolveFrom(BuildContext context, bool nullOk = true) {
Brightness brightness = _isPlatformBrightnessDependent
? CupertinoTheme.brightnessOf(context, nullOk: nullOk) ?? Brightness.light
Brightness brightness = _isPlatformBrightnessDependent
? CupertinoTheme.brightnessOf(context, nullOk: nullOk) ?? Brightness.light
CupertinoUserInterfaceLevelData? CupertinoUserInterfacelevel =
CupertinoUserInterfaceLevel.of(context, nullOk: nullOk);
? CupertinoUserInterfacelevel ?? CupertinoUserInterfaceLevelData.baselayer
? CupertinoUserInterfaceLevel.of(context, nullOk: nullOk) ?? CupertinoUserInterfaceLevelData.baselayer
: CupertinoUserInterfaceLevelData.baselayer;
Color resolved = null;

return true;
}
);
return create(
resolved,
color,
darkColor,
highContrastColor,
darkHighContrastColor,
elevatedColor,
darkElevatedColor,
highContrastElevatedColor,
darkHighContrastElevatedColor,
_debugContext,
_debugLabel
);
return new CupertinoDynamicColor(
debugLabel: _debugLabel,
effectiveColor: resolved,
color: color,
darkColor: darkColor,
highContrastColor: highContrastColor,
darkHighContrastColor: darkHighContrastColor,
elevatedColor: color,
darkElevatedColor: darkColor,
highContrastElevatedColor: highContrastColor,
darkHighContrastElevatedColor: darkHighContrastColor,
debugResolveContext: null
);
}
public bool Equals(CupertinoDynamicColor other) {

return true;
}
return Equals(value, other.value) && Equals(darkColor, other.darkColor) &&
Equals(highContrastColor, other.highContrastColor)
return Equals(value, other.value)
&& Equals(color, other.color)
&& Equals(darkColor, other.darkColor)
&& Equals(highContrastColor, other.highContrastColor)
&& Equals(darkHighContrastColor, other.darkHighContrastColor)
&& Equals(elevatedColor, other.elevatedColor)
&& Equals(darkElevatedColor, other.darkElevatedColor)

}
public string toString(DiagnosticLevel minLevel = DiagnosticLevel.debug) {
/*string toString(string name, Color color) {
string marker = color == _effectiveColor ? "*" : "";
return marker+ name+" = " + color + marker;
}*/
List<string> xs = new List<string>();
xs.Add(toStringColor("color",color));
if (_isPlatformBrightnessDependent)

public new void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
//base.debugFillProperties(properties);
if (_debugLabel != null)
properties.add(new MessageProperty("debugLabel", _debugLabel));
properties.add(createCupertinoColorProperty("color", color));

return new DiagnosticsProperty<Color>(
name: name,
value: value,
// description: value._debugLabel,
description: ((CupertinoDynamicColor)value)._debugLabel,
showName: showName,
defaultValue: defaultValue,
style: style,

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


public readonly static Animatable< float> _sheetScaleAnimatableReverse = _sheetScaleTween.chain(_curveReverse);
public readonly Tween< float> _opacityTween = new FloatTween(begin: 0.0f, end: 1.0f);
public Animation< float> _sheetOpacity;
//public override string barrierLabel;
public Color barrierColor {
get { return _kModalBarrierColor; }
}

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


);
}
}
class _DialogActionButtonParentDataWidget : ParentDataWidget<_CupertinoDialogActionsRenderWidget> {
//ParentDataWidget<_DialogActionButtonParentData>
class _DialogActionButtonParentDataWidget : ParentDataWidget<_ActionButtonParentData> {
public _DialogActionButtonParentDataWidget(
Widget child,
bool isPressed = false,

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


)
);
}*/
Future showCupertinoModalPopup<T>(
public static Future showCupertinoModalPopup(
BuildContext context = null,
WidgetBuilder builder = null,
ImageFilter filter = null,

208
com.unity.uiwidgets/Runtime/cupertino/tab_scaffold.cs


using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.cupertino {
public class CupertinoTabController : ChangeNotifier {
public CupertinoTabController(int initialIndex = 0) {
_index = initialIndex;
D.assert(initialIndex != null);
D.assert(initialIndex >= 0);
}
public bool _isDisposed = false;
public int index {
get { return _index; }
set {
D.assert(value != null);
D.assert(value >= 0);
if (_index == value) {
return;
}
_index = value;
notifyListeners();
}
}
int _index;
public override void dispose() {
base.dispose();
_isDisposed = true;
}
}
CupertinoTabController controller = null,
D.assert(
controller == null || controller.index < tabBar.items.Count, () =>
"The CupertinoTabController's current index ${controller.index} is " +
"out of bounds for the tab bar with ${tabBar.items.length} tabs"
);
this.controller = controller;
public readonly CupertinoTabController controller;
public readonly CupertinoTabBar tabBar;
public readonly IndexedWidgetBuilder tabBuilder;

class _CupertinoTabScaffoldState : State<CupertinoTabScaffold> {
int _currentPage;
CupertinoTabController _controller;
_currentPage = widget.tabBar.currentIndex;
//_currentPage = widget.tabBar.currentIndex;
_updateTabController();
}
void _updateTabController( bool shouldDisposeOldController = false ) {
CupertinoTabController newController =
// User provided a new controller, update `_controller` with it.
widget.controller
?? new CupertinoTabController(initialIndex: widget.tabBar.currentIndex);
if (newController == _controller) {
return;
}
if (shouldDisposeOldController) {
_controller?.dispose();
} else if (_controller?._isDisposed == false) {
_controller.removeListener(_onCurrentIndexChange);
}
newController.addListener(_onCurrentIndexChange);
_controller = newController;
}
void _onCurrentIndexChange() {
D.assert(
_controller.index >= 0 && _controller.index < widget.tabBar.items.Count,()=>
"The $runtimeType's current index ${_controller.index} is " +
$"out of bounds for the tab bar with {widget.tabBar.items.Count} tabs"
);
setState(()=> {});
if (widget.controller != oldWidget.controller) {
_updateTabController(shouldDisposeOldController: oldWidget.controller == null);
} else if (_controller.index >= widget.tabBar.items.Count) {
_controller.index = widget.tabBar.items.Count - 1;
}
}
/*public override void didUpdateWidget(StatefulWidget _oldWidget) {
CupertinoTabScaffold oldWidget = _oldWidget as CupertinoTabScaffold;
base.didUpdateWidget(oldWidget);
if (_currentPage >= widget.tabBar.items.Count) {
_currentPage = widget.tabBar.items.Count - 1;
D.assert(_currentPage >= 0,

if (widget.tabBar.currentIndex != oldWidget.tabBar.currentIndex) {
_currentPage = widget.tabBar.currentIndex;
}
}
}*/
public override Widget build(BuildContext context) {
List<Widget> stacked = new List<Widget> { };

/*Widget content = new _TabSwitchingView(
currentTabIndex: _currentPage,
tabNumber: widget.tabBar.items.Count,
tabBuilder: widget.tabBuilder
);*/
currentTabIndex: _currentPage,
currentTabIndex: _controller.index,
tabNumber: widget.tabBar.items.Count,
tabBuilder: widget.tabBuilder
);

if (widget.tabBar.opaque(context)) {
contentPadding = EdgeInsets.only(bottom: bottomPadding);
newMediaQuery = newMediaQuery.removePadding(removeBottom: true);
}
else {
newMediaQuery = newMediaQuery.copyWith(

stacked.Add(content);
if (widget.tabBar != null) {
/*if (widget.tabBar != null) {
stacked.Add(new Align(
alignment: Alignment.bottomCenter,
child: widget.tabBar.copyWith(

}
)
));
}
}*/
stacked.Add(
new MediaQuery(
data: existingMediaQuery.copyWith(textScaleFactor: 1),
child: new Align(
alignment: Alignment.bottomCenter,
child: widget.tabBar.copyWith(
currentIndex: _controller.index,
onTap: (int newIndex) =>{
_controller.index = newIndex;
if (widget.tabBar.onTap != null)
widget.tabBar.onTap(newIndex);
}
)
)
)
);
color: widget.backgroundColor ?? CupertinoTheme.of(context).scaffoldBackgroundColor
color: CupertinoDynamicColor.resolve(widget.backgroundColor, context)
?? CupertinoTheme.of(context).scaffoldBackgroundColor
//color: widget.backgroundColor ?? CupertinoTheme.of(context).scaffoldBackgroundColor
),
child: new Stack(
children: stacked

public override void dispose() {
// Only dispose `_controller` when the state instance owns it.
if (widget.controller == null) {
_controller?.dispose();
} else if (_controller?._isDisposed == false) {
_controller.removeListener(_onCurrentIndexChange);
}
base.dispose();
}
}
class _TabSwitchingView : StatefulWidget {

}
class _TabSwitchingViewState : State<_TabSwitchingView> {
List<Widget> tabs;
List<FocusScopeNode> tabFocusNodes;
//List<Widget> tabs;
public readonly List<bool> shouldBuildTab = new List<bool>();
public readonly List<FocusScopeNode> tabFocusNodes = new List<FocusScopeNode>();
public readonly List<FocusScopeNode> discardedNodes = new List<FocusScopeNode>();
tabs = new List<Widget>(widget.tabNumber);
List<bool> tabBool = new List<bool>();
tabs.Add(null);
tabBool.Add(false);
}
foreach (var tab in tabBool) {
shouldBuildTab.Add(tab);
tabFocusNodes = Enumerable.Repeat(new FocusScopeNode(), widget.tabNumber).ToList();
}
public override void didChangeDependencies() {

public override void didUpdateWidget(StatefulWidget _oldWidget) {
_TabSwitchingView oldWidget = _oldWidget as _TabSwitchingView;
base.didUpdateWidget(oldWidget);
int lengthDiff = widget.tabNumber - shouldBuildTab.Count;
if (lengthDiff > 0) {
List<bool> tabBool = new List<bool>();
for (int i = 0; i < lengthDiff; i++) {
tabBool.Add(false);
}
foreach (var tab in tabBool) {
shouldBuildTab.Add(tab);
}
}
else if (lengthDiff < 0) {
for (int i = widget.tabNumber; i < shouldBuildTab.Count; i++) {
shouldBuildTab.RemoveAt(i);
}
;
}
if (tabFocusNodes.Count!= widget.tabNumber) {
if (tabFocusNodes.Count> widget.tabNumber) {
for (int i = widget.tabNumber; i < tabFocusNodes.Count; i++) {
discardedNodes.Add(tabFocusNodes[i]);
}
for (int i = widget.tabNumber; i < tabFocusNodes.Count; i++ ){
tabFocusNodes.RemoveAt(i);
}
}
else {
List<FocusScopeNode> scopeNodes = new List<FocusScopeNode>();
var length = widget.tabNumber - tabFocusNodes.Count;
for (int i = 0; i < length; i++) {
tabFocusNodes.Add(new FocusScopeNode());
}
}
}
foreach (FocusScopeNode focusScopeNode in tabFocusNodes) {
foreach(FocusScopeNode focusScopeNode in tabFocusNodes) {
focusScopeNode.detach();
}

public override Widget build(BuildContext context) {
List<Widget> children = new List<Widget>();
for (int index = 0; index < widget.tabNumber; index++) {
bool active = index == widget.currentTabIndex;
var tabIndex = index;
if (active || tabs[index] != null) {
tabs[index] = widget.tabBuilder(context, tabIndex);
}
children.Add(new Offstage(
List<Widget> stages = new List<Widget>();
int count = widget.tabNumber;
for (int i = 0; i < count; i++) {
bool active = i == widget.currentTabIndex;
shouldBuildTab[i] = active || shouldBuildTab[i];
int temp = i;
stages.Add(new Offstage(
node: tabFocusNodes[index],
child: tabs[index] ?? new Container()
node: tabFocusNodes[i],
child: new Builder(
builder: (BuildContext context1) => {
return shouldBuildTab[temp] ? widget.tabBuilder(context1, temp) : new Container();
}
)
children: children
children:stages
);
}
}

402
com.unity.uiwidgets/Runtime/cupertino/text_selection.cs


namespace Unity.UIWidgets.cupertino {
public static class CupertinoTextSelectionUtils {
//public static readonly TextSelectionControls cupertinoTextSelectionControls = new _CupertinoTextSelectionControls();
public const float _kSelectionHandleOverlap = 1.5f;
public const float _kSelectionHandleRadius = 6;
public const float _kArrowScreenPadding = 26.0f;
public const float _kToolbarContentDistance = 8.0f;
public const float _kToolbarHeight = 36.0f;
public const float _kToolbarHeight = 43.0f;
public static readonly Size _kToolbarArrowSize = new Size(14.0f, 7.0f);
//public static readonly Radius _kToolbarBorderRadius = Radius.circular(8);
public static readonly BorderRadius _kToolbarBorderRadius = BorderRadius.all(Radius.circular(7.5f));
public static readonly Color _kToolbarBackgroundColor = new Color(0xFF2E2E2E);

public static readonly EdgeInsets _kToolbarButtonPadding =
EdgeInsets.symmetric(vertical: 10.0f, horizontal: 18.0f);
public static readonly BorderRadius _kToolbarBorderRadius = BorderRadius.all(Radius.circular(7.5f));
//public static readonly BorderRadius _kToolbarBorderRadius = BorderRadius.all(Radius.circular(7.5f));
letterSpacing: -0.11f,
fontWeight: FontWeight.w300,
letterSpacing: -0.15f,
fontWeight: FontWeight.w400,
/* class CupertinoTextSelectionToolbar : SingleChildRenderObjectWidget {
public CupertinoTextSelectionToolbar(
Key key = null,
float barTopY = 0.0f,
float arrowTipX = 0.0f,
bool isArrowPointingDown = false,
Widget child = null
) : base(key: key, child: child) {
_barTopY = barTopY;
_arrowTipX = arrowTipX;
_isArrowPointingDown = isArrowPointingDown;
}
public readonly float _barTopY;
public readonly float _arrowTipX;
public readonly bool _isArrowPointingDown;
public override RenderObject createRenderObject(BuildContext context) => new _ToolbarRenderBox(_barTopY, _arrowTipX, _isArrowPointingDown, null);
public void updateRenderObject(BuildContext context, _ToolbarRenderBox renderObject) {
renderObject.barTopY = _barTopY;
renderObject.arrowTipX = _arrowTipX;
renderObject.isArrowPointingDown = _isArrowPointingDown;
}
}
class _ToolbarParentData : BoxParentData {
public float arrowXOffsetFromCenter;
public override string ToString() => $"offset = {offset}," + $"arrowXOffsetFromCenter={arrowXOffsetFromCenter}";
}
class _ToolbarRenderBox : RenderShiftedBox {
public _ToolbarRenderBox(
float _barTopY = 0.0f,
float _arrowTipX = 0.0f,
bool _isArrowPointingDown = false,
RenderBox child = null
) : base(child) {
this._barTopY = _barTopY;
this._arrowTipX = _arrowTipX;
this._isArrowPointingDown = _isArrowPointingDown;
}
public override bool isRepaintBoundary {
get { return true; }
}
float _barTopY;
public float barTopY {
set {
if (_barTopY == value) {
return;
}
_barTopY = value;
markNeedsLayout();
//markNeedsSemanticsUpdate();
}
}
float _arrowTipX;
public float arrowTipX {
set {
if (_arrowTipX == value) {
return;
}
_arrowTipX = value;
markNeedsLayout();
//markNeedsSemanticsUpdate();
}
}
bool _isArrowPointingDown;
public bool isArrowPointingDown {
set {
if (_isArrowPointingDown == value) {
return;
}
_isArrowPointingDown = value;
markNeedsLayout();
//markNeedsSemanticsUpdate();
}
}
public readonly BoxConstraints heightConstraint = BoxConstraints.tightFor(height: CupertinoTextSelectionUtils._kToolbarHeight);
public override void setupParentData(RenderObject child) {
if (!(child.parentData is _ToolbarParentData)) {
child.parentData = new _ToolbarParentData();
}
}
protected override void performLayout() {
BoxConstraints constraints = this.constraints;
size = constraints.biggest;
if (child == null) {
return;
}
BoxConstraints enforcedConstraint = constraints
.deflate( EdgeInsets.symmetric(horizontal: CupertinoTextSelectionUtils._kToolbarScreenPadding))
.loosen();
child.layout(heightConstraint.enforce(enforcedConstraint), parentUsesSize: true);
_ToolbarParentData childParentData = child.parentData as _ToolbarParentData;
// The local x-coordinate of the center of the toolbar.
float lowerBound = child.size.width/2 + CupertinoTextSelectionUtils._kToolbarScreenPadding;
float upperBound = size.width - child.size.width/2 - CupertinoTextSelectionUtils._kToolbarScreenPadding;
float adjustedCenterX = _arrowTipX.clamp(lowerBound, upperBound) ;
childParentData.offset = new Offset(adjustedCenterX - child.size.width / 2, _barTopY);
childParentData.arrowXOffsetFromCenter = _arrowTipX - adjustedCenterX;
}
Path _clipPath() {
_ToolbarParentData childParentData = child.parentData as _ToolbarParentData;
Path rrect = new Path();
rrect.addRRect(
RRect.fromRectAndRadius(
new Offset(0, _isArrowPointingDown ? 0 : CupertinoTextSelectionUtils._kToolbarArrowSize.height)
& new Size(child.size.width, child.size.height - CupertinoTextSelectionUtils._kToolbarArrowSize.height),
CupertinoTextSelectionUtils._kToolbarBorderRadius
));
float arrowTipX = child.size.width / 2 + childParentData.arrowXOffsetFromCenter;
float arrowBottomY = _isArrowPointingDown
? child.size.height - CupertinoTextSelectionUtils._kToolbarArrowSize.height
: CupertinoTextSelectionUtils._kToolbarArrowSize.height;
float arrowTipY = _isArrowPointingDown ? child.size.height : 0;
Path arrow = new Path();
arrow.moveTo(arrowTipX, arrowTipY);
arrow.lineTo(arrowTipX - CupertinoTextSelectionUtils._kToolbarArrowSize.width / 2, arrowBottomY);
arrow.lineTo(arrowTipX + CupertinoTextSelectionUtils._kToolbarArrowSize.width / 2, arrowBottomY);
arrow.close();
return Path.combine(PathOperation.union, rrect, arrow);
}
public override void paint(PaintingContext context, Offset offset) {
if (child == null) {
return;
}
_ToolbarParentData childParentData = child.parentData as _ToolbarParentData;
context.pushClipPath(
needsCompositing,
offset + childParentData.offset,
Offset.zero & child.size,
_clipPath(),
(PaintingContext innerContext, Offset innerOffset) => innerContext.paintChild(child, innerOffset),
);
}
Paint _debugPaint;
protected override void debugPaintSize(PaintingContext context, Offset offset) {
D.assert(() => {
if (child == null) {
return true;
}
//_debugPaint ??= new Paint()
if (_debugPaint == null) {
_debugPaint = new Paint();
}
_debugPaint.shader = ui.Gradient.linear(
new Offset(0.0f, 0.0f),
new Offset(10.0f, 10.0f),
new List<Color> {
new Color(0x00000000), new Color(0xFFFF00FF), new Color(0xFFFF00FF),
new Color(0x00000000)
},
new List<float> {0.25f, 0.25f, 0.75f, 0.75f},
TileMode.repeated
);
_debugPaint.strokeWidth = 2.0f;
_debugPaint.style = PaintingStyle.stroke;
_ToolbarParentData childParentData = child.parentData as _ToolbarParentData;
context.canvas.drawPath(_clipPath().shift(offset + childParentData.offset), _debugPaint);
return true;
});
}
}
/// Draws a single text selection handle with a bar and a ball.
public class _TextSelectionHandlePainter : CustomPainter {
public _TextSelectionHandlePainter(Color color) {
this.color = color;
}
public readonly Color color;
public override void paint(Canvas canvas, Size size) {
float halfStrokeWidth = 1.0f;
Paint paint = new Paint();
paint.color = color;
Rect circle = Rect.fromCircle(
center: new Offset(CupertinoTextSelectionUtils._kSelectionHandleRadius, CupertinoTextSelectionUtils._kSelectionHandleRadius),
radius: CupertinoTextSelectionUtils._kSelectionHandleRadius
);
Rect line = Rect.fromPoints(
new Offset(
CupertinoTextSelectionUtils._kSelectionHandleRadius - halfStrokeWidth,
2 * CupertinoTextSelectionUtils._kSelectionHandleRadius - CupertinoTextSelectionUtils._kSelectionHandleOverlap
),
new Offset(CupertinoTextSelectionUtils._kSelectionHandleRadius + halfStrokeWidth, size.height)
);
Path path = new Path();
path.addOval(circle);
// Draw line so it slightly overlaps the circle.
path.addRect(line);
canvas.drawPath(path, paint);
}
public override bool shouldRepaint(CustomPainter oldPainter) {
oldPainter = (_TextSelectionHandlePainter)oldPainter;
return color != ((_TextSelectionHandlePainter)oldPainter).color;
}
}
class _CupertinoTextSelectionControls : TextSelectionControls {
/// Returns the size of the Cupertino handle.
public override Size getHandleSize(float textLineHeight) {
return new Size(
CupertinoTextSelectionUtils._kSelectionHandleRadius * 2,
textLineHeight + CupertinoTextSelectionUtils._kSelectionHandleRadius * 2 - CupertinoTextSelectionUtils._kSelectionHandleOverlap
);
}
public new Widget buildToolbar(
BuildContext context,
Rect globalEditableRegion,
float textLineHeight,
Offset position,
List<TextSelectionPoint> endpoints
//TextSelectionDelegate delegate
)
{
D.assert(debugCheckHasMediaQuery(context));
MediaQueryData mediaQuery = MediaQuery.of(context);
float toolbarHeightNeeded = mediaQuery.padding.top
+ CupertinoTextSelectionUtils._kToolbarScreenPadding
+ CupertinoTextSelectionUtils._kToolbarHeight
+ CupertinoTextSelectionUtils._kToolbarContentDistance;
float availableHeight = globalEditableRegion.top + endpoints.first().point.dy - textLineHeight;
bool isArrowPointingDown = toolbarHeightNeeded <= availableHeight;
float arrowTipX = (position.dx + globalEditableRegion.left).clamp(
CupertinoTextSelectionUtils._kArrowScreenPadding + mediaQuery.padding.left,
mediaQuery.size.width - mediaQuery.padding.right - CupertinoTextSelectionUtils._kArrowScreenPadding
) ;
float localBarTopY = isArrowPointingDown
? endpoints.first().point.dy - textLineHeight - CupertinoTextSelectionUtils._kToolbarContentDistance - CupertinoTextSelectionUtils._kToolbarHeight
: endpoints.last().point.dy + CupertinoTextSelectionUtils._kToolbarContentDistance;
List<Widget> items = new List<Widget>{};
Widget onePhysicalPixelVerticalDivider =
new SizedBox(width: 1.0f / MediaQuery.of(context).devicePixelRatio);
CupertinoLocalizations localizations = CupertinoLocalizations.of(context);
EdgeInsets arrowPadding = isArrowPointingDown
? EdgeInsets.only(bottom: CupertinoTextSelectionUtils._kToolbarArrowSize.height)
: EdgeInsets.only(top: CupertinoTextSelectionUtils._kToolbarArrowSize.height);
void addToolbarButtonIfNeeded(
string text,
bool Function(TextSelectionDelegate) predicate,
void Function(TextSelectionDelegate) onPressed) {
if (!predicate(delegate)) {
return;
}
if (items.isNotEmpty()) {
items.Add(onePhysicalPixelVerticalDivider);
}
items.Add(new CupertinoButton(
child: new Text(text, style:CupertinoTextSelectionUtils. _kToolbarButtonFontStyle),
color: CupertinoTextSelectionUtils._kToolbarBackgroundColor,
minSize: CupertinoTextSelectionUtils._kToolbarHeight,
padding: CupertinoTextSelectionUtils._kToolbarButtonPadding.add(arrowPadding),
borderRadius: null,
pressedOpacity: 0.7f,
onPressed: () => onPressed(delegate)
));
}
addToolbarButtonIfNeeded(localizations.cutButtonLabel, canCut, handleCut);
addToolbarButtonIfNeeded(localizations.copyButtonLabel, canCopy, handleCopy);
addToolbarButtonIfNeeded(localizations.pasteButtonLabel, canPaste, handlePaste);
addToolbarButtonIfNeeded(localizations.selectAllButtonLabel, canSelectAll, handleSelectAll);
return new CupertinoTextSelectionToolbar(
barTopY: localBarTopY + globalEditableRegion.top,
arrowTipX: arrowTipX,
isArrowPointingDown: isArrowPointingDown,
child: items.isEmpty() ? null : new DecoratedBox(
decoration: new BoxDecoration(color: CupertinoTextSelectionUtils._kToolbarDividerColor),
child: new Row(mainAxisSize: MainAxisSize.min, children: items)
)
);
}
public override Widget buildHandle(BuildContext context, TextSelectionHandleType type, float textLineHeight) {
Size desiredSize = getHandleSize(textLineHeight);
Widget handle = SizedBox.fromSize(
size: desiredSize,
child: new CustomPaint(
painter: new _TextSelectionHandlePainter(CupertinoTheme.of(context).primaryColor)
)
);
switch (type) {
case TextSelectionHandleType.left:
return handle;
case TextSelectionHandleType.right:
// Right handle is a vertical mirror of the left.
return new Transform(
transform: Matrix4.identity()
..translate(desiredSize.width / 2, desiredSize.height / 2)
..rotateZ(math.pi)
..translate(-desiredSize.width / 2, -desiredSize.height / 2),
child: handle
);
// iOS doesn't draw anything for collapsed selections.
case TextSelectionHandleType.collapsed:
return new SizedBox();
}
D.assert(type != null);
return null;
}
public override Offset getHandleAnchor(TextSelectionHandleType type, float textLineHeight) {
Size handleSize = getHandleSize(textLineHeight);
switch (type) {
// The circle is at the top for the left handle, and the anchor point is
// all the way at the bottom of the line.
case TextSelectionHandleType.left:
return new Offset(
handleSize.width / 2,
handleSize.height
);
// The right handle is vertically flipped, and the anchor point is near
// the top of the circle to give slight overlap.
case TextSelectionHandleType.right:
return new Offset(
handleSize.width / 2,
handleSize.height - 2 * CupertinoTextSelectionUtils._kSelectionHandleRadius + CupertinoTextSelectionUtils._kSelectionHandleOverlap
);
// A collapsed handle anchors itself so that it's centered.
default:
return new Offset(
handleSize.width / 2,
textLineHeight + (handleSize.height - textLineHeight) / 2
);
}
}
}*/
/// Text selection controls that follows iOS design conventions.
class _TextSelectionToolbarNotchPainter : AbstractCustomPainter {
public override void paint(Canvas canvas, Size size) {
Paint paint = new Paint();

return false;
}
}
class _TextSelectionToolbar : StatelessWidget {
public _TextSelectionToolbar(

switch (type) {
case TextSelectionHandleType.left:
Matrix4 matrix = new Matrix4().rotationZ(Mathf.PI);
Matrix4 matrix = Matrix4.rotationZ(Mathf.PI);
matrix.translate(-CupertinoTextSelectionUtils._kHandlesPadding,
-CupertinoTextSelectionUtils._kHandlesPadding);

);
case TextSelectionHandleType.right:
return new Transform(
transform:new Matrix4().translationValues(
transform:Matrix4.translationValues(
-CupertinoTextSelectionUtils._kHandlesPadding,
-(textLineHeight + CupertinoTextSelectionUtils._kHandlesPadding),
0

98
com.unity.uiwidgets/Runtime/cupertino/text_theme.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

namespace Unity.UIWidgets.cupertino {
static class CupertinoTextThemeDataUtils {
/*public static readonly TextStyle _kDefaultLightTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Text",
fontSize: 17.0f,
letterSpacing: -0.41f,
color: CupertinoColors.black,
decoration: TextDecoration.none
);
public static readonly TextStyle _kDefaultDarkTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Text",
fontSize: 17.0f,
letterSpacing: -0.41f,
color: CupertinoColors.white,
decoration: TextDecoration.none
);
public static readonly TextStyle _kDefaultActionTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Text",
fontSize: 17.0f,
letterSpacing: -0.41f,
color: CupertinoColors.activeBlue,
decoration: TextDecoration.none
);
public static readonly TextStyle _kDefaultTabLabelTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Text",
fontSize: 10.0f,
letterSpacing: -0.24f,
color: CupertinoColors.inactiveGray
);
public static readonly TextStyle _kDefaultMiddleTitleLightTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Text",
fontSize: 17.0f,
fontWeight: FontWeight.w600,
letterSpacing: -0.41f,
color: CupertinoColors.black
);
public static readonly TextStyle _kDefaultMiddleTitleDarkTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Text",
fontSize: 17.0f,
fontWeight: FontWeight.w600,
letterSpacing: -0.41f,
color: CupertinoColors.white
);
public static readonly TextStyle _kDefaultLargeTitleLightTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Display",
fontSize: 34.0f,
fontWeight: FontWeight.w700,
letterSpacing: 0.41f,
color: CupertinoColors.black
);
public static readonly TextStyle _kDefaultLargeTitleDarkTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Display",
fontSize: 34.0f,
fontWeight: FontWeight.w700,
letterSpacing: 0.41f,
color: CupertinoColors.white
);*/
public static readonly TextStyle _kDefaultTextStyle = new TextStyle(
inherit: false,
fontFamily: ".SF Pro Text",

public class CupertinoTextThemeData : Diagnosticable {
public CupertinoTextThemeData(
_TextThemeDefaultsBuilder defaults = null,
Brightness? brightness = null,
TextStyle textStyle = null,
TextStyle actionTextStyle = null,
TextStyle tabLabelTextStyle = null,

TextStyle pickerTextStyle = null,
TextStyle dateTimePickerTextStyle = null
) {
_primaryColor = primaryColor ?? CupertinoColors.activeBlue;
_brightness = brightness;
_primaryColor = primaryColor ?? CupertinoColors.systemBlue;
_textStyle = textStyle;
_actionTextStyle = actionTextStyle;
_tabLabelTextStyle = tabLabelTextStyle;

_defaults = new _TextThemeDefaultsBuilder(CupertinoColors.label, CupertinoColors.inactiveGray);
_pickerTextStyle = pickerTextStyle;
_dateTimePickerTextStyle = dateTimePickerTextStyle;
_defaults = defaults ??
//new _TextThemeDefaultsBuilder(Color.white,Color.white);
new _TextThemeDefaultsBuilder(CupertinoColors.label, CupertinoColors.inactiveGray);
D.assert((_navActionTextStyle != null && _actionTextStyle != null) || _primaryColor != null);
public static CupertinoTextThemeData _raw(
/*public static CupertinoTextThemeData _raw(
Color primaryColor ,
Color primaryColor,
TextStyle textStyle = null,
TextStyle actionTextStyle = null,
TextStyle tabLabelTextStyle = null,

textThemeData._defaults = _defaults;
return textThemeData;
}
}*/
_TextThemeDefaultsBuilder _defaults;
public readonly _TextThemeDefaultsBuilder _defaults;
readonly Color _primaryColor;
readonly Brightness? _brightness;

}
public CupertinoTextThemeData resolveFrom(BuildContext context, bool nullOk = false ) {
return CupertinoTextThemeData._raw(
return new CupertinoTextThemeData(
_defaults?.resolveFrom(context, nullOk),
CupertinoDynamicColor.resolve(_primaryColor, context, nullOk: nullOk),
CupertinoTextThemeDataUtils._resolveTextStyle(_textStyle, context, nullOk),

public new CupertinoTextThemeData copyWith(
Color primaryColor,
Brightness? brightness,
TextStyle textStyle,
TextStyle actionTextStyle,
TextStyle tabLabelTextStyle,

TextStyle dateTimePickerTextStyle
) {
return new CupertinoTextThemeData(
_defaults,
brightness: brightness ?? _brightness,
textStyle: textStyle ?? _textStyle,
actionTextStyle: actionTextStyle ?? _actionTextStyle,
tabLabelTextStyle: tabLabelTextStyle ?? _tabLabelTextStyle,

177
com.unity.uiwidgets/Runtime/cupertino/theme.cs


using System.Runtime.CompilerServices;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

namespace Unity.UIWidgets.cupertino {
static class CupertinoThemeDataUtils {
public static readonly Color _kDefaultBarLightBackgroundColor = new Color(0xCCF8F8F8);
public static readonly Color _kDefaultBarDarkBackgroundColor = new Color(0xB7212121);
public static readonly _CupertinoThemeDefaults _kDefaultTheme = new _CupertinoThemeDefaults(
null,
CupertinoColors.systemBlue,
CupertinoColors.systemBackground,
CupertinoDynamicColor.withBrightness(
debugLabel : "",
color: new Color(0xF0F9F9F9),
darkColor: new Color(0xF01D1D1D)
),
CupertinoColors.systemBackground,
new _CupertinoTextThemeDefaults(CupertinoColors.label, CupertinoColors.inactiveGray)
);
class CupertinoThemeDataUtils {
public static readonly _CupertinoThemeDefaults _kDefaultTheme =
new _CupertinoThemeDefaults(
brightness:null,
CupertinoColors.systemBlue,
CupertinoColors.systemBackground,
CupertinoDynamicColor.withBrightness(
color: new Color(0xF0F9F9F9),
darkColor: new Color(0xF01D1D1D)
),
CupertinoColors.systemBackground,
textThemeDefaults :
//new _CupertinoTextThemeDefaults(Color.black,Color.white)
new _CupertinoTextThemeDefaults(CupertinoColors.label, CupertinoColors.inactiveGray)
);
Key key = null,
Widget child = null,
Key key = null
Widget child = null
) : base(key: key) {
D.assert(child != null);
D.assert(data != null);

public readonly Widget child;
public static CupertinoThemeData of(BuildContext context) {
_InheritedCupertinoTheme inheritedTheme =
(_InheritedCupertinoTheme) context.dependOnInheritedWidgetOfExactType<_InheritedCupertinoTheme>(null);
//context.inheritFromWidgetOfExactType(typeof(_InheritedCupertinoTheme));
return inheritedTheme?.theme?.data ?? new CupertinoThemeData();
public static CupertinoThemeData of(BuildContext context) {
_InheritedCupertinoTheme inheritedTheme = context.dependOnInheritedWidgetOfExactType<_InheritedCupertinoTheme>();
return ((inheritedTheme?.theme?.data) ?? new CupertinoThemeData()).resolveFrom(context, nullOk: true);
_InheritedCupertinoTheme inheritedTheme =
context.dependOnInheritedWidgetOfExactType<_InheritedCupertinoTheme>(null);
var brightness = inheritedTheme?.theme?.data?.brightness;
var platformBrightness = MediaQuery.of(context, nullOk: nullOk)?.platformBrightness;
return brightness ?? platformBrightness;
_InheritedCupertinoTheme inheritedTheme = context.dependOnInheritedWidgetOfExactType<_InheritedCupertinoTheme>();
return (inheritedTheme?.theme?.data?.brightness) ?? MediaQuery.of(context, nullOk: nullOk)?.platformBrightness;
}
public override Widget build(BuildContext context) {

CupertinoTextThemeData textTheme = null,
Color barBackgroundColor = null,
Color scaffoldBackgroundColor = null
//,_CupertinoThemeDefaults defaults = null
) {
this.brightness = brightness;// ?? Brightness.light;
_primaryColor = primaryColor;

_scaffoldBackgroundColor = scaffoldBackgroundColor;
_defaults = CupertinoThemeDataUtils._kDefaultTheme;
_defaults = CupertinoThemeDataUtils._kDefaultTheme;
/*public static CupertinoThemeData raw(
Brightness brightness ,
Color primaryColor ,
Color primaryContrastingColor ,
CupertinoTextThemeData textTheme,
Color barBackgroundColor ,
Color scaffoldBackgroundColor
) {
/* D.assert(brightness != null);
D.assert(primaryColor != null);
D.assert(primaryContrastingColor != null);
D.assert(textTheme != null);
D.assert(barBackgroundColor != null);
D.assert(scaffoldBackgroundColor != null);
return new CupertinoThemeData(
brightness: brightness,
primaryColor: primaryColor,
primaryContrastingColor: primaryContrastingColor,
textTheme: textTheme,
barBackgroundColor: barBackgroundColor,
scaffoldBackgroundColor: scaffoldBackgroundColor
);*/
/*return _rawWithDefaults(
brightness,
primaryColor,
primaryContrastingColor,
textTheme,
barBackgroundColor,
scaffoldBackgroundColor,
_kDefaultTheme
);
}*/
public static CupertinoThemeData _rawWithDefaults(
Brightness? brightness,
Color primaryColor,

barBackgroundColor: barBackgroundColor,
scaffoldBackgroundColor: scaffoldBackgroundColor);
themeData._defaults = defaults;
//, defaults : defaults);
public _CupertinoThemeDefaults _defaults;
public _CupertinoThemeDefaults _defaults;
/*public bool _isLight {
get { return brightness == Brightness.light; }
}*/
//(_isLight ? CupertinoColors.activeBlue : CupertinoColors.activeOrange);
//return (_isLight ? CupertinoColors.activeBlue : CupertinoColors.activeOrange);
}
}

get {
return _primaryContrastingColor ?? _defaults.primaryContrastingColor;
//(_isLight ? CupertinoColors.white : CupertinoColors.black);
// return (_isLight ? CupertinoColors.white : CupertinoColors.black);
}
}

get {
return _textTheme ?? _defaults.textThemeDefaults.createDefaults(primaryColor: primaryColor);
/*new CupertinoTextThemeData(
/* return new CupertinoTextThemeData(
brightness: brightness,
primaryColor: primaryColor
);*/

public Color barBackgroundColor {
get {
return _barBackgroundColor ?? _defaults.barBackgroundColor;
/*(_isLight
? CupertinoThemeDataUtils._kDefaultBarLightBackgroundColor
: CupertinoThemeDataUtils._kDefaultBarDarkBackgroundColor);*/
}
}

get {
return _scaffoldBackgroundColor ?? _defaults.scaffoldBackgroundColor;
// (_isLight ? CupertinoColors.white : CupertinoColors.black);
//return (_isLight ? CupertinoColors.white : CupertinoColors.black);
}
}

);
}
protected CupertinoThemeData resolveFrom(BuildContext context, bool nullOk = false ) {
public CupertinoThemeData resolveFrom(BuildContext context, bool nullOk = false ) {
brightness,
convertColor(_primaryColor),
convertColor(_primaryContrastingColor),
_textTheme?.resolveFrom(context, nullOk: nullOk),
convertColor(_barBackgroundColor),
convertColor(_scaffoldBackgroundColor),
_defaults.resolveFrom(context, _textTheme == null, nullOk: nullOk)
brightness:brightness,
primaryColor:convertColor(_primaryColor),
primaryContrastingColor:convertColor(_primaryContrastingColor),
textTheme:_textTheme?.resolveFrom(context, nullOk: nullOk),
barBackgroundColor:convertColor(_barBackgroundColor),
scaffoldBackgroundColor:convertColor(_scaffoldBackgroundColor),
defaults:_defaults.resolveFrom(context, _textTheme == null, nullOk: nullOk)
);
}
public CupertinoThemeData copyWith(

CupertinoTextThemeData textTheme,
Color barBackgroundColor,
Color scaffoldBackgroundColor
) {
) : base(
brightness,
primaryColor,
primaryContrastingColor,
textTheme,
barBackgroundColor,
scaffoldBackgroundColor) {
_defaults = null;
}
/*{
this.brightness = brightness;
this.primaryColor = primaryColor;
this.primaryContrastingColor = primaryContrastingColor;

_defaults = null;
}
}*/
public new readonly Brightness? brightness;

public class _CupertinoThemeDefaults {
public _CupertinoThemeDefaults(
Brightness? brightness = null,
Color primaryColor = null,
Color primaryContrastingColor = null,
Color barBackgroundColor = null,
Color scaffoldBackgroundColor = null,
_CupertinoTextThemeDefaults textThemeDefaults = null
Brightness? brightness ,
Color primaryColor ,
Color primaryContrastingColor ,
Color barBackgroundColor ,
Color scaffoldBackgroundColor ,
_CupertinoTextThemeDefaults textThemeDefaults
)
{
this.brightness = brightness;

Color convertColor(Color color) => CupertinoDynamicColor.resolve(color, context, nullOk: nullOk);
return new _CupertinoThemeDefaults(
brightness,
convertColor(primaryColor),
convertColor(primaryContrastingColor),
convertColor(barBackgroundColor),
convertColor(scaffoldBackgroundColor),
resolveTextTheme ? textThemeDefaults?.resolveFrom(context, nullOk: nullOk) : textThemeDefaults
brightness:brightness,
primaryColor:convertColor(primaryColor),
primaryContrastingColor:convertColor(primaryContrastingColor),
barBackgroundColor:convertColor(barBackgroundColor),
scaffoldBackgroundColor:convertColor(scaffoldBackgroundColor),
textThemeDefaults:resolveTextTheme ? textThemeDefaults?.resolveFrom(context, nullOk: nullOk) : textThemeDefaults
);
}
}

public _CupertinoTextThemeDefaults(
Color labelColor = null,
Color inactiveGray = null
Color labelColor = null,
Color inactiveGray = null
) {
this.labelColor = labelColor;
this.inactiveGray = inactiveGray;

);
}
public CupertinoTextThemeData createDefaults(Color primaryColor = null) {
public CupertinoTextThemeData createDefaults(Color primaryColor ) {
D.assert(primaryColor != null);
return new _DefaultCupertinoTextThemeData(
primaryColor: primaryColor,

Color labelColor = null,
Color inactiveGray = null,
Color primaryColor = null
) : base(primaryColor: primaryColor) {
) : base(primaryColor: primaryColor)
{
this.labelColor = labelColor;
this.inactiveGray = inactiveGray;

3
com.unity.uiwidgets/Runtime/rendering/object.mixin.gen.cs


public ChildType nextSibling { get; set; }
public override void detach() {
base.detach();
public void detach() {
D.assert(previousSibling == null);
D.assert(nextSibling == null);

22
com.unity.uiwidgets/Runtime/rendering/sliver_multi_box_adaptor.cs


namespace Unity.UIWidgets.rendering {
public class KeepAliveParentDataMixin : ParentData {
bool keepAlive = false;
public bool keepAlive = false;
bool keptAlive { get; }
}

protected override void adoptChild(AbstractNodeMixinDiagnosticableTree childNode) {
base.adoptChild(childNode);
var child = (RenderBox) childNode;
var childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
SliverMultiBoxAdaptorParentData childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
if (!childParentData._keptAlive) {
childManager.didAdoptChild(child);
}

}
public override void remove(RenderBox child) {
var childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
SliverMultiBoxAdaptorParentData childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
if (!childParentData._keptAlive) {
base.remove(child);
return;

if (_keepAliveBucket.ContainsKey(index)) {
RenderBox child = _keepAliveBucket[index];
_keepAliveBucket.Remove(index);
var childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
SliverMultiBoxAdaptorParentData childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
D.assert(childParentData._keptAlive);
dropChild(child);
child.parentData = childParentData;

}
public void _destroyOrCacheChild(RenderBox child) {
var childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
SliverMultiBoxAdaptorParentData childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
if (childParentData.keepAlive) {
D.assert(!childParentData._keptAlive);
remove(child);

D.assert(firstChild == lastChild);
D.assert(indexOf(firstChild) == index);
var firstChildParentData = (SliverMultiBoxAdaptorParentData) firstChild.parentData;
SliverMultiBoxAdaptorParentData firstChildParentData = (SliverMultiBoxAdaptorParentData) firstChild.parentData;
firstChildParentData.layoutOffset = layoutOffset;
return true;
}

}
_keepAliveBucket.Values.Where(child => {
var childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
SliverMultiBoxAdaptorParentData childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
var childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
SliverMultiBoxAdaptorParentData childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
return !childParentData.keepAlive;
}).ToList().isEmpty());
});

D.assert(child != null);
var childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
SliverMultiBoxAdaptorParentData childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
return childParentData.index;
}

D.assert(child != null);
D.assert(child.parent == this);
var childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
SliverMultiBoxAdaptorParentData childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
return childParentData.layoutOffset;
}

if (firstChild != null) {
RenderBox child = firstChild;
while (true) {
var childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
SliverMultiBoxAdaptorParentData childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
children.Add(child.toDiagnosticsNode(name: "child with index " + childParentData.index));
if (child == lastChild) {
break;

2
com.unity.uiwidgets/Runtime/ui2/painting.cs


(b & 0xff)));
}
public readonly uint value;
public uint value;
public int alpha {
get { return (int) ((0xff000000 & value) >> 24); }

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


supportedLocales = supportedLocales ?? new List<Locale> {new Locale("en", "US")};
window = Window.instance;
D.assert(navigatorObservers != null);
D.assert(routes != null);
//D.assert(routes != null);
this.home = home;
this.navigatorKey = navigatorKey;
this.onGenerateRoute = onGenerateRoute;

this.checkerboardRasterCacheImages = checkerboardRasterCacheImages;
this.showSemanticsDebugger = showSemanticsDebugger;
this.debugShowWidgetInspector = debugShowWidgetInspector;
this.debugShowCheckedModeBanner = debugShowCheckedModeBanner;
this.onGenerateTitle = onGenerateTitle;
this.title = title;
this.color = color;

return Future<bool>.value(true).to<bool>();
}
Route _onUnknownRoute(RouteSettings settings) {
Route<object> _onUnknownRoute(RouteSettings settings) {
D.assert(() => {
if (widget.onUnknownRoute == null) {
throw new UIWidgetsError(

return true;
});
var result = widget.onUnknownRoute(settings);
var result = widget.onUnknownRoute(settings) as Route<object>;
D.assert(() => {
if (result == null) {
throw new UIWidgetsError(

void inspectorShowChanged() {
setState();
}
Set<Type> unsupportedTypes =
HashSet<Type> unsupportedTypes =
_localizationsDelegates.map<Type>((LocalizationsDelegate delegate) => delegate.type).toSet();
foreach ( LocalizationsDelegate<dynamic> delegate in _localizationsDelegates) {
if (!unsupportedTypes.contains(delegate.type))

}
if (unsupportedTypes.isEmpty)
if (unsupportedTypes.isEmpty())
return true;
if (listEquals(unsupportedTypes.map((Type type) => type.toString()).toList(), <String>['CupertinoLocalizations']))

RouteListFactory routeListFactory = (state, route) => {return widget.onGenerateInitialRoutes(route); };
navigator = new Navigator(
key: _navigator,
//initialRoute: widget.initialRoute ?? Navigator.defaultRouteName,
//onGenerateRoute: _onGenerateRoute,
initialRoute: WidgetsBinding.instance.window.defaultRouteName != Navigator.defaultRouteName
initialRoute: widget.initialRoute ?? Navigator.defaultRouteName,
/*WidgetsBinding.instance.window.defaultRouteName != Navigator.defaultRouteName
: widget.initialRoute ?? WidgetsBinding.instance.window.defaultRouteName,
: widget.initialRoute ?? WidgetsBinding.instance.window.defaultRouteName,*/
onGenerateInitialRoutes:
widget.onGenerateInitialRoutes == null
onGenerateInitialRoutes: widget.onGenerateInitialRoutes == null
? Navigator.defaultGenerateInitialRoutes
: routeListFactory,
onUnknownRoute: _onUnknownRoute,

Locale appLocale = widget.locale != null
? _resolveLocales(new List<Locale> {widget.locale}, widget.supportedLocales)
: _locale;
//D.assert(_debugCheckLocalizations(appLocale));
result = new MediaQuery(
data: MediaQueryData.fromWindow(widget.window),
child: new Localizations(

}
}
public class _MediaQueryFromWindow : StatefulWidget {
/*public class _MediaQueryFromWindow : StatefulWidget {
public _MediaQueryFromWindow(Key key = null, Widget child = null) : base(key: key) {
}
public readonly Widget child;

base.dispose();
}
}
*/
class _InspectorSelectButton : StatelessWidget {
public readonly GestureTapCallback onPressed;

25
com.unity.uiwidgets/Runtime/widgets/automatic_keep_alive.cs


handle.addListener(_handles[handle]);
if (!_keepingAlive) {
_keepingAlive = true;
ParentDataElement childElement = _getChildElement();
//ParentDataElement
ParentDataElement<KeepAliveParentDataMixin> childElement = _getChildElement();
if (childElement != null) {
_updateParentDataOfChild(childElement);
}

return;
}
ParentDataElement childElement1 = _getChildElement();
ParentDataElement<KeepAliveParentDataMixin> childElement1 = _getChildElement();
D.assert(childElement1 != null);
_updateParentDataOfChild(childElement1);
});

return false;
}
ParentDataElement _getChildElement() {
/*ParentDataElement _getChildElement() {
D.assert(mounted);
Element element = (Element) context;
Element childElement = null;

return (ParentDataElement) childElement;
}
}*/
ParentDataElement<KeepAliveParentDataMixin> _getChildElement() {
D.assert(mounted);
Element element = (Element) context;
Element childElement = null;
element.visitChildren((Element child) => { childElement = child; });
void _updateParentDataOfChild(ParentDataElement childElement) {
childElement.applyWidgetOutOfTurn((ParentDataWidget<KeepAliveParentDataMixin>) build(context));
D.assert(childElement == null || childElement is ParentDataElement<KeepAliveParentDataMixin>);
return (ParentDataElement<KeepAliveParentDataMixin>) childElement;
//void _updateParentDataOfChild(ParentDataElement childElement) {
// childElement.applyWidgetOutOfTurn((ParentDataWidget<KeepAliveParentDataMixin>) build(context));
// }
void _updateParentDataOfChild(ParentDataElement<KeepAliveParentDataMixin> childElement) {
childElement.applyWidgetOutOfTurn((ParentDataWidget<KeepAliveParentDataMixin>) build(context));
}
VoidCallback _createCallback(Listenable handle) {
return () => {

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


public override Element createElement() {
return new ParentDataElement(this);
}
public override bool debugIsValidRenderObject(RenderObject renderObject) {
D.assert(typeof(T) != typeof(ParentData));

T findAncestorWidgetOfExactType<T>() where T : Widget;
State ancestorStateOfType(TypeMatcher matcher);
T findAncestorStateOfType<T>() where T : State;
T findRootAncestorStateOfType<T>() where T : State<StatefulWidget>;
T findRootAncestorStateOfType<T>() where T: State ;//: State<StatefulWidget>;
RenderObject ancestorRenderObjectOfType(TypeMatcher matcher);

public T dependOnInheritedWidgetOfExactType<T>(object aspect = null) where T : InheritedWidget {
D.assert(_debugCheckStateIsActiveForAncestorLookup());
InheritedElement ancestor = _inheritedWidgets == null ? null : _inheritedWidgets[typeof(T)];
if (ancestor != null) {
D.assert(ancestor is InheritedElement);
return dependOnInheritedElement(ancestor, aspect: aspect) as T;

return statefulAncestor == null ? null : statefulAncestor.state;
}
public T findAncestorStateOfType<T>() where T : State<StatefulWidget> {
public T findAncestorStateOfType<T>() where T : State{
D.assert(_debugCheckStateIsActiveForAncestorLookup());
Element ancestor = _parent;
while (ancestor != null) {

return statefulAncestor == null ? null : statefulAncestor.state;
}
public T findRootAncestorStateOfType<T>() where T : State<StatefulWidget> {
public T findRootAncestorStateOfType<T>() where T : State{//<StatefulWidget> {
D.assert(_debugCheckStateIsActiveForAncestorLookup());
Element ancestor = _parent;
StatefulElement statefulAncestor = null;

}
}
public class ParentDataElement<T> : ParentDataElement where T : ParentData {
public ParentDataElement(ParentDataWidget<T> widget) : base(widget)
{
}
public new ParentDataWidget<T> widget {
get { return (ParentDataWidget<T>) base.widget; }
}
void _applyParentData(ParentDataWidget<T> widget) {
ElementVisitor applyParentDataToChild = null;
applyParentDataToChild = child => {
if (child is RenderObjectElement) {
((RenderObjectElement) child)._updateParentData(widget);
}
else {
D.assert(!(child is ParentDataElement<ParentData>));
child.visitChildren(applyParentDataToChild);
}
};
visitChildren(applyParentDataToChild);
}
public new void applyWidgetOutOfTurn(ParentDataWidget<T> newWidget) {
D.assert(newWidget != null);
D.assert(newWidget.debugCanApplyOutOfTurn());
D.assert(newWidget.child == widget.child);
_applyParentData(newWidget);
}
protected override void notifyClients(ProxyWidget oldWidget) {
_applyParentData((ParentDataWidget<T>) widget);
}
}
public class InheritedElement : ProxyElement {
public InheritedElement(Widget widget) : base(widget) {
}

_inheritedWidgets = new Dictionary<Type, InheritedElement>();
}
_inheritedWidgets[widget.GetType()] = this;
}

ParentDataElement _findAncestorParentDataElement() {
Element ancestor = _parent;
ParentDataElement result = null;
//ParentData>
while (ancestor != null && !(ancestor is RenderObjectElement)) {
if (ancestor is ParentDataElement parentDataElement) {
result = parentDataElement;

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


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

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


Brightness platformBrightness = Brightness.light,
EdgeInsets padding = null,
EdgeInsets viewInsets = null,
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;

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
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
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
);
}

EdgeInsets viewInsets = null,
EdgeInsets systemGestureInsets = null,
float? physicalDepth = null,
bool? highContrast =null,
bool? accessibleNavigation = null,
bool? invertColors = null,
bool? highContrast = null,
bool? invertColors = null,
bool? accessibleNavigation = null,
bool? boldText = null
) {
return new MediaQueryData(

textScaleFactor: textScaleFactor,
platformBrightness: platformBrightness,
padding: padding,
viewInsets: viewInsets.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.copyWith(
left: removeLeft ? (float?) 0.0f : null,
top: removeTop ? (float?) 0.0f : null,
right: removeRight ? (float?) 0.0f : null,
bottom: removeBottom ? (float?) 0.0f : null
),
alwaysUse24HourFormat: alwaysUse24HourFormat,
highContrast: highContrast,

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
left: removeLeft ?(float?) 0.0f : null,
top: removeTop ? (float?) 0.0f : null,
right: removeRight ? (float?) 0.0f : null,
bottom: removeBottom ?(float?)0.0f : null
left: removeLeft ? (float?)0.0 : null,
top: removeTop ? (float?)0.0 : null,
right: removeRight ? (float?)0.0 : null,
bottom: removeBottom ? (float?)0.0 : null
left: removeLeft ? (float?) 0.0f : null,
top: removeTop ? (float?) 0.0f : null,
right: removeRight ? (float?) 0.0f : null,
bottom: removeBottom ? (float?) 0.0f : null
),
alwaysUse24HourFormat: alwaysUse24HourFormat,
highContrast: highContrast,

&& Equals(padding, other.padding)
&& Equals(viewPadding, other.viewPadding)
&& Equals(viewInsets, other.viewInsets)
&& physicalDepth == other.physicalDepth
&& Equals(physicalDepth,other.physicalDepth)
&& alwaysUse24HourFormat == other.alwaysUse24HourFormat
&& highContrast == other.highContrast
&& accessibleNavigation == other.accessibleNavigation

public static MediaQueryData of(BuildContext context, bool nullOk = false) {
D.assert(context != null);
MediaQuery query = context.dependOnInheritedWidgetOfExactType<MediaQuery>();
//MediaQuery query = context.dependOnInheritedWidgetOfExactType<MediaQuery>();
//MediaQuery query = (MediaQuery) context.inheritFromWidgetOfExactType(typeof(MediaQuery));
MediaQuery query = (MediaQuery) context.inheritFromWidgetOfExactType(typeof(MediaQuery));
if (query != null) {
return query.data;
}

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


protected internal virtual void changedExternalState() {
}
protected internal virtual void dispose() {
public virtual void dispose() {
_navigator = null;
}

RouteFactory onUnknownRoute = null,
TransitionDelegate<object> transitionDelegate = null,
List<NavigatorObserver> observers = null) : base(key) {
D.assert(pages != null);
D.assert(onGenerateInitialRoutes != null);
D.assert(transitionDelegate != null);
D.assert(observers != null);
this.pages = pages;
this.pages = pages ?? new List<Page<object>>();
this.transitionDelegate = transitionDelegate;
this.transitionDelegate = transitionDelegate ?? new DefaultTransitionDelegate<object>();
}
public readonly List<Page<object>> pages;

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

bool rootNavigator = false,
bool nullOk = false
) {
var navigator = rootNavigator
? (NavigatorState) context.rootAncestorStateOfType(new TypeMatcher<NavigatorState>())
: (NavigatorState) context.ancestorStateOfType(new TypeMatcher<NavigatorState>());
NavigatorState navigator = rootNavigator
? context.findRootAncestorStateOfType<NavigatorState>()
: context.findAncestorStateOfType<NavigatorState>();
D.assert(() => {
if (navigator == null && !nullOk) {
throw new UIWidgetsError(

debugRouteNames = new List<string> {Navigator.defaultRouteName};
return true;
});
result.Add(navigator._routeNamed<object>(Navigator.defaultRouteName, arguments: null, allowNull: true));
result.Add(navigator._routeNamed(Navigator.defaultRouteName, arguments: null, allowNull: true));
string[] routeParts = initialRouteName.Split('/');
if (initialRouteName.isNotEmpty()) {
string routeName = "";

debugRouteNames.Add(routeName);
return true;
});
result.Add(navigator._routeNamed<object>(routeName, arguments: null, allowNull: true));
result.Add(navigator._routeNamed(routeName, arguments: null, allowNull: true));
}
}

}
}
else if (initialRouteName != Navigator.defaultRouteName) {
result.Add(navigator._routeNamed<object>(initialRouteName, arguments: null, allowNull: true));
result.Add(navigator._routeNamed(initialRouteName, arguments: null, allowNull: true));
}
//result.RemoveWhere((Route<object> route) => route == null);

}
}
if (result.isEmpty())
result.Add(navigator._routeNamed<object>(Navigator.defaultRouteName, arguments: null));
result.Add(
navigator._routeNamed(
name:Navigator.defaultRouteName,
arguments: null));
return result;
}

public void dispose() {
D.assert(currentState.GetHashCode() < _RouteLifecycle.disposed.GetHashCode());
route.dispose();
((Route)route).dispose();
//route._navigator = null;
currentState = _RouteLifecycle.disposed;
}

}
public override void didUpdateWidget(StatefulWidget oldWidget) {
oldWidget = (Navigator) oldWidget;
public new void didUpdateWidget(Navigator oldWidget) {
// oldWidget = (Navigator) oldWidget;
base.didUpdateWidget(oldWidget);
D.assert(
widget.pages.isEmpty() || widget.onPopPage != null, () =>

if (((Navigator)oldWidget).pages != widget.pages) {
D.assert(
widget.pages.isNotEmpty, () =>
widget.pages.isNotEmpty(), () =>
"To use the Navigator.pages, there must be at least one page in the list."
);
_updatePages();

_RouteEntry next = null;
_RouteEntry entry = _history[index];
_RouteEntry previous = index > 0 ? _history[index - 1] : null;
bool
canRemoveOrAdd =
false; // Whether there is a fully opaque route on top to silently remove or add route underneath.
bool canRemoveOrAdd = false; // Whether there is a fully opaque route on top to silently remove or add route underneath.
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>();

if (entry.currentState == _RouteLifecycle.idle) {
continue;
}
break;
case _RouteLifecycle.pushing: // Will exit this state when animation completes.
if (!seenTopActiveRoute && poppedRoute != null)

if (!seenTopActiveRoute && poppedRoute != null)
entry.handleDidPopNext(poppedRoute);
seenTopActiveRoute = true;
// This route is idle, so we are allowed to remove subsequent (earlier)
// routes that are waiting to be removed silently:
canRemoveOrAdd = true;
break;
case _RouteLifecycle.pop:

poppedRoute = entry.route;
}
entry.handlePop(
navigator: this,
previousPresent: _getRouteBefore(index, _RouteEntry.willBePresentPredicate)?.route

entry = previous;
previous = index > 0 ? _history[index - 1] : null;
}
// Now that the list is clean, send the didChangeNext/didChangePrevious
// notifications.
// Announces route name changes.
_RouteEntry lastEntry = null;//_history.lastWhere(_RouteEntry.isPresentPredicate, orElse: () => null);
/* _RouteEntry lastEntry = null;//_history.lastWhere(_RouteEntry.isPresentPredicate, orElse: () => null);
foreach (var historyEntry in _history) {
if (_RouteEntry.isPresentPredicate(historyEntry)) {
lastEntry = historyEntry;

if (routeName != _lastAnnouncedRouteName) {
//RouteNotificationMessages.maybeNotifyRouteChange(routeName, _lastAnnouncedRouteName);
_lastAnnouncedRouteName = routeName;
}
}*/
foreach (OverlayEntry overlayEntry in routeEntry.route.overlayEntries)
foreach (OverlayEntry overlayEntry in routeEntry.route.overlayEntries) {
}
if (rearrangeOverlay)
overlay?.rearrange(_allRouteOverlayEntries);
}

return index < _history.Count ? _history[index] : null;
}
public Route _routeNamed(string name, object arguments, bool allowNull = false) {
D.assert(!_debugLocked);
D.assert(name != null);
if (allowNull && widget.onGenerateRoute == null)
return null;
D.assert(() => {
if (widget.onGenerateRoute == null) {
throw new UIWidgetsError(
"Navigator.onGenerateRoute was null, but the route named " + $"{name} was referenced.\n" +
"To use the Navigator API with named routes (pushNamed, pushReplacementNamed, or " +
"pushNamedAndRemoveUntil), the Navigator must be provided with an " +
"onGenerateRoute handler.\n" +
"The Navigator was:\n" +
$" {this}"
);
}
return true;
});
RouteSettings settings = new RouteSettings(
name: name,
arguments: arguments
);
Route route = widget.onGenerateRoute(settings) as Route;
if (route == null && !allowNull) {
D.assert(() => {
if (widget.onUnknownRoute == null) {
throw new UIWidgetsError(
"Navigator.onGenerateRoute returned null when requested to build route " + $"{name}." +
"The onGenerateRoute callback must never return null, unless an onUnknownRoute " +
"callback is provided as well." +
new DiagnosticsProperty<NavigatorState>("The Navigator was", this,
style: DiagnosticsTreeStyle.errorProperty)
);
}
return true;
});
route = widget.onUnknownRoute(settings) as Route;
D.assert(() => {
if (route == null) {
throw new UIWidgetsError(
"Navigator.onUnknownRoute returned null when requested to build route " + $"{name}." +
"The onUnknownRoute callback must never return null." +
new DiagnosticsProperty<NavigatorState>("The Navigator was", this,
style: DiagnosticsTreeStyle.errorProperty)
);
}
return true;
});
}
D.assert(route != null || allowNull);
return route;
}
public Route<T> _routeNamed<T>(string name, object arguments, bool allowNull = false) {
D.assert(!_debugLocked);

});
D.assert(newRoute != null);
D.assert(newRoute._navigator == null);
D.assert(newRoute.overlayEntries.isEmpty);
D.assert(newRoute.overlayEntries.isEmpty());
D.assert(predicate != null);
int index = _history.Count - 1;
_history.Add(new _RouteEntry(newRoute, initialState: _RouteLifecycle.push));

}
public void finalizeRoute(Route route) {
bool wasDebugLocked;
bool wasDebugLocked = false;
D.assert(() => {
wasDebugLocked = _debugLocked;
_debugLocked = true;

routeEntries.Add(historyEntry);
}
}
_RouteEntry entry = null;
foreach (var historyEntry in _history) {
if (_RouteEntry.isRoutePredicate(route)(historyEntry)) {

public override Widget build(BuildContext context) {
D.assert(!_debugLocked);
D.assert(!_debugLocked);//_debuglocked = false;
D.assert(_history.isNotEmpty());
return new Listener(
onPointerDown: _handlePointerDown,

40
com.unity.uiwidgets/Runtime/widgets/overlay.cs


setState(() => { _entries.InsertRange(_insertionIndex(below, above), entries); });
}
public void rearrange(IEnumerable<OverlayEntry> newEntries, OverlayEntry below = null,
OverlayEntry above = null) {
public void rearrange(IEnumerable<OverlayEntry> newEntries,
OverlayEntry below = null,
OverlayEntry above = null)
{
D.assert(above == null || below == null, () => "Only one of `above` and `below` may be specified.");
/*D.assert(above == null || below == null, () => "Only one of `above` and `below` may be specified.");
D.assert(above == null || (above._overlay == this && _entries.Contains(above)),
() => "The provided entry for `above` is not present in the Overlay.");
D.assert(below == null || (below._overlay == this && _entries.Contains(below)),

D.assert(newEntriesList.All(entry => entry._overlay == null),
() => "One or more of the specified entries are already present in another Overlay.");
() => "One or more of the specified entries are already present in another Overlay.");*/
D.assert(
above == null || below == null,
()=>"Only one of `above` and `below` may be specified."
);
D.assert(
above == null || (above._overlay == this && _entries.Contains(above) && newEntriesList.Contains(above)),
()=>"The entry used for `above` must be in the Overlay and in the `newEntriesList`."
);
D.assert(
below == null || (below._overlay == this && _entries.Contains(below) && newEntriesList.Contains(below)),
()=>"The entry used for `below` must be in the Overlay and in the `newEntriesList`."
);
int overlayEntry = 0;
foreach (var newEntry in newEntriesList) {
if (newEntry._overlay == null || newEntry._overlay == this) {
overlayEntry++;
}
}
D.assert(overlayEntry == newEntriesList.Count,
()=>"One or more of the specified entries are already present in another Overlay."
);
int lastoverlayEntry = 0;
foreach (var newEntry in newEntriesList) {
if (_entries.IndexOf(newEntry) == _entries.LastIndexOf(newEntry)) {
lastoverlayEntry++;
}
}
D.assert(lastoverlayEntry == newEntriesList.Count,
()=>"One or more of the specified entries are specified multiple times."
);
if (newEntriesList.isEmpty()) {
return;
}

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


return returnValue;
}
protected internal override void dispose() {
foreach (var entry in _overlayEntries) {
public override void dispose() {
/*foreach (var entry in _overlayEntries) {
}
}*/
_overlayEntries.Clear();
base.dispose();
}

return true;
}
protected internal override void dispose() {
public override void dispose() {
D.assert(!_transitionCompleter.isCompleted, () => $"Cannot dispose a {GetType()} twice.");
_controller?.dispose();
_transitionCompleter.complete(FutureOr.value(_result));

}
base.didAdd();
}
protected internal override void dispose() {
/*public override void dispose() {
}
}*/
public virtual bool barrierDismissible { get; }

19
com.unity.uiwidgets/Runtime/widgets/sliver.cs


return children != ((SliverChildListDelegate) oldDelegate).children;
}
}
public abstract class SliverWithKeepAliveWidget : RenderObjectWidget
{
public SliverWithKeepAliveWidget(Key key = null) : base(key: key) { }
}
public abstract class SliverWithKeepAliveWidget : RenderObjectWidget {
/// Initializes fields for subclasses.

index);
if (newChild != null) {
_childElements[index] = newChild;
var parentData = (SliverMultiBoxAdaptorParentData) newChild.renderObject.parentData;
SliverMultiBoxAdaptorParentData parentData = (SliverMultiBoxAdaptorParentData) newChild.renderObject.parentData;
if (!parentData.keptAlive) {
_currentBeforeChild = (RenderBox) newChild.renderObject;
}

protected override void insertChildRenderObject(RenderObject child, object slotRaw) {
D.assert(slotRaw != null);
int slot = (int) slotRaw;
D.assert(_currentlyUpdatingChildIndex == slot);
D.assert(renderObject.debugValidateChild(child));
renderObject.insert((RenderBox) child, after: _currentBeforeChild);

}
protected override void moveChildRenderObject(RenderObject child, object slotRaw) {
D.assert(false);
//D.assert(false);
D.assert(slotRaw != null);
int slot = (int) slotRaw;
D.assert(_currentlyUpdatingChildIndex == slot);
renderObject.move(child as RenderBox, after: _currentBeforeChild);
}
protected override void removeChildRenderObject(RenderObject child) {

public override void applyParentData(RenderObject renderObject) {
D.assert(renderObject.parentData is SliverMultiBoxAdaptorParentData);
SliverMultiBoxAdaptorParentData parentData = (SliverMultiBoxAdaptorParentData) renderObject.parentData;
if (parentData.keepAlive != keepAlive) {
// SliverMultiBoxAdaptorParentData parentData = (SliverMultiBoxAdaptorParentData) renderObject.parentData;
KeepAliveParentDataMixin parentData = (KeepAliveParentDataMixin) renderObject.parentData ;
if (((KeepAliveParentDataMixin)parentData).keepAlive != keepAlive) {
parentData.keepAlive = keepAlive;
var targetParent = renderObject.parent;
if (targetParent is RenderObject && !keepAlive) {

正在加载...
取消
保存