浏览代码

Merge branch 'dev_1.17.5' into add_redux

/siyaoH-1.17-PlatformMessage
wangshuang 4 年前
当前提交
7dfad51e
共有 38 个文件被更改,包括 488 次插入1065 次删除
  1. 48
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_picker_demo.cs
  2. 4
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/backdrop_demo.cs
  3. 4
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/selection_controls_demo.cs
  4. 6
      com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs
  5. 36
      com.unity.uiwidgets/Runtime/cupertino/context_menu.cs
  6. 454
      com.unity.uiwidgets/Runtime/cupertino/date_picker.cs
  7. 10
      com.unity.uiwidgets/Runtime/cupertino/dialog.cs
  8. 7
      com.unity.uiwidgets/Runtime/cupertino/segmented_control.cs
  9. 2
      com.unity.uiwidgets/Runtime/cupertino/switch.cs
  10. 8
      com.unity.uiwidgets/Runtime/material/app.cs
  11. 4
      com.unity.uiwidgets/Runtime/material/divider.cs
  12. 2
      com.unity.uiwidgets/Runtime/material/navigation_rail_theme.cs
  13. 5
      com.unity.uiwidgets/Runtime/material/pickers/date_picker_head.cs
  14. 69
      com.unity.uiwidgets/Runtime/material/theme_data.cs
  15. 4
      com.unity.uiwidgets/Runtime/painting/basic_types.cs
  16. 2
      com.unity.uiwidgets/Runtime/painting/image_stream.cs
  17. 9
      com.unity.uiwidgets/Runtime/rendering/binding.cs
  18. 41
      com.unity.uiwidgets/Runtime/rendering/layer.cs
  19. 6
      com.unity.uiwidgets/Runtime/rendering/list_wheel_viewport.cs
  20. 46
      com.unity.uiwidgets/Runtime/rendering/paragraph.cs
  21. 311
      com.unity.uiwidgets/Runtime/rendering/proxy_box.cs
  22. 16
      com.unity.uiwidgets/Runtime/rendering/proxy_sliver.cs
  23. 2
      com.unity.uiwidgets/Runtime/scheduler2/binding.cs
  24. 43
      com.unity.uiwidgets/Runtime/ui2/painting.cs
  25. 138
      com.unity.uiwidgets/Runtime/widgets/app.cs
  26. 26
      com.unity.uiwidgets/Runtime/widgets/editable_text.cs
  27. 6
      com.unity.uiwidgets/Runtime/widgets/focus_manager.cs
  28. 4
      com.unity.uiwidgets/Runtime/widgets/focus_traversal.cs
  29. 2
      com.unity.uiwidgets/Runtime/widgets/framework.cs
  30. 8
      com.unity.uiwidgets/Runtime/widgets/image.cs
  31. 1
      com.unity.uiwidgets/Runtime/widgets/localizations.cs
  32. 41
      com.unity.uiwidgets/Runtime/widgets/navigator.cs
  33. 17
      com.unity.uiwidgets/Runtime/widgets/routes.cs
  34. 31
      com.unity.uiwidgets/Runtime/widgets/sliver.cs
  35. 121
      com.unity.uiwidgets/Runtime/widgets/text.cs
  36. 8
      com.unity.uiwidgets/Runtime/widgets/text_selection.cs
  37. 9
      com.unity.uiwidgets/Runtime/widgets/texture.cs
  38. 2
      engine/src/lib/ui/window/window.cc

48
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_picker_demo.cs


using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
using Brightness = Unity.UIWidgets.ui.Brightness;

}
Widget _buildCountdownTimerPicker(BuildContext context) {
return new GestureDetector(
onTap: () =>{
onTap: () =>
{
builder: (BuildContext context1) =>{
builder: (BuildContext context1) =>
{
onTimerDurationChanged: (newTimer) =>{
onTimerDurationChanged: (TimeSpan newTimer) =>{
setState(() => timer = newTimer);
}
)

builder: (BuildContext context1) =>
{
return new _BottomPicker(
child: new CupertinoDatePicker(
child: new CupertinoDatePicker(
backgroundColor: CupertinoColors.systemBackground.resolveFrom(context1),
mode: CupertinoDatePickerMode.date,
initialDateTime: date,

);
}
}
}
D.assert(child != null);
this.child = child;
D.assert(child != null);
this.child = child;
public override Widget build(BuildContext context) {
public override Widget build(BuildContext context)
{
height: 216,
padding: EdgeInsets.only(top: 6),
margin: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom
),
color: CupertinoColors.systemBackground.resolveFrom(context),
height: CupertinoPickerDemoUtils._kPickerSheetHeight,
padding: EdgeInsets.only(top: 6.0f),
color: CupertinoColors.label.resolveFrom(context).darkColor,
fontSize: 22
fontSize: 22.0f
// Blocks taps from propagating to the modal sheet and popping.
onTap: ()=> {},
child: new SafeArea(
top: false,
child: child
)
onTap: () =>{ },
child: new SafeArea(
top: false,
child: child
)
}
public class _Menu : StatelessWidget {

);
}
}
}

4
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/backdrop_demo.cs


onTap: () => { this.onTap?.Invoke(); },
child: new Container(
height: 48.0f,
//TODO: uncomment this when fixes on EdgeInsetsDirectional lands
//padding: EdgeInsetsDirectional.only(start: 16.0f),
padding: EdgeInsets.only(left: 16.0f),
padding: EdgeInsetsDirectional.only(start: 16.0f),
alignment: AlignmentDirectional.centerStart,
child: new DefaultTextStyle(
style: theme.textTheme.subtitle1,

4
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/selection_controls_demo.cs


private bool checkboxValueA = true;
private bool checkboxValueB = false;
private bool checkboxValueC;
private bool? checkboxValueC;
private int radioValue = 0;
private bool switchValue = false;

new Checkbox(
value: checkboxValueC,
tristate: true,
onChanged: (bool? value) => { setState(() => { checkboxValueC = value.Value; }); }
onChanged: (bool? value) => { setState(() => { checkboxValueC = value; }); }
)
}
),

6
com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs


var pos = _getPointerPosition(evt.mousePosition);
_wrapper.OnMouseMove(pos);
}
else if (evt.type == EventType.ScrollWheel && evt.delta.magnitude != 0) {
var delta = evt.delta;
delta.y /= 3f;
var pos = _getPointerPosition(evt.mousePosition);
_wrapper.OnMouseScroll(delta, pos);
}
}

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


public class _CupertinoContextMenuState : TickerProviderStateMixin<CupertinoContextMenu> {
public readonly GlobalKey _childGlobalKey = GlobalKey<State<StatefulWidget>>.key();
static readonly TimeSpan kLongPressTimeout = TimeSpan.FromMilliseconds(500);//new TimeSpan(0, 0, 0, 0, 500);
static readonly TimeSpan kLongPressTimeout = TimeSpan.FromMilliseconds(500);
public bool _childHidden = false;
public AnimationController _openController;
public Rect _decoyChildEndRect;

public Orientation _lastOrientation;
public readonly Rect _previousChildRect;
public float _scale = 1.0f;
public readonly GlobalKey _sheetGlobalKey = new LabeledGlobalKey<State<StatefulWidget>>();//GlobalKey();
public readonly GlobalKey _sheetGlobalKey = new LabeledGlobalKey<State<StatefulWidget>>();
public readonly static CurveTween _curve = new CurveTween(
curve: Curves.easeOutBack
);

public readonly Tween< float> _opacityTween = new FloatTween(begin: 0.0f, end: 1.0f);
public Animation< float> _sheetOpacity;
public readonly string barrierLabel;
//public override string barrierLabel;
public Color barrierColor {
//public readonly string barrierLabel;
public override string barrierLabel { get; }
public override Color barrierColor {
public bool barrierDismissible{
public override bool barrierDismissible{
public bool semanticsDismissible {
public override bool semanticsDismissible {
public TimeSpan transitionDuration {
public override TimeSpan transitionDuration {
/*public static AlignmentDirectional getSheetAlignment(_ContextMenuLocation contextMenuLocation) {
public static AlignmentDirectional getSheetAlignment(_ContextMenuLocation contextMenuLocation) {
switch (contextMenuLocation) {
case _ContextMenuLocation.center:
return AlignmentDirectional.topCenter;

return AlignmentDirectional.topStart;
}
}*/
}
public static Rect _getScaledRect(GlobalKey globalKey, float scale) {
Rect childRect = CupertinoContextMenuUtils._getRect(globalKey);
Size sizeScaled = childRect.size * scale;

base.offstage = _externalOffstage || _internalOffstage;
changedInternalState();
}
public bool didPop(object result) {
protected internal override bool didPop(object result) {
public bool offstage{
public override bool offstage{
set{
_externalOffstage = value;
_setOffstageInternally();

public TickerFuture didPush() {
protected internal override TickerFuture didPush() {
_internalOffstage = true;
_setOffstageInternally();
SchedulerBinding.instance.addPostFrameCallback((TimeSpan timeSpan)=>{

});
return base.didPush();
}
public Animation<float> createAnimation() {
public override Animation<float> createAnimation() {
Animation< float> animation = base.createAnimation();
_sheetOpacity = _opacityTween.animate(new CurvedAnimation(
parent: animation,

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

// Build the animation for the _ContextMenuSheet.
Widget _buildSheetAnimation(BuildContext context, Widget child) {
return Transform.scale(
//alignment: _ContextMenuRoute.getSheetAlignment(widget.contextMenuLocation),
alignment: _ContextMenuRoute.getSheetAlignment(widget.contextMenuLocation),
scale: _sheetScaleAnimation.value,
child: new Opacity(
opacity: _sheetOpacityAnimation.value,

);
_sheetController = new AnimationController(
duration: TimeSpan.FromMilliseconds(100),
reverseDuration: TimeSpan.FromMilliseconds(300),/// TBC ???
reverseDuration: TimeSpan.FromMilliseconds(300),
vsync: this
);
_sheetScaleAnimation = new FloatTween(

454
com.unity.uiwidgets/Runtime/cupertino/date_picker.cs


Alignment alignCenterLeft;
Alignment alignCenterRight;
int selectedHour = 0;
int selectedMinute = 0;
int selectedSecond = 0;
int selectedHour;
int selectedMinute;
int selectedSecond;
int lastSelectedHour = 0;
int lastSelectedMinute = 0;
int lastSelectedSecond = 0;
int lastSelectedHour;
int lastSelectedMinute;
int lastSelectedSecond;
float numberLabelWidth = 0f;
float numberLabelHeight = 0f;
float numberLabelBaseline = 0f;
float numberLabelWidth;
float numberLabelHeight;
float numberLabelBaseline;
if (widget.mode != CupertinoTimerPickerMode.ms) {
selectedHour = (int) widget.initialTimerDuration.TotalHours;
}

}
PaintingBinding.instance.systemFonts.addListener(_handleSystemFontsChange);
}
void _handleSystemFontsChange() {
setState(() =>{

numberLabelWidth = textPainter.maxIntrinsicWidth;
numberLabelHeight = textPainter.height;
numberLabelBaseline = textPainter.computeDistanceToActualBaseline(TextBaseline.alphabetic);
}
}
EdgeInsetsDirectional padding = EdgeInsetsDirectional.only(
start: numberLabelWidth
+ CupertinoDatePickerUtils._kTimerPickerLabelPadSize
+ pickerPadding.start
EdgeInsetsDirectional padding = EdgeInsetsDirectional.only(
start: numberLabelWidth
+ CupertinoDatePickerUtils._kTimerPickerLabelPadSize
+ pickerPadding.start
child: new Container(
alignment: AlignmentDirectional.centerStart.resolve(textDirection),
padding: padding.resolve(textDirection),
child: new SizedBox(
height: numberLabelHeight,
child: new Baseline(
baseline: numberLabelBaseline,
baselineType: TextBaseline.alphabetic,
child: new Text(
text,
style: new TextStyle(
fontSize: CupertinoDatePickerUtils._kTimerPickerLabelFontSize,
fontWeight: FontWeight.w600),
maxLines: 1,
softWrap: false)))
));
}
Widget _buildPickerNumberLabel(string text, EdgeInsetsDirectional padding) {
return new Container(
width: CupertinoDatePickerUtils._kTimerPickerColumnIntrinsicWidth + padding.horizontal,
child: new Container(
alignment: AlignmentDirectional.centerStart.resolve(textDirection),
alignment: AlignmentDirectional.centerStart.resolve(textDirection),
child: new Container(
width: numberLabelWidth,
alignment: AlignmentDirectional.centerEnd.resolve(textDirection),
child: new Text(text, softWrap: false, maxLines: 1, overflow: TextOverflow.visible)
child: new SizedBox(
height: numberLabelHeight,
child: new Baseline(
baseline: numberLabelBaseline,
baselineType: TextBaseline.alphabetic,
child: new Text(
text,
style: new TextStyle(
fontSize: CupertinoDatePickerUtils._kTimerPickerLabelFontSize,
fontWeight: FontWeight.w600
),
maxLines: 1,
softWrap: false
)
)
)
}
Widget _buildHourPicker(EdgeInsetsDirectional additionalPadding) {
List<Widget> widgets = new List<Widget>();
for (int index = 0; index < 24; index++) {
string semanticsLabel = textDirectionFactor == 1
? localizations.timerPickerHour(index) + localizations.timerPickerHourLabel(index)
: localizations.timerPickerHourLabel(index) + localizations.timerPickerHour(index);
}
widgets.Add( _buildPickerNumberLabel(localizations.timerPickerHour(index), additionalPadding));
}
Widget _buildPickerNumberLabel(string text, EdgeInsetsDirectional padding) {
return new Container(
width: CupertinoDatePickerUtils._kTimerPickerColumnIntrinsicWidth + padding.horizontal,
padding: padding.resolve(textDirection),
alignment: AlignmentDirectional.centerStart.resolve(textDirection),
child: new Container(
width: numberLabelWidth,
alignment: AlignmentDirectional.centerEnd.resolve(textDirection),
child: new Text(text, softWrap: false, maxLines: 1, overflow: TextOverflow.visible)
)
);
}
Widget _buildHourPicker(EdgeInsetsDirectional additionalPadding) {
scrollController: new FixedExtentScrollController(initialItem: selectedHour),
offAxisFraction: -0.5f * textDirectionFactor,
itemExtent: CupertinoDatePickerUtils._kItemExtent,
backgroundColor: ((CupertinoTimerPicker)widget).backgroundColor,
squeeze: CupertinoDatePickerUtils._kSqueeze,
onSelectedItemChanged: (int index)=> {
setState(()=> {
selectedHour = index;
widget.onTimerDurationChanged(
new TimeSpan(
hours: selectedHour,
minutes: selectedMinute,
seconds: selectedSecond != 0 ? selectedSecond : 0));
scrollController: new FixedExtentScrollController(initialItem: selectedHour),
offAxisFraction: -0.5f * textDirectionFactor,
itemExtent: CupertinoDatePickerUtils._kItemExtent,
backgroundColor: widget.backgroundColor,
squeeze: CupertinoDatePickerUtils._kSqueeze,
onSelectedItemChanged: (int index)=> {
setState(() =>{
selectedHour = index;
widget.onTimerDurationChanged(
new TimeSpan(
hours: selectedHour,
minutes: selectedMinute,
seconds: selectedSecond == 0 ? 0 : selectedHour));
},
children: widgets
},
children: CupertinoDatePickerUtils.listGenerate(24, (int index) => {
string semanticsLabel = textDirectionFactor == 1
? localizations.timerPickerHour(index) + localizations.timerPickerHourLabel(index)
: localizations.timerPickerHourLabel(index) + localizations.timerPickerHour(index);
return _buildPickerNumberLabel(localizations.timerPickerHour(index), additionalPadding);
})
}
}
Widget _buildHourColumn(EdgeInsetsDirectional additionalPadding) {
Widget _buildHourColumn(EdgeInsetsDirectional additionalPadding) {
children: new List<Widget>{
new NotificationListener<ScrollEndNotification>(
onNotification: (ScrollEndNotification notification)=> {
setState(()=> { lastSelectedHour = selectedHour; });
return false;
},
child: _buildHourPicker(additionalPadding)
),
_buildLabel(
localizations.timerPickerHourLabel(lastSelectedHour == 0 ? selectedHour : lastSelectedHour),
additionalPadding
),
});
}
Widget _buildMinutePicker(EdgeInsetsDirectional additionalPadding) {
List<Widget> widgets = new List<Widget>();
for (int index = 0; index < (int)(60 / widget.minuteInterval); index++) {
int minute = index * widget.minuteInterval;
children: new List<Widget>{
new NotificationListener<ScrollEndNotification>(
onNotification: (ScrollEndNotification notification)=> {
setState(()=> { lastSelectedHour = selectedHour; });
return false;
},
child: _buildHourPicker(additionalPadding)
),
_buildLabel(
localizations.timerPickerHourLabel(lastSelectedHour == 0 ? selectedHour : lastSelectedHour),
additionalPadding
),
}
);
}
string semanticsLabel = textDirectionFactor == 1
? localizations.timerPickerMinute(minute) + localizations.timerPickerMinuteLabel(minute)
: localizations.timerPickerMinuteLabel(minute) + localizations.timerPickerMinute(minute);
widgets.Add(_buildPickerNumberLabel(localizations.timerPickerMinute(minute), additionalPadding)
);
}
Widget _buildMinutePicker(EdgeInsetsDirectional additionalPadding) {
switch (widget.mode) {
case CupertinoTimerPickerMode.hm:
offAxisFraction = 0.5f * textDirectionFactor;
switch (widget.mode) {
case CupertinoTimerPickerMode.hm:
offAxisFraction = 0.5f * textDirectionFactor;
case CupertinoTimerPickerMode.hms:
case CupertinoTimerPickerMode.hms:
case CupertinoTimerPickerMode.ms:
case CupertinoTimerPickerMode.ms:
break;
}
break;
}
scrollController: new FixedExtentScrollController(
initialItem: (int) (selectedMinute / widget.minuteInterval)
),
offAxisFraction: offAxisFraction,
itemExtent: CupertinoDatePickerUtils._kItemExtent,
backgroundColor: widget.backgroundColor,
squeeze: CupertinoDatePickerUtils._kSqueeze,
looping: true,
onSelectedItemChanged: (int index) => {
setState(() => {
selectedMinute = index * widget.minuteInterval;
widget.onTimerDurationChanged(
new TimeSpan(
hours: selectedHour == 0 ? 0 : selectedHour,
minutes: selectedMinute,
seconds: selectedSecond == 0 ? 0 : selectedSecond));
});
},
children: widgets
);
scrollController: new FixedExtentScrollController(
initialItem: (int)selectedMinute / widget.minuteInterval
),
offAxisFraction: offAxisFraction,
itemExtent: CupertinoDatePickerUtils._kItemExtent,
backgroundColor: widget.backgroundColor,
squeeze: CupertinoDatePickerUtils._kSqueeze,
looping: true,
onSelectedItemChanged: (int index) => {
setState(() =>{
selectedMinute = index * widget.minuteInterval;
widget.onTimerDurationChanged(
new TimeSpan(
hours: selectedHour == 0 ? 0 : selectedHour,
minutes: selectedMinute,
seconds: selectedSecond == 0 ? 0 : selectedSecond ));
});
},
children: CupertinoDatePickerUtils.listGenerate((int)(60 / widget.minuteInterval), (int index) => {
int minute = index * widget.minuteInterval;
string semanticsLabel = textDirectionFactor == 1
? localizations.timerPickerMinute(minute) + localizations.timerPickerMinuteLabel(minute)
: localizations.timerPickerMinuteLabel(minute) + localizations.timerPickerMinute(minute);
return _buildPickerNumberLabel(localizations.timerPickerMinute(minute), additionalPadding);
})
);
}
}
Widget _buildMinuteColumn(EdgeInsetsDirectional additionalPadding) {
Widget _buildMinuteColumn(EdgeInsetsDirectional additionalPadding) {
setState(()=> { lastSelectedMinute = selectedMinute; });
setState(() => { lastSelectedMinute = selectedMinute; });
return false;
},
child: _buildMinutePicker(additionalPadding)

),
}
);
}
Widget _buildSecondPicker(EdgeInsetsDirectional additionalPadding) {
float offAxisFraction = 0.5f * textDirectionFactor;
}
Widget _buildSecondPicker(EdgeInsetsDirectional additionalPadding) {
float offAxisFraction = 0.5f * textDirectionFactor;
scrollController: new FixedExtentScrollController(
initialItem: (int)(selectedSecond / widget.secondInterval)
),
offAxisFraction: offAxisFraction,
itemExtent: CupertinoDatePickerUtils._kItemExtent,
backgroundColor: widget.backgroundColor,
squeeze: CupertinoDatePickerUtils._kSqueeze,
looping: true,
onSelectedItemChanged: (int index) =>{
setState(()=> {
selectedSecond = index * widget.secondInterval;
widget.onTimerDurationChanged(
new TimeSpan(
hours: selectedHour == 0 ? 0 : selectedHour,
minutes: selectedMinute,
seconds: selectedSecond));
});
},
children: CupertinoDatePickerUtils.listGenerate((int)60 / widget.secondInterval, (int index)=> {
int second = index * widget.secondInterval;
string semanticsLabel = textDirectionFactor == 1
? localizations.timerPickerSecond(second) + localizations.timerPickerSecondLabel(second)
: localizations.timerPickerSecondLabel(second) + localizations.timerPickerSecond(second);
scrollController: new FixedExtentScrollController(
initialItem: (int) selectedSecond / widget.secondInterval
),
offAxisFraction: offAxisFraction,
itemExtent: CupertinoDatePickerUtils._kItemExtent,
backgroundColor: widget.backgroundColor,
squeeze: CupertinoDatePickerUtils._kSqueeze,
looping: true,
onSelectedItemChanged: (int index)=> {
setState(() => {
selectedSecond = index * widget.secondInterval;
widget.onTimerDurationChanged(
new TimeSpan(
hours: selectedHour == 0 ? 0 : selectedHour,
minutes: selectedMinute,
seconds: selectedSecond));
});
},
children: CupertinoDatePickerUtils.listGenerate((int) (60 / widget.secondInterval), (int index)=> {
int second = index * widget.secondInterval;
return _buildPickerNumberLabel(localizations.timerPickerSecond(second), additionalPadding);
})
);
}
Widget _buildSecondColumn(EdgeInsetsDirectional additionalPadding) {
string semanticsLabel = textDirectionFactor == 1
? localizations.timerPickerSecond(second) + localizations.timerPickerSecondLabel(second)
: localizations.timerPickerSecondLabel(second) + localizations.timerPickerSecond(second);
return _buildPickerNumberLabel(localizations.timerPickerSecond(second), additionalPadding);
})
);
}
Widget _buildSecondColumn(EdgeInsetsDirectional additionalPadding) {
children: new List<Widget>{
new NotificationListener<ScrollEndNotification>(
onNotification: (ScrollEndNotification notification)=> {
setState(()=> { lastSelectedSecond = selectedSecond; });
return false;
children: new List<Widget>{
new NotificationListener<ScrollEndNotification>(
onNotification: (ScrollEndNotification notification)=> {
setState(() => { lastSelectedSecond = selectedSecond; });
return false;
},
child: _buildSecondPicker(additionalPadding)
),

)
}
);
}
TextStyle _textStyleFrom(BuildContext context) {
}
TextStyle _textStyleFrom(BuildContext context) {
.pickerTextStyle.merge(
new TextStyle(
fontSize: CupertinoDatePickerUtils._kTimerPickerNumberLabelFontSize
)
);
}
.pickerTextStyle.merge(
new TextStyle(
fontSize: CupertinoDatePickerUtils._kTimerPickerNumberLabelFontSize
)
);
}
public override Widget build(BuildContext context) {
List<Widget> columns = new List<Widget>();
float paddingValue = CupertinoDatePickerUtils._kPickerWidth - 2 * CupertinoDatePickerUtils._kTimerPickerColumnIntrinsicWidth - 2 * CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding;
float totalWidth = CupertinoDatePickerUtils._kPickerWidth;
D.assert(paddingValue >= 0);
public override Widget build(BuildContext context) {
List<Widget> columns = new List<Widget>();
float paddingValue = CupertinoDatePickerUtils._kPickerWidth -
2 * CupertinoDatePickerUtils._kTimerPickerColumnIntrinsicWidth - 2 * CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding;
float totalWidth = CupertinoDatePickerUtils._kPickerWidth;
D.assert(paddingValue >= 0);
switch (widget.mode) {
case CupertinoTimerPickerMode.hm:
columns = new List<Widget>{
_buildHourColumn(EdgeInsetsDirectional.only(start: paddingValue / 2, end: CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding)),
_buildMinuteColumn(EdgeInsetsDirectional.only(start:CupertinoDatePickerUtils. _kTimerPickerHalfColumnPadding, end: paddingValue / 2)),};
break;
case CupertinoTimerPickerMode.ms:
columns = new List<Widget>{
_buildMinuteColumn(EdgeInsetsDirectional.only(start: paddingValue / 2, end: CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding)),
_buildSecondColumn(EdgeInsetsDirectional.only(start: CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding, end: paddingValue / 2)),
};
break;
case CupertinoTimerPickerMode.hms:
float _paddingValue = CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding * 2;
totalWidth = CupertinoDatePickerUtils._kTimerPickerColumnIntrinsicWidth * 3 + 4 * CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding + _paddingValue;
columns = new List<Widget>{
_buildHourColumn(EdgeInsetsDirectional.only(start: _paddingValue / 2, end: CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding)),
_buildMinuteColumn(EdgeInsetsDirectional.only(start: CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding, end: CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding)),
_buildSecondColumn(EdgeInsetsDirectional.only(start: CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding, end: _paddingValue / 2)),
switch (widget.mode) {
case CupertinoTimerPickerMode.hm:
// Pad the widget to make it as wide as `_kPickerWidth`.
columns = new List<Widget>{
_buildHourColumn( EdgeInsetsDirectional.only(start: paddingValue / 2, end: CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding)),
_buildMinuteColumn( EdgeInsetsDirectional.only(start: CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding, end: paddingValue / 2)),
};
break;
case CupertinoTimerPickerMode.ms:
// Pad the widget to make it as wide as `_kPickerWidth`.
columns = new List<Widget>{
_buildMinuteColumn( EdgeInsetsDirectional.only(start: paddingValue / 2, end: CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding)),
_buildSecondColumn( EdgeInsetsDirectional.only(start: CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding, end: paddingValue / 2)),
};
break;
case CupertinoTimerPickerMode.hms:
float _paddingValue = CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding * 2;
totalWidth = CupertinoDatePickerUtils._kTimerPickerColumnIntrinsicWidth * 3 + 4 * CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding + _paddingValue;
columns = new List<Widget>{
_buildHourColumn( EdgeInsetsDirectional.only(start: _paddingValue / 2, end: CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding)),
_buildMinuteColumn( EdgeInsetsDirectional.only(start: CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding, end: CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding)),
_buildSecondColumn( EdgeInsetsDirectional.only(start: CupertinoDatePickerUtils._kTimerPickerHalfColumnPadding, end: _paddingValue / 2)),
break;
break;
CupertinoThemeData themeData = CupertinoTheme.of(context);
List<Widget> results = new List<Widget>();
foreach (var result in columns.Select((Widget child) => new Expanded(child: child)).ToList()) {
results.Add((Widget)result);
}
CupertinoThemeData themeData = CupertinoTheme.of(context);
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0f),
child: new CupertinoTheme(
data: themeData.copyWith(
textTheme: themeData.textTheme.copyWith(pickerTextStyle: _textStyleFrom(context))
),
child: new Align(
alignment: widget.alignment,
child: new Container(
color: CupertinoDynamicColor.resolve(widget.backgroundColor, context),
width: totalWidth,
height: CupertinoDatePickerUtils._kPickerHeight,
child: new DefaultTextStyle(
style: _textStyleFrom(context),
child: new Row(children: results
)
)
)
// The native iOS picker's text scaling is fixed, so we will also fix it
// as well in our picker.
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0f),
child: new CupertinoTheme(
data: themeData.copyWith(
textTheme: themeData.textTheme.copyWith(
pickerTextStyle: _textStyleFrom(context)
)
),
child: new Align(
alignment: widget.alignment,
child: new Container(
color: CupertinoDynamicColor.resolve(widget.backgroundColor, context),
width: totalWidth,
height: CupertinoDatePickerUtils._kPickerHeight,
child: new DefaultTextStyle(
style: _textStyleFrom(context),
child: new Row(
children:
columns.Select((Widget child) => {
var result = new Expanded(child: child);
return (Widget) result;
}).ToList()
)
)
)
}
}
}
}

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


}
}
/*class _DialogActionButtonParentData : MultiChildLayoutParentData {
public _DialogActionButtonParentData(
bool isPressed = false
) {
this.isPressed = isPressed;
}
public bool isPressed;
}*/
public class CupertinoDialogAction : StatelessWidget {
public CupertinoDialogAction(
Key key = null,

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


data: iconTheme,
child: new DefaultTextStyle(
style: textStyle,
child: child /*Semantics(
button: true,
inMutuallyExclusiveGroup: true,
selected: widget.groupValue.Equals(currentKey),
child: child
)*/
child: child
)
)
);

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


void _handleTap() {
if (isInteractive) {
widget.onChanged(!widget.value);
//_emitVibration();
}
}

if (isInteractive) {
needsPositionAnimation = false;
_reactionController.forward();
//_emitVibration();
}
}

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


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.foundation;

List<NavigatorObserver> navigatorObservers = null,
TransitionBuilder builder = null,
string title = "",
GenerateAppTitle onGenerateTitle = null,
Color color = null,
ThemeData theme = null,
ThemeData darkTheme = null,

this.navigatorObservers = navigatorObservers ?? new List<NavigatorObserver>();
this.builder = builder;
this.title = title;
this.onGenerateTitle = onGenerateTitle;
this.color = color;
this.theme = theme;
this.darkTheme = darkTheme;

public readonly string title;
public readonly GenerateAppTitle onGenerateTitle;
public readonly ThemeData theme;
public readonly ThemeData darkTheme;

);
},
textStyle: material_._errorTextStyle,
title: widget.title,
onGenerateTitle: widget.onGenerateTitle,
color: widget.color ?? widget.theme?.primaryColor ?? Colors.blue,
locale: widget.locale,
localizationsDelegates: _localizationsDelegates,
localeResolutionCallback: widget.localeResolutionCallback,

4
com.unity.uiwidgets/Runtime/material/divider.cs


child: new Container(
height: thickness,
//TODO: update to EdgeInsetsGeometry
/*margin: EdgeInsetsDirectional.only(start: indent,
end: endIndent),*/
margin: EdgeInsetsDirectional.only(start: indent,
end: endIndent),
decoration: new BoxDecoration(
border: new Border(
bottom: createBorderSide(context, color: color, width: thickness))

2
com.unity.uiwidgets/Runtime/material/navigation_rail_theme.cs


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

5
com.unity.uiwidgets/Runtime/material/pickers/date_picker_head.cs


new Container(
height: DatePickerHeaderUtils._datePickerHeaderPortraitHeight,
color: primarySurfaceColor,
//FixMe: uncomment this after EdgeInsetsGeometry is ready for use
/*padding: EdgeInsetsDirectional.only(
padding: EdgeInsetsDirectional.only(
),*/
),
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: new List<Widget> {

69
com.unity.uiwidgets/Runtime/material/theme_data.cs


using System.Collections.Generic;
using System.Linq;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

Color bottomAppBarColor = null,
Color cardColor = null,
Color dividerColor = null,
Color focusColor = null,
Color hoverColor = null,
Color highlightColor = null,
Color splashColor = null,
InteractiveInkFeatureFactory splashFactory = null,

Color buttonColor = null,
ButtonThemeData buttonTheme = null,
ToggleButtonsThemeData toggleButtonsTheme = null,
Color secondaryHeaderColor = null,
Color textSelectionColor = null,
Color cursorColor = null,

IconThemeData accentIconTheme = null,
SliderThemeData sliderTheme = null,
TabBarTheme tabBarTheme = null,
TooltipThemeData tooltipTheme = null,
CardTheme cardTheme = null,
ChipThemeData chipTheme = null,
RuntimePlatform? platform = null,

ColorScheme colorScheme = null,
DialogTheme dialogTheme = null,
FloatingActionButtonThemeData floatingActionButtonTheme = null,
NavigationRailThemeData navigationRailTheme = null,
Typography typography = null,
SnackBarThemeData snackBarTheme = null,
BottomSheetThemeData bottomSheetTheme = null,

}
buttonColor = buttonColor ?? (isDark ? primarySwatch[600] : Colors.grey[300]);
focusColor = focusColor ??(isDark ? Colors.white.withOpacity(0.12f) : Colors.black.withOpacity(0.12f));
hoverColor = hoverColor ??(isDark ? Colors.white.withOpacity(0.04f) : Colors.black.withOpacity(0.04f));
focusColor: focusColor,
hoverColor: hoverColor,
disabledColor = disabledColor ?? (isDark ? Colors.white30 : Colors.black38);
toggleButtonsTheme = toggleButtonsTheme?? new ToggleButtonsThemeData();
disabledColor = disabledColor ?? (isDark ? Colors.white38 : Colors.black38);
highlightColor = highlightColor ??
(isDark
? material_._kDarkThemeHighlightColor

valueIndicatorTextStyle: accentTextTheme.body2);
tabBarTheme = tabBarTheme ?? new TabBarTheme();
tooltipTheme = tooltipTheme ?? new TooltipThemeData();
labelStyle: textTheme.body2
labelStyle: textTheme.bodyText1
navigationRailTheme = navigationRailTheme ?? new NavigationRailThemeData();
snackBarTheme = snackBarTheme ?? new SnackBarThemeData();
bottomSheetTheme = bottomSheetTheme ?? new BottomSheetThemeData();
popupMenuTheme = popupMenuTheme ?? new PopupMenuThemeData();

this.bottomAppBarColor = bottomAppBarColor;
this.cardColor = cardColor;
this.dividerColor = dividerColor;
this.focusColor = focusColor;
this.hoverColor = hoverColor;
this.highlightColor = highlightColor;
this.splashColor = splashColor;
this.splashFactory = splashFactory;

this.buttonTheme = buttonTheme;
this.toggleButtonsTheme = toggleButtonsTheme;
this.buttonColor = buttonColor;
this.secondaryHeaderColor = secondaryHeaderColor;
this.textSelectionColor = textSelectionColor;

this.accentIconTheme = accentIconTheme;
this.sliderTheme = sliderTheme;
this.tabBarTheme = tabBarTheme;
this.tooltipTheme = tooltipTheme;
this.cardTheme = cardTheme;
this.chipTheme = chipTheme;
this.platform = platform.Value;

this.colorScheme = colorScheme;
this.dialogTheme = dialogTheme;
this.floatingActionButtonTheme = floatingActionButtonTheme;
this.navigationRailTheme = navigationRailTheme;
this.typography = typography;
this.snackBarTheme = snackBarTheme;
this.bottomSheetTheme = bottomSheetTheme;

Color bottomAppBarColor = null,
Color cardColor = null,
Color dividerColor = null,
Color focusColor = null,
Color hoverColor = null,
Color highlightColor = null,
Color splashColor = null,
InteractiveInkFeatureFactory splashFactory = null,

ButtonThemeData buttonTheme = null,
Color buttonColor = null,
ToggleButtonsThemeData toggleButtonsTheme = null,
Color secondaryHeaderColor = null,
Color textSelectionColor = null,
Color cursorColor = null,

IconThemeData primaryIconTheme = null,
IconThemeData accentIconTheme = null,
TabBarTheme tabBarTheme = null,
TooltipThemeData tooltipTheme = null,
CardTheme cardTheme = null,
ChipThemeData chipTheme = null,
RuntimePlatform? platform = null,

ColorScheme colorScheme = null,
DialogTheme dialogTheme = null,
FloatingActionButtonThemeData floatingActionButtonTheme = null,
NavigationRailThemeData navigationRailTheme = null,
Typography typography = null,
SnackBarThemeData snackBarTheme = null,
BottomSheetThemeData bottomSheetTheme = null,

D.assert(bottomAppBarColor != null);
D.assert(cardColor != null);
D.assert(dividerColor != null);
D.assert(focusColor != null);
D.assert(hoverColor != null);
D.assert(highlightColor != null);
D.assert(splashColor != null);
D.assert(splashFactory != null);

D.assert(toggleableActiveColor != null);
D.assert(buttonTheme != null);
D.assert(toggleButtonsTheme != null);
D.assert(secondaryHeaderColor != null);
D.assert(textSelectionColor != null);
D.assert(cursorColor != null);

D.assert(typography != null);
D.assert(buttonColor != null);
D.assert(tabBarTheme != null);
D.assert(tooltipTheme != null);
D.assert(navigationRailTheme != null);
D.assert(snackBarTheme != null);
D.assert(bottomSheetTheme != null);
D.assert(popupMenuTheme != null);

return new ThemeData(
brightness: brightness,
visualDensity: visualDensity,
primaryColor: primaryColor,
primaryColorBrightness: primaryColorBrightness,
primaryColorLight: primaryColorLight,

bottomAppBarColor: bottomAppBarColor,
cardColor: cardColor,
dividerColor: dividerColor,
focusColor: focusColor,
hoverColor: hoverColor,
highlightColor: highlightColor,
splashColor: splashColor,
splashFactory: splashFactory,

buttonTheme: buttonTheme,
buttonColor: buttonColor,
toggleButtonsTheme: toggleButtonsTheme,
toggleableActiveColor: toggleableActiveColor,
secondaryHeaderColor: secondaryHeaderColor,
textSelectionColor: textSelectionColor,

accentIconTheme: accentIconTheme,
sliderTheme: sliderTheme,
tabBarTheme: tabBarTheme,
tooltipTheme:tooltipTheme,
cardTheme: cardTheme,
chipTheme: chipTheme,
platform: platform,

colorScheme: colorScheme,
dialogTheme: dialogTheme,
floatingActionButtonTheme: floatingActionButtonTheme,
navigationRailTheme: navigationRailTheme,
typography: typography,
snackBarTheme: snackBarTheme,
bottomSheetTheme: bottomSheetTheme,

Color bottomAppBarColor = null,
Color cardColor = null,
Color dividerColor = null,
Color focusColor = null,
Color hoverColor = null,
Color highlightColor = null,
Color splashColor = null,
InteractiveInkFeatureFactory splashFactory = null,

ButtonThemeData buttonTheme = null,
ToggleButtonsThemeData toggleButtonsTheme = null,
Color buttonColor = null,
Color secondaryHeaderColor = null,
Color textSelectionColor = null,

IconThemeData primaryIconTheme = null,
IconThemeData accentIconTheme = null,
TabBarTheme tabBarTheme = null,
TooltipThemeData tooltipTheme = null,
CardTheme cardTheme = null,
ChipThemeData chipTheme = null,
RuntimePlatform? platform = null,

ColorScheme colorScheme = null,
DialogTheme dialogTheme = null,
FloatingActionButtonThemeData floatingActionButtonTheme = null,
NavigationRailThemeData navigationRailTheme = null,
Typography typography = null,
SnackBarThemeData snackBarTheme = null,
BottomSheetThemeData bottomSheetTheme = null,

bottomAppBarColor: bottomAppBarColor ?? this.bottomAppBarColor,
cardColor: cardColor ?? this.cardColor,
dividerColor: dividerColor ?? this.dividerColor,
focusColor: focusColor ?? this.focusColor,
hoverColor: hoverColor ?? this.hoverColor,
highlightColor: highlightColor ?? this.highlightColor,
splashColor: splashColor ?? this.splashColor,
splashFactory: splashFactory ?? this.splashFactory,

buttonTheme: buttonTheme ?? this.buttonTheme,
toggleButtonsTheme: toggleButtonsTheme ?? this.toggleButtonsTheme,
buttonColor: buttonColor ?? this.buttonColor,
secondaryHeaderColor: secondaryHeaderColor ?? this.secondaryHeaderColor,
textSelectionColor: textSelectionColor ?? this.textSelectionColor,

primaryIconTheme: primaryIconTheme ?? this.primaryIconTheme,
accentIconTheme: accentIconTheme ?? this.accentIconTheme,
tabBarTheme: tabBarTheme ?? this.tabBarTheme,
tooltipTheme: tooltipTheme ?? this.tooltipTheme,
cardTheme: cardTheme ?? this.cardTheme,
chipTheme: chipTheme ?? this.chipTheme,
platform: platform ?? this.platform,

colorScheme: colorScheme ?? this.colorScheme,
dialogTheme: dialogTheme ?? this.dialogTheme,
floatingActionButtonTheme: floatingActionButtonTheme ?? this.floatingActionButtonTheme,
navigationRailTheme: navigationRailTheme ?? this.navigationRailTheme,
typography: typography ?? this.typography,
snackBarTheme: snackBarTheme ?? this.snackBarTheme,
bottomSheetTheme: bottomSheetTheme ?? this.bottomSheetTheme,

bottomAppBarColor: Color.lerp(a.bottomAppBarColor, b.bottomAppBarColor, t),
cardColor: Color.lerp(a.cardColor, b.cardColor, t),
dividerColor: Color.lerp(a.dividerColor, b.dividerColor, t),
focusColor: Color.lerp(a.focusColor, b.focusColor, t),
hoverColor: Color.lerp(a.hoverColor, b.hoverColor, t),
highlightColor: Color.lerp(a.highlightColor, b.highlightColor, t),
splashColor: Color.lerp(a.splashColor, b.splashColor, t),
splashFactory: t < 0.5 ? a.splashFactory : b.splashFactory,

buttonTheme: t < 0.5 ? a.buttonTheme : b.buttonTheme,
toggleButtonsTheme: ToggleButtonsThemeData.lerp(a.toggleButtonsTheme, b.toggleButtonsTheme, t),
buttonColor: Color.lerp(a.buttonColor, b.buttonColor, t),
secondaryHeaderColor: Color.lerp(a.secondaryHeaderColor, b.secondaryHeaderColor, t),
textSelectionColor: Color.lerp(a.textSelectionColor, b.textSelectionColor, t),

accentIconTheme: IconThemeData.lerp(a.accentIconTheme, b.accentIconTheme, t),
sliderTheme: SliderThemeData.lerp(a.sliderTheme, b.sliderTheme, t),
tabBarTheme: TabBarTheme.lerp(a.tabBarTheme, b.tabBarTheme, t),
tooltipTheme: TooltipThemeData.lerp(a.tooltipTheme, b.tooltipTheme, t),
cardTheme: CardTheme.lerp(a.cardTheme, b.cardTheme, t),
chipTheme: ChipThemeData.lerp(a.chipTheme, b.chipTheme, t),
platform: t < 0.5 ? a.platform : b.platform,

dialogTheme: DialogTheme.lerp(a.dialogTheme, b.dialogTheme, t),
floatingActionButtonTheme: FloatingActionButtonThemeData.lerp(a.floatingActionButtonTheme,
b.floatingActionButtonTheme, t),
navigationRailTheme: NavigationRailThemeData.lerp(a.navigationRailTheme, b.navigationRailTheme, t),
typography: Typography.lerp(a.typography, b.typography, t),
snackBarTheme: SnackBarThemeData.lerp(a.snackBarTheme, b.snackBarTheme, t),
bottomSheetTheme: BottomSheetThemeData.lerp(a.bottomSheetTheme, b.bottomSheetTheme, t),

other.bottomAppBarColor == bottomAppBarColor &&
other.cardColor == cardColor &&
other.dividerColor == dividerColor &&
other.focusColor == focusColor &&
other.hoverColor == hoverColor &&
other.highlightColor == highlightColor &&
other.splashColor == splashColor &&
other.splashFactory == splashFactory &&

other.buttonTheme == buttonTheme &&
other.toggleButtonsTheme == toggleButtonsTheme &&
other.buttonColor == buttonColor &&
other.secondaryHeaderColor == secondaryHeaderColor &&
other.textSelectionColor == textSelectionColor &&

other.primaryIconTheme == primaryIconTheme &&
other.accentIconTheme == accentIconTheme &&
other.tabBarTheme == tabBarTheme &&
other.tooltipTheme == tooltipTheme &&
other.cardTheme == cardTheme &&
other.chipTheme == chipTheme &&
other.platform == platform &&

other.colorScheme == colorScheme &&
other.dialogTheme == dialogTheme &&
other.floatingActionButtonTheme == floatingActionButtonTheme &&
other.navigationRailTheme == navigationRailTheme &&
other.typography == typography &&
other.snackBarTheme == snackBarTheme &&
other.bottomSheetTheme == bottomSheetTheme &&

hashCode = (hashCode * 397) ^ bottomAppBarColor.GetHashCode();
hashCode = (hashCode * 397) ^ cardColor.GetHashCode();
hashCode = (hashCode * 397) ^ dividerColor.GetHashCode();
hashCode = (hashCode * 397) ^ focusColor.GetHashCode();
hashCode = (hashCode * 397) ^ hoverColor.GetHashCode();
hashCode = (hashCode * 397) ^ highlightColor.GetHashCode();
hashCode = (hashCode * 397) ^ splashColor.GetHashCode();
hashCode = (hashCode * 397) ^ splashFactory.GetHashCode();

hashCode = (hashCode * 397) ^ buttonTheme.GetHashCode();
hashCode = (hashCode * 397) ^ toggleButtonsTheme.GetHashCode();
hashCode = (hashCode * 397) ^ buttonColor.GetHashCode();
hashCode = (hashCode * 397) ^ secondaryHeaderColor.GetHashCode();
hashCode = (hashCode * 397) ^ textSelectionColor.GetHashCode();

hashCode = (hashCode * 397) ^ accentIconTheme.GetHashCode();
hashCode = (hashCode * 397) ^ sliderTheme.GetHashCode();
hashCode = (hashCode * 397) ^ tabBarTheme.GetHashCode();
hashCode = (hashCode * 397) ^ tooltipTheme.GetHashCode();
hashCode = (hashCode * 397) ^ cardTheme.GetHashCode();
hashCode = (hashCode * 397) ^ chipTheme.GetHashCode();
hashCode = (hashCode * 397) ^ platform.GetHashCode();

hashCode = (hashCode * 397) ^ colorScheme.GetHashCode();
hashCode = (hashCode * 397) ^ dialogTheme.GetHashCode();
hashCode = (hashCode * 397) ^ floatingActionButtonTheme.GetHashCode();
hashCode = (hashCode * 397) ^ navigationRailTheme.GetHashCode();
hashCode = (hashCode * 397) ^ typography.GetHashCode();
hashCode = (hashCode * 397) ^ snackBarTheme.GetHashCode();
hashCode = (hashCode * 397) ^ bottomSheetTheme.GetHashCode();

defaultValue: defaultData.cardColor));
properties.add(new DiagnosticsProperty<Color>("dividerColor", dividerColor,
defaultValue: defaultData.dividerColor));
properties.add(new ColorProperty("focusColor", focusColor, defaultValue: defaultData.focusColor, level: DiagnosticLevel.debug));
properties.add(new ColorProperty("hoverColor", hoverColor, defaultValue: defaultData.hoverColor, level: DiagnosticLevel.debug));
properties.add(new DiagnosticsProperty<Color>("highlightColor", highlightColor,
defaultValue: defaultData.highlightColor));
properties.add(new DiagnosticsProperty<Color>("splashColor", splashColor,

properties.add(new DiagnosticsProperty<Color>("disabledColor", disabledColor,
defaultValue: defaultData.disabledColor));
properties.add(new DiagnosticsProperty<ButtonThemeData>("buttonTheme", buttonTheme));
properties.add(new DiagnosticsProperty<ToggleButtonsThemeData>("toggleButtonsTheme", toggleButtonsTheme, level: DiagnosticLevel.debug));
properties.add(new DiagnosticsProperty<Color>("buttonColor", buttonColor,
defaultValue: defaultData.buttonColor));
properties.add(new DiagnosticsProperty<Color>("secondaryHeaderColor", secondaryHeaderColor,

properties.add(new DiagnosticsProperty<IconThemeData>("accentIconTheme", accentIconTheme));
properties.add(new DiagnosticsProperty<SliderThemeData>("sliderTheme", sliderTheme));
properties.add(new DiagnosticsProperty<TabBarTheme>("tabBarTheme", tabBarTheme));
properties.add(new DiagnosticsProperty<TooltipThemeData>("tooltipTheme", tooltipTheme, level: DiagnosticLevel.debug));
properties.add(new DiagnosticsProperty<CardTheme>("cardTheme", cardTheme));
properties.add(new DiagnosticsProperty<ChipThemeData>("chipTheme", chipTheme));
properties.add(

defaultValue: defaultData.dialogTheme));
properties.add(new DiagnosticsProperty<FloatingActionButtonThemeData>("floatingActionButtonTheme",
floatingActionButtonTheme, defaultValue: defaultData.floatingActionButtonTheme));
properties.add(new DiagnosticsProperty<NavigationRailThemeData>("navigationRailThemeData", navigationRailTheme, defaultValue: defaultData.navigationRailTheme, level: DiagnosticLevel.debug));
properties.add(new DiagnosticsProperty<Typography>("typography", typography,
defaultValue: defaultData.typography));
properties.add(new DiagnosticsProperty<SnackBarThemeData>("snackBarTheme", snackBarTheme, defaultValue: defaultData.snackBarTheme, level: DiagnosticLevel.debug));

4
com.unity.uiwidgets/Runtime/painting/basic_types.cs


Axis axis,
bool reverse) {
switch (axis) {
/*case Axis.horizontal:
return reverse ? AxisDirection.left : AxisDirection.right;
case Axis.vertical:
return reverse ? AxisDirection.up : AxisDirection.down;*/
case Axis.horizontal:
D.assert(WidgetsD.debugCheckHasDirectionality(context));
TextDirection textDirection = Directionality.of(context);

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


return true;
}
return Equals(image, other.image) && scale.Equals(other.scale);
return image.Equals(other.image) && scale.Equals(other.scale);
}
public override bool Equals(object obj) {

9
com.unity.uiwidgets/Runtime/rendering/binding.cs


}
readonly protected bool inEditorWindow;
/* MouseTracker _createMouseTracker() {
return new MouseTracker(pointerRouter, (Offset offset) => {
return renderView.layer.find<MouseTrackerAnnotation>(
offset
);
}, inEditorWindow);
}*/
protected virtual void drawFrame() {
D.assert(renderView != null);

41
com.unity.uiwidgets/Runtime/rendering/layer.cs


}
}
/*internal override S find<S>(Offset regionOffset) {
return null;
}*/
public override void addToScene(SceneBuilder builder, Offset layerOffset = null) {
layerOffset = layerOffset ?? Offset.zero;
builder.addPicture(layerOffset, picture,

}
/*internal override S find<S>(Offset regionOffset) {
Layer current = lastChild;
while (current != null) {
S value = current.find<S>(regionOffset);
if (value != null) {
return value;
}
current = current.previousSibling;
}
return null;
}*/
public override bool findAnnotations<S>(
AnnotationResult<S> result,
Offset localPosition,

base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<Offset>("offset", offset));
}
/*public Scene buildScene(SceneBuilder builder) {
List<PictureLayer> temporaryLayers = null;
D.assert(() => {
if (RenderingDebugUtils.debugCheckElevationsEnabled) {
temporaryLayers = _debugCheckElevations();
}
return true;
});
updateSubtreeNeedsAddToScene();
addToScene(builder);
Scene scene = builder.build();
D.assert(() => {
if (temporaryLayers != null) {
foreach (PictureLayer temporaryLayer in temporaryLayers) {
temporaryLayer.remove();
}
}
return true;
});
return scene;
}*/
public Future<ui.Image> toImage(Rect bounds, float pixelRatio = 1.0f)// async
{

6
com.unity.uiwidgets/Runtime/rendering/list_wheel_viewport.cs


untransformedPaintingCoordinates.dx,
-_topScrollMarginExtent
);
bool shouldApplyOffCenterDim = overAndUnderCenterOpacity < 1;
if (useMagnifier || shouldApplyOffCenterDim) {
_paintChildWithMagnifier(context, offset, child, transform, offsetToCenter, untransformedPaintingCoordinates);

context1.pushTransform(
needsCompositing,
offset1,
cylindricalTransform,
// this._centerOriginTransform(cylindricalTransform),
_magnifyTransform(),
(PaintingContext context2, Offset offset2) => {
context2.paintChild(child, offset2 + untransformedPaintingCoordinates);
});

46
com.unity.uiwidgets/Runtime/rendering/paragraph.cs


bool _hasHoverRecognizer;
MouseTrackerAnnotation _hoverAnnotation;
/*void _resetHoverHandler() {
_hasHoverRecognizer = (_textPainter.text as TextSpan)?.hasHoverRecognizer ?? false;
_previousHoverSpan = null;
_pointerHoverInside = false;
if (_hoverAnnotation != null && attached) {
RendererBinding.instance.mouseTracker.detachAnnotation(_hoverAnnotation);
}
if (_hasHoverRecognizer) {
_hoverAnnotation = new MouseTrackerAnnotation(
onEnter: _onPointerEnter,
onHover: _onPointerHover,
onExit: _onPointerExit);
if (attached) {
RendererBinding.instance.mouseTracker.attachAnnotation(_hoverAnnotation);
}
}
else {
_hoverAnnotation = null;
}
}*/
void _handleKeyEvent(RawKeyEvent keyEvent) {
//only allow KCommand.copy

}
base.detach();
/*if (_hoverAnnotation != null) {
RendererBinding.instance.mouseTracker.dispose();//detachAnnotation(_hoverAnnotation);
}*/
}
TextSelection _selection;

_pointerHoverInside = true;
}
/*void _onPointerExit(PointerEvent evt) {
_pointerHoverInside = false;
(_previousHoverSpan as TextSpan)?.hoverRecognizer?.OnPointerLeave?.Invoke();
_previousHoverSpan = null;
}*/
/*void _onPointerHover(PointerEvent evt) {
_layoutTextWithConstraints(constraints);
Offset offset = globalToLocal(evt.position);
TextPosition position = _textPainter.getPositionForOffset(offset);
InlineSpan span = _textPainter.text.getSpanForPosition(position);
if (_previousHoverSpan != span) {
(_previousHoverSpan as TextSpan)?.hoverRecognizer?.OnPointerLeave?.Invoke();
(span as TextSpan)?.hoverRecognizer?.OnPointerEnter?.Invoke((PointerHoverEvent) evt);
_previousHoverSpan = span;
}
}*/
public override void handleEvent(PointerEvent evt, HitTestEntry entry) {
D.assert(debugHandleEvent(evt, entry));

311
com.unity.uiwidgets/Runtime/rendering/proxy_box.cs


public delegate void PointerScrollEventListener(PointerScrollEvent evt);
/*public class RenderPointerListener : RenderProxyBoxWithHitTestBehavior {
public RenderPointerListener(
PointerDownEventListener onPointerDown = null,
PointerMoveEventListener onPointerMove = null,
PointerEnterEventListener onPointerEnter = null,
PointerHoverEventListener onPointerHover = null,
PointerExitEventListener onPointerExit = null,
PointerUpEventListener onPointerUp = null,
PointerCancelEventListener onPointerCancel = null,
PointerSignalEventListener onPointerSignal = null,
PointerScrollEventListener onPointerScroll = null,
PointerDragFromEditorEnterEventListener onPointerDragFromEditorEnter = null,
PointerDragFromEditorHoverEventListener onPointerDragFromEditorHover = null,
PointerDragFromEditorExitEventListener onPointerDragFromEditorExit = null,
PointerDragFromEditorReleaseEventListener onPointerDragFromEditorRelease = null,
HitTestBehavior behavior = HitTestBehavior.deferToChild,
RenderBox child = null
) : base(behavior: behavior, child: child) {
this.onPointerDown = onPointerDown;
this.onPointerMove = onPointerMove;
this.onPointerUp = onPointerUp;
this.onPointerCancel = onPointerCancel;
this.onPointerSignal = onPointerSignal;
this.onPointerScroll = onPointerScroll;
_onPointerEnter = onPointerEnter;
_onPointerHover = onPointerHover;
_onPointerExit = onPointerExit;
_onPointerDragFromEditorEnter = onPointerDragFromEditorEnter;
_onPointerDragFromEditorHover = onPointerDragFromEditorHover;
_onPointerDragFromEditorExit = onPointerDragFromEditorExit;
_onPointerDragFromEditorRelease = onPointerDragFromEditorRelease;
if (_onPointerEnter != null ||
_onPointerHover != null ||
_onPointerExit != null ||
_onPointerDragFromEditorEnter != null ||
_onPointerDragFromEditorHover != null ||
_onPointerDragFromEditorExit != null ||
_onPointerDragFromEditorRelease != null
) {
_hoverAnnotation = new MouseTrackerAnnotation(
onEnter: _onPointerEnter,
onHover: _onPointerHover,
onExit: _onPointerExit,
onDragFromEditorEnter: _onPointerDragFromEditorEnter,
onDragFromEditorHover: _onPointerDragFromEditorHover,
onDragFromEditorExit: _onPointerDragFromEditorExit,
onDragFromEditorRelease: _onPointerDragFromEditorRelease
);
}
}
PointerDragFromEditorEnterEventListener _onPointerDragFromEditorEnter;
public PointerDragFromEditorEnterEventListener onPointerDragFromEditorEnter {
get { return _onPointerDragFromEditorEnter; }
set {
if (_onPointerDragFromEditorEnter != value) {
_onPointerDragFromEditorEnter = value;
_updateAnnotations();
}
}
}
PointerDragFromEditorExitEventListener _onPointerDragFromEditorExit;
public PointerDragFromEditorExitEventListener onPointerDragFromEditorExit {
get { return _onPointerDragFromEditorExit; }
set {
if (_onPointerDragFromEditorExit != value) {
_onPointerDragFromEditorExit = value;
_updateAnnotations();
}
}
}
PointerDragFromEditorHoverEventListener _onPointerDragFromEditorHover;
public PointerDragFromEditorHoverEventListener onPointerDragFromEditorHover {
get { return _onPointerDragFromEditorHover; }
set {
if (_onPointerDragFromEditorHover != value) {
_onPointerDragFromEditorHover = value;
_updateAnnotations();
}
}
}
PointerDragFromEditorReleaseEventListener _onPointerDragFromEditorRelease;
public PointerDragFromEditorReleaseEventListener onPointerDragFromEditorRelease {
get { return _onPointerDragFromEditorRelease; }
set {
if (_onPointerDragFromEditorRelease != value) {
_onPointerDragFromEditorRelease = value;
_updateAnnotations();
}
}
}
public PointerEnterEventListener onPointerEnter {
get { return _onPointerEnter; }
set {
if (_onPointerEnter != value) {
_onPointerEnter = value;
_updateAnnotations();
}
}
}
PointerEnterEventListener _onPointerEnter;
public PointerHoverEventListener onPointerHover {
get { return _onPointerHover; }
set {
if (_onPointerHover != value) {
_onPointerHover = value;
_updateAnnotations();
}
}
}
PointerHoverEventListener _onPointerHover;
public PointerExitEventListener onPointerExit {
get { return _onPointerExit; }
set {
if (_onPointerExit != value) {
_onPointerExit = value;
_updateAnnotations();
}
}
}
PointerExitEventListener _onPointerExit;
public PointerDownEventListener onPointerDown;
public PointerMoveEventListener onPointerMove;
public PointerUpEventListener onPointerUp;
public PointerCancelEventListener onPointerCancel;
public PointerSignalEventListener onPointerSignal;
public PointerScrollEventListener onPointerScroll;
MouseTrackerAnnotation _hoverAnnotation;
public MouseTrackerAnnotation hoverAnnotation {
get { return _hoverAnnotation; }
}
void _updateAnnotations() {
D.assert(_onPointerEnter != _hoverAnnotation.onEnter ||
_onPointerHover != _hoverAnnotation.onHover ||
_onPointerExit != _hoverAnnotation.onExit
#if UNITY_EDITOR
|| _onPointerDragFromEditorEnter != _hoverAnnotation.onDragFromEditorEnter
|| _onPointerDragFromEditorHover != _hoverAnnotation.onDragFromEditorHover
|| _onPointerDragFromEditorExit != _hoverAnnotation.onDragFromEditorExit
|| _onPointerDragFromEditorRelease != _hoverAnnotation.onDragFromEditorRelease
#endif
, () => "Shouldn't call _updateAnnotations if nothing has changed.");
if (_hoverAnnotation != null && attached) {
RendererBinding.instance.mouseTracker.detachAnnotation(_hoverAnnotation);
}
if (_onPointerEnter != null ||
_onPointerHover != null ||
_onPointerExit != null
#if UNITY_EDITOR
|| _onPointerDragFromEditorEnter != null
|| _onPointerDragFromEditorHover != null
|| _onPointerDragFromEditorExit != null
|| _onPointerDragFromEditorRelease != null
#endif
) {
_hoverAnnotation = new MouseTrackerAnnotation(
onEnter: _onPointerEnter,
onHover: _onPointerHover,
onExit: _onPointerExit
#if UNITY_EDITOR
, onDragFromEditorEnter: _onPointerDragFromEditorEnter
, onDragFromEditorHover: _onPointerDragFromEditorHover
, onDragFromEditorExit: _onPointerDragFromEditorExit
, onDragFromEditorRelease: _onPointerDragFromEditorRelease
#endif
);
if (attached) {
RendererBinding.instance.mouseTracker.attachAnnotation(_hoverAnnotation);
}
}
else {
_hoverAnnotation = null;
}
markNeedsPaint();
}
public override void attach(object owner) {
base.attach(owner);
if (_hoverAnnotation != null) {
RendererBinding.instance.mouseTracker.attachAnnotation(_hoverAnnotation);
}
}
public override void detach() {
base.detach();
if (_hoverAnnotation != null) {
RendererBinding.instance.mouseTracker.detachAnnotation(_hoverAnnotation);
}
}
public override void paint(PaintingContext context, Offset offset) {
if (_hoverAnnotation != null) {
AnnotatedRegionLayer<MouseTrackerAnnotation> layer = new AnnotatedRegionLayer<MouseTrackerAnnotation>(
_hoverAnnotation, size: size, offset: offset);
context.pushLayer(layer, base.paint, offset);
}
else {
base.paint(context, offset);
}
}
protected override void performResize() {
size = constraints.biggest;
}
public override void handleEvent(PointerEvent evt, HitTestEntry entry) {
D.assert(debugHandleEvent(evt, entry));
if (onPointerDown != null && evt is PointerDownEvent) {
onPointerDown((PointerDownEvent) evt);
return;
}
if (onPointerMove != null && evt is PointerMoveEvent) {
onPointerMove((PointerMoveEvent) evt);
return;
}
if (onPointerUp != null && evt is PointerUpEvent) {
onPointerUp((PointerUpEvent) evt);
return;
}
if (onPointerCancel != null && evt is PointerCancelEvent) {
onPointerCancel((PointerCancelEvent) evt);
return;
}
if (onPointerSignal != null && evt is PointerSignalEvent) {
onPointerSignal((PointerSignalEvent) evt);
return;
}
if (onPointerScroll != null && evt is PointerScrollEvent) {
onPointerScroll((PointerScrollEvent) evt);
}
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
var listeners = new List<string>();
if (onPointerDown != null) {
listeners.Add("down");
}
if (onPointerMove != null) {
listeners.Add("move");
}
if (onPointerEnter != null) {
listeners.Add("enter");
}
if (onPointerHover != null) {
listeners.Add("hover");
}
if (onPointerExit != null) {
listeners.Add("exit");
}
if (onPointerUp != null) {
listeners.Add("up");
}
if (onPointerCancel != null) {
listeners.Add("cancel");
}
if (onPointerSignal != null) {
listeners.Add("signal");
}
if (listeners.isEmpty()) {
listeners.Add("<none>");
}
properties.add(new EnumerableProperty<string>("listeners", listeners));
}
}*/
class RenderPointerListener : RenderProxyBoxWithHitTestBehavior {
public RenderPointerListener(
PointerDownEventListener onPointerDown = null,

16
com.unity.uiwidgets/Runtime/rendering/proxy_sliver.cs


};
}
}
/*public class RenderSliverAnimatedOpacity : RenderProxySliver ,RenderAnimatedOpacityMixin<RenderSliver>{
public RenderSliverAnimatedOpacity(
Animation<double> opacity = null,
bool alwaysIncludeSemantics = false,
RenderSliver sliver = null
):base(sliver) {
D.assert(opacity != null);
D.assert(alwaysIncludeSemantics != null);
this.opacity = opacity;
this.alwaysIncludeSemantics = alwaysIncludeSemantics;
child = sliver;
}
}*/
}

2
com.unity.uiwidgets/Runtime/scheduler2/binding.cs


Completer _nextFrameCompleter;
Future endOfFrame {
public Future endOfFrame {
get {
if (_nextFrameCompleter == null) {
if (schedulerPhase == SchedulerPhase.idle)

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


using System.Runtime.InteropServices;
using System.Text;
using AOT;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using UnityEngine;

public int rowBytes;
}
public class Image : NativeWrapperDisposable {
public class Image : NativeWrapperDisposable, IEquatable<Image> {
internal Image(IntPtr ptr) : base(ptr) {
}

Debug.LogException(ex);
}
}
public override string ToString() => $"[{width}\u00D7{height}]";
[DllImport(NativeBindings.dllName)]

[DllImport(NativeBindings.dllName)]
static extern IntPtr Image_toByteData(IntPtr ptr, int format, Image_toByteDataCallback callback,
IntPtr callbackHandle);
public bool Equals(Image other) {
return other != null && width == other.width && height == other.height && _ptr.Equals(other._ptr);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != GetType()) {
return false;
}
return Equals((Image) obj);
}
public static bool operator ==(Image left, Image right) {
return Equals(left, right);
}
public static bool operator !=(Image left, Image right) {
return !Equals(left, right);
}
public override int GetHashCode() {
unchecked {
var hashCode = (width != null ? width.GetHashCode() : 0);
hashCode = (hashCode * 397) ^(height != null ? height.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (_ptr != null ? _ptr.GetHashCode() : 0);
return hashCode;
}
}
}
/*

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


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

}
}
public class WindowProvider : InheritedWidget {
public readonly Window window;
public WindowProvider(Key key = null, Window window = null, Widget child = null) :
base(key, child) {
D.assert(window != null);
this.window = window;
}
public static Window of(BuildContext context) {
var provider = (WindowProvider) context.inheritFromWidgetOfExactType(typeof(WindowProvider));
if (provider == null) {
throw new UIWidgetsError("WindowProvider is missing");
}
return provider.window;
}
public static Window of(GameObject gameObject) {
D.assert(false, () => "window.Of is not implemented yet!");
return null;
/*
var panel = gameObject.GetComponent<UIWidgetsPanel>();
return panel == null ? null : panel.window;
*/
}
public override bool updateShouldNotify(InheritedWidget oldWidget) {
D.assert(window == ((WindowProvider) oldWidget).window);
return false;
}
}
class _WidgetsAppState : State<WidgetsApp>, WidgetsBindingObserver {
public void didChangeMetrics() {
setState();

public override void initState() {
base.initState();
_updateNavigator();
//todo: xingwei.zhu: change the default locale to ui.Window.locale
/*D.assert(() => {
WidgetInspectorService.instance.inspectorShowCallback += inspectorShowChanged;
return true;
});*/
WidgetsBinding.instance.addObserver(this);
}

public override void dispose() {
WidgetsBinding.instance.removeObserver(this);
/*D.assert(() => {
WidgetInspectorService.instance.inspectorShowCallback -= inspectorShowChanged;
return true;
});*/
base.dispose();
}

}
/*bool _debugCheckLocalizations(Locale appLocale) {
bool _debugCheckLocalizations(Locale appLocale) {
foreach ( LocalizationsDelegate<dynamic> _delegate in _localizationsDelegates) {
foreach ( LocalizationsDelegate _delegate in _localizationsDelegates) {
if (!unsupportedTypes.Contains(_delegate.type))
continue;
if (_delegate.isSupported(appLocale))

if (unsupportedTypesList.SequenceEqual(list))
return true;
StringBuffer message = new StringBuffer();
message.writeln('\u2550' * 8);
message.writeln(
StringBuilder message = new StringBuilder();
message.Append('\u2550' * 8);
message.Append(
// Currently the Cupertino library only provides english localizations.
// Remove this when https://github.com/flutter/flutter/issues/23847
// is fixed.
message.writeln(
message.Append(
message.writeln(
message.Append(
message.writeln('\u2550' * 8);
//Debug.Log(message.toString());
message.Append('\u2550' * 8);
}*/
}
public override Widget build(BuildContext context) {
Widget navigator = null;

key: _navigator,
initialRoute: widget.initialRoute ?? Navigator.defaultRouteName,
/*WidgetsBinding.instance.window.defaultRouteName != Navigator.defaultRouteName
initialRoute:
WidgetsBinding.instance.window.defaultRouteName != Navigator.defaultRouteName
: widget.initialRoute ?? WidgetsBinding.instance.window.defaultRouteName,*/
: widget.initialRoute ?? WidgetsBinding.instance.window.defaultRouteName,
onGenerateRoute: _onGenerateRoute,
onGenerateInitialRoutes: widget.onGenerateInitialRoutes == null
? Navigator.defaultGenerateInitialRoutes

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

checkerboardRasterCacheImages: widget.checkerboardRasterCacheImages,
checkerboardOffscreenLayers: widget.checkerboardOffscreenLayers
);
}*/
}
if (performanceOverlay != null) {
result = new Stack(

});
}
/*if (widget.showSemanticsDebugger) {
result = SemanticsDebugger(
child: result,
);
}*/
D.assert(() => {
if (widget.debugShowWidgetInspector || WidgetsApp.debugShowWidgetInspectorOverride) {
result = new WidgetInspector(

);
}
return true;
/*if (widget.debugShowWidgetInspector || WidgetsApp.debugShowWidgetInspectorOverride) {
result = new WidgetInspector(
child: result,
selectButtonBuilder: widget.inspectorSelectButtonBuilder
);
}
if (widget.debugShowCheckedModeBanner && WidgetsApp.debugAllowBannerOverride) {
result = new CheckedModeBanner(
child: result
);
}*/
return true;
result = new Directionality(child: result, TextDirection.ltr);
result = new WindowProvider(
window: widget.window,
child: result
);
/*Widget title = null;
Widget title = null;
if (widget.onGenerateTitle != null) {
title = new Builder(
builder: (BuildContext context1)=> {

color: widget.color,
child: result
);
}*/
}
//D.assert(_debugCheckLocalizations(appLocale));
result = new MediaQuery(
data: MediaQueryData.fromWindow(widget.window),
child: new Localizations(
locale: appLocale,
delegates: _localizationsDelegates,
child: result)
);
/////todo
///
/*result = new Shortcuts(
D.assert(_debugCheckLocalizations(appLocale));
result = new Shortcuts(
child: FocusTraversalGroup(
policy: ReadingOrderTraversalPolicy(),
child: _MediaQueryFromWindow(
child: new FocusTraversalGroup(
policy: new ReadingOrderTraversalPolicy(),
child: new _MediaQueryFromWindow(
delegates: _localizationsDelegates,
delegates: _localizationsDelegates.ToList(),
);*/
);
return result;
}

26
com.unity.uiwidgets/Runtime/widgets/editable_text.cs


using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
//using Unity.UIWidgets.material;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.scheduler2;

if (textChanged && widget.onChanged != null)
widget.onChanged(value.text);
_lastFormattedUnmodifiedTextEditingValue = _receivedRemoteTextEditingValue;
/*
var textChanged = _value?.text != value?.text || isIMEInput;
if (textChanged && widget.inputFormatters != null && widget.inputFormatters.isNotEmpty()) {
foreach (var formatter in widget.inputFormatters) {
value = formatter.formatEditUpdate(_value, value);
}
_value = value;
_updateRemoteEditingValueIfNeeded();
//_updateImePosIfNeed();
}
else {
_value = value;
}
if (textChanged && widget.onChanged != null) {
widget.onChanged(value.text);
}*/
}
void _onCursorColorTick() {

public readonly TextSelectionDelegate textSelectionDelegate;
public readonly bool? paintCursorAboveText;
public readonly float? devicePixelRatio;
//public readonly GlobalKeyEventHandlerDelegate globalKeyEventHandler;
public readonly Locale locale;
public _Editable(
Key key = null,

bool enableInteractiveSelection = true,
TextSelectionDelegate textSelectionDelegate = null,
float? devicePixelRatio = null
//GlobalKeyEventHandlerDelegate globalKeyEventHandler = null
) : base(key) {
) : base(key) {
this.textSpan = textSpan;
this.value = value;
this.startHandleLayerLink = startHandleLayerLink;

this.selectionWidthStyle = selectionWidthStyle;
this.enableInteractiveSelection = enableInteractiveSelection;
this.devicePixelRatio = devicePixelRatio;
//this.globalKeyEventHandler = globalKeyEventHandler;
}
public override RenderObject createRenderObject(BuildContext context) {

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


public void _setAsFocusedChildForScope() {
FocusNode scopeFocus = this;
foreach (FocusScopeNode ancestor in ancestors) {
foreach ( var ancestor in ancestors) {
ancestor._focusedChildren.Remove(scopeFocus);
((FocusScopeNode)ancestor)._focusedChildren.Remove(scopeFocus);
ancestor._focusedChildren.Add(scopeFocus);
((FocusScopeNode)ancestor)._focusedChildren.Add(scopeFocus);
scopeFocus = ancestor;
}
}

4
com.unity.uiwidgets/Runtime/widgets/focus_traversal.cs


public static void insertionSort<T>(List<T> list,
Comparator<T> compare = null, int start = 0, int end =0) {
//compare ??= defaultCompare<T>();
//compare = compare == null ? defaultCompare<T>();
end = end == 0 ?list.Count : end;
for (int pos = start + 1; pos < end; pos++) {

public interface DirectionalFocusTraversalPolicyMixin {
//Dictionary<FocusScopeNode, _DirectionalPolicyData> _policyData = new Dictionary<FocusScopeNode, _DirectionalPolicyData>();
void invalidateScopeData(FocusScopeNode node);
void changedScope(FocusNode node = null, FocusScopeNode oldScope = null);
FocusNode findFirstFocusInDirection(FocusNode currentNode, TraversalDirection direction);

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


}
}
void reassemble(Element root) {
public void reassemble(Element root) {
try {
D.assert(root._parent == null);
D.assert(root.owner == this);

8
com.unity.uiwidgets/Runtime/widgets/image.cs


}
void _resolveImage() {
/*ScrollAwareImageProvider<object> provider = new ScrollAwareImageProvider<object>(
ScrollAwareImageProvider<object> provider = new ScrollAwareImageProvider<object>(
);*/
);
widget.image.resolve(ImageUtils.createLocalImageConfiguration(
provider.resolve(ImageUtils.createLocalImageConfiguration(
context,
size: widget.width != null && widget.height != null
? new Size(widget.width.Value, widget.height.Value)

base.debugFillProperties(description);
description.add(new DiagnosticsProperty<ImageStream>("stream", _imageStream));
description.add(new DiagnosticsProperty<ImageInfo>("pixels", _imageInfo));
//description.add(new DiagnosticsProperty<ImageChunkEvent>("loadingProgress", _loadingProgress));
description.add(new DiagnosticsProperty<ImageChunkEvent>("loadingProgress", _loadingProgress));
description.add(new DiagnosticsProperty<int>("frameNumber", _frameNumber));
description.add(new DiagnosticsProperty<bool>("wasSynchronouslyLoaded", _wasSynchronouslyLoaded));
}

1
com.unity.uiwidgets/Runtime/widgets/localizations.cs


}
public abstract class LocalizationsDelegate<T> : LocalizationsDelegate {
//public abstract Future<T> load(Locale locale);
public override Type type {
get { return typeof(T); }
}

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


using Unity.UIWidgets.gestures;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.services;
using SchedulerBinding = Unity.UIWidgets.scheduler2.SchedulerBinding;
using SchedulerPhase = Unity.UIWidgets.scheduler2.SchedulerPhase;

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

public virtual Future<RoutePopDisposition> willPop() {
/// async
return Future.value(isFirst
? RoutePopDisposition.bubble
: RoutePopDisposition.pop).to<RoutePopDisposition>();

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

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

string description;
if (route is TransitionRoute ){
//TransitionRoute transitionRoute = route;
description = ((TransitionRoute)route).debugLabel;
}
else {

Dictionary<string, object> settingsJsonable = new Dictionary<string, object> {
{"name", settings.name}
};
/*if (settings.arguments != null) {
settingsJsonable["arguments"] = jsonEncode(
settings.arguments,
toEncodable: (object _object) => $"{_object}"
);
}*/
if (settings.arguments != null) {
settingsJsonable["arguments"] = JSONMessageCodec.instance.toJson(
settings.arguments);
}
// todo
developer.developer_.postEvent("Flutter.Navigation", new Hashtable{
{"route", routeJsonable}
});

}
}
D.assert(anyEntry,()=> "Navigator has no active routes to replace.");
//_history.lastWhere(_RouteEntry.isPresentPredicate).complete(result, isReplaced: true);
_RouteEntry lastEntry = null;
foreach (var historyEntry in _history) {
if (_RouteEntry.isPresentPredicate(historyEntry)) {

D.assert(index >= 0, () => "There are no routes below the specified anchorRoute.");
_history.Insert(index + 1, new _RouteEntry(newRoute, initialState: _RouteLifecycle.replace));
//_history[index].remove(isReplaced: true);
_history.RemoveAt(index);
_flushHistoryUpdates();
D.assert(() => {

}
public bool canPop() {
IEnumerable<_RouteEntry> iterator = new List<_RouteEntry>();//_history.where(_RouteEntry.isPresentPredicate).iterator;
IEnumerable<_RouteEntry> iterator = new List<_RouteEntry>();
foreach (var historyEntry in _history) {
if (_RouteEntry.isPresentPredicate(historyEntry)) {
iterator.Append(historyEntry);

return true;
});
_RouteEntry entry = null; //_history.lastWhere(_RouteEntry.isPresentPredicate);
_RouteEntry entry = null;
foreach (_RouteEntry route in _history) {
if (_RouteEntry.isPresentPredicate(route)) {
entry = route;

});
D.assert(route._navigator == this);
bool wasCurrent = route.isCurrent;
_RouteEntry entry = null; //_history.firstWhere(_RouteEntry.isRoutePredicate(route), orElse: () => null);
_RouteEntry entry = null;
foreach (_RouteEntry routeEntry in _history) {
if (_RouteEntry.isRoutePredicate(route)(routeEntry)) {
entry = routeEntry;

RenderAbsorbPointer absorber =
_overlayKey.currentContext?.findAncestorRenderObjectOfType<RenderAbsorbPointer>();
setState(() => { absorber.absorbing = true; });//absorber?.
setState(() => {
if(absorber != null)
absorber.absorbing = true;
});
}
_activePointers.ToList().ForEach(WidgetsBinding.instance.cancelPointer);

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

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


D.assert(!_transitionCompleter.isCompleted, () => $"Cannot reuse a {GetType()} after disposing it.");
_didPushOrReplace();
base.didAdd();
_controller.setValue(_controller.upperBound); //_controller.upperBound;
_controller.setValue(_controller.upperBound);
}
protected internal override void didReplace(Route oldRoute) {
D.assert(_controller != null,

entry._owner = null;
entry._notifyRemoved();
if (_localHistory.isEmpty()) {
//changedInternalState();
if (SchedulerBinding.instance.schedulerPhase == SchedulerPhase.persistentCallbacks) {
SchedulerBinding.instance.addPostFrameCallback((TimeSpan timestamp) =>{
changedInternalState();

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

}
public virtual bool maintainState { get; }
public bool offstage {
public virtual bool offstage {
get { return _offstage; }
set {
if (_offstage == value) {

animation.drive(new ColorTween(
begin: _kTransparent,
end: barrierColor // changedInternalState is called if this updates
).chain(new CurveTween(curve: barrierCurve)));//.animate(animation);
).chain(new CurveTween(curve: barrierCurve)));
//,semanticsLabel: barrierLabel, // changedInternalState is called if barrierLabel updates
//barrierSemanticsDismissible: semanticsDismissible
//semanticsLabel: barrierLabel, // changedInternalState is called if barrierLabel updates
//barrierSemanticsDismissible: semanticsDismissible,
);
}
if (_filter != null) {

BuildContext context,
Animation<float> animation,
Animation<float> secondaryAnimation) {
//TODO SEMANTICS
return _pageBuilder(context, animation, secondaryAnimation);
}

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


RenderBox _currentBeforeChild;
protected override void performRebuild() {
//_didUnderflow = false;
_childWidgets.Clear();
base.performRebuild();
_currentBeforeChild = null;

_currentlyUpdatingChildIndex = index;
if(_childElements.getOrDefault(index) != null &&
_childElements.getOrDefault(index) != newChildren.getOrDefault(index))
// if (_childElements[index] != null && _childElements[index] != newChildren[index])
{
_childElements[index] = updateChild(_childElements[index], null, index);
}

}
return newChild;
/*SliverMultiBoxAdaptorParentData oldParentData = null;
if (child != null && child.renderObject != null) {
oldParentData = (SliverMultiBoxAdaptorParentData) child.renderObject.parentData;
}
Element newChild = base.updateChild(child, newWidget, newSlot);
SliverMultiBoxAdaptorParentData newParentData = null;
if (newChild != null && newChild.renderObject != null) {
newParentData = (SliverMultiBoxAdaptorParentData) newChild.renderObject.parentData;
}
if (oldParentData != newParentData && oldParentData != null && newParentData != null) {
newParentData.layoutOffset = oldParentData.layoutOffset;
}
return newChild;*/
}
internal override void forgetChild(Element child) {

}).ToList().ForEach(e => visitor(e));
}
}
/*public class SliverFillRemaining : SingleChildRenderObjectWidget {
public SliverFillRemaining(
Key key = null,
Widget child = null
) : base(key: key, child: child) {
}
public override RenderObject createRenderObject(BuildContext context) {
return new RenderSliverFillRemaining();
}
}*/
public class KeepAlive : ParentDataWidget<IKeepAliveParentDataMixin> {
public KeepAlive(

121
com.unity.uiwidgets/Runtime/widgets/text.cs


) : base(key: key, child: child) {
D.assert(style != null);
D.assert(softWrap != null);
D.assert(overflow != null);
D.assert(textWidthBasis != null);
this.style = style;
this.textAlign = textAlign;
this.softWrap = softWrap;

public static DefaultTextStyle of(BuildContext context) {
return context.dependOnInheritedWidgetOfExactType<DefaultTextStyle>() ?? new DefaultTextStyle();
}
public override bool updateShouldNotify(InheritedWidget oldWidget) {
//InheritedWidget
//DefaultTextStyle
oldWidget = (DefaultTextStyle) oldWidget;
return style != ((DefaultTextStyle)oldWidget).style ||
textAlign != ((DefaultTextStyle)oldWidget).textAlign ||
softWrap != ((DefaultTextStyle)oldWidget).softWrap ||
overflow != ((DefaultTextStyle)oldWidget).overflow ||
maxLines != ((DefaultTextStyle)oldWidget).maxLines ||
textWidthBasis != ((DefaultTextStyle)oldWidget).textWidthBasis ||
textHeightBehavior != ((DefaultTextStyle)oldWidget).textHeightBehavior;
public override bool updateShouldNotify(InheritedWidget oldWidget) {
DefaultTextStyle _oldWidget = (DefaultTextStyle) oldWidget;
return style != _oldWidget.style ||
textAlign != _oldWidget.textAlign ||
softWrap != _oldWidget.softWrap ||
overflow != _oldWidget.overflow ||
maxLines != _oldWidget.maxLines ||
textWidthBasis != _oldWidget.textWidthBasis ||
textHeightBehavior != _oldWidget.textHeightBehavior;
}
public override Widget wrap(BuildContext context, Widget child) {

}
/*public class DefaultTextStyle : InheritedWidget {
public DefaultTextStyle(
Key key = null,
TextStyle style = null,
TextAlign? textAlign = null,
bool softWrap = true,
TextOverflow overflow = TextOverflow.clip,
int? maxLines = null,
Widget child = null
) : base(key, child) {
D.assert(style != null);
D.assert(maxLines == null || maxLines > 0);
D.assert(child != null);
this.style = style;
this.textAlign = textAlign;
this.softWrap = softWrap;
this.overflow = overflow;
this.maxLines = maxLines;
}
DefaultTextStyle() {
style = new TextStyle();
textAlign = null;
softWrap = true;
overflow = TextOverflow.clip;
maxLines = null;
}
public static DefaultTextStyle fallback() {
return _fallback;
}
static readonly DefaultTextStyle _fallback = new DefaultTextStyle();
public static Widget merge(
Key key = null,
TextStyle style = null,
TextAlign? textAlign = null,
bool? softWrap = null,
TextOverflow? overflow = null,
int? maxLines = null,
Widget child = null
) {
D.assert(child != null);
return new Builder(builder: (context => {
var parent = of(context);
return new DefaultTextStyle(
key: key,
style: parent.style.merge(style),
textAlign: textAlign ?? parent.textAlign,
softWrap: softWrap ?? parent.softWrap,
overflow: overflow ?? parent.overflow,
maxLines: maxLines ?? parent.maxLines,
child: child
);
}));
}
public readonly TextStyle style;
public readonly TextAlign? textAlign;
public readonly bool softWrap;
public readonly TextOverflow overflow;
public readonly int? maxLines;
public static DefaultTextStyle of(BuildContext context) {
var inherit = (DefaultTextStyle) context.inheritFromWidgetOfExactType(typeof(DefaultTextStyle));
return inherit ?? fallback();
}
public override bool updateShouldNotify(InheritedWidget w) {
var oldWidget = (DefaultTextStyle) w;
return style != oldWidget.style ||
textAlign != oldWidget.textAlign ||
softWrap != oldWidget.softWrap ||
overflow != oldWidget.overflow ||
maxLines != oldWidget.maxLines;
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
if (style != null) {
style.debugFillProperties(properties);
}
properties.add(new EnumProperty<TextAlign?>("textAlign", textAlign,
defaultValue: foundation_.kNullDefaultValue));
properties.add(new FlagProperty("softWrap", value: softWrap, ifTrue: "wrapping at box width",
ifFalse: "no wrapping except at line break characters", showName: true));
properties.add(new EnumProperty<TextOverflow>("overflow", overflow,
defaultValue: foundation_.kNullDefaultValue));
properties.add(new IntProperty("maxLines", maxLines,
defaultValue: foundation_.kNullDefaultValue));
}
}*/
public class Text : StatelessWidget {
public Text(string data,

8
com.unity.uiwidgets/Runtime/widgets/text_selection.cs


);
}
}
/*public abstract class TextSelectionGestureDetectorBuilderDelegate {
public GlobalKey<EditableTextState> editableTextKey { get; }
public bool forcePressEnabled {
get;
}
public bool selectionEnabled { get; }
}*/
public interface TextSelectionGestureDetectorBuilderDelegate {
GlobalKey<EditableTextState> editableTextKey { get; }

9
com.unity.uiwidgets/Runtime/widgets/texture.cs


namespace Unity.UIWidgets.widgets {
public class Texture : LeafRenderObjectWidget {
// TODO: check whether following is needed
// public static void textureFrameAvailable(Window instance = null) {
// if (instance == null) {
// WindowAdapter.windowAdapters.ForEach(w => w.scheduleFrame(false));
// } else {
// instance.scheduleFrame(false);
// }
// }
public Texture(
Key key = null,
int? textureId = null) : base(key: key) {

2
engine/src/lib/ui/window/window.cc


const std::string routeName = ptr->client()->DefaultRouteName();
size_t size = routeName.length() + 1;
char* result = static_cast<char*>(malloc(size));
routeName.copy(result, size);
strcpy(result, routeName.c_str());
return result;
}

正在加载...
取消
保存