浏览代码

Merge pull request #298 from IIzzaya/cupertinosample

[Cupertino] Fix bugs
/main
GitHub 5 年前
当前提交
5e86391e
共有 10 个文件被更改,包括 276 次插入222 次删除
  1. 120
      Runtime/cupertino/action_sheet.cs
  2. 8
      Runtime/cupertino/button.cs
  3. 20
      Runtime/cupertino/colors.cs
  4. 18
      Runtime/cupertino/dialog.cs
  5. 270
      Runtime/cupertino/icons.cs
  6. 14
      Runtime/cupertino/route.cs
  7. 8
      Runtime/cupertino/scrollbar.cs
  8. 6
      Runtime/cupertino/switch.cs
  9. 2
      Runtime/cupertino/text_selection.cs
  10. 32
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_alert_demo.cs

120
Runtime/cupertino/action_sheet.cs


using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Canvas = Unity.UIWidgets.ui.Canvas;
using Color = Unity.UIWidgets.ui.Color;
using Rect = Unity.UIWidgets.ui.Rect;
public static TextStyle _kActionSheetActionStyle = new TextStyle(
public static readonly TextStyle _kActionSheetActionStyle = new TextStyle(
// fontFamily: ".SF UI Text",
fontFamily: ".SF Pro Text",
inherit: false,

textBaseline: TextBaseline.alphabetic
);
public static TextStyle _kActionSheetContentStyle = new TextStyle(
public static readonly TextStyle _kActionSheetContentStyle = new TextStyle(
// fontFamily: ".SF UI Text",
fontFamily: ".SF Pro Text",
inherit: false,

textBaseline: TextBaseline.alphabetic
);
public static BoxDecoration _kAlertBlurOverlayDecoration = new BoxDecoration(
public static readonly BoxDecoration _kAlertBlurOverlayDecoration = new BoxDecoration(
public static Color _kBackgroundColor = new Color(0xD1F8F8F8);
public static Color _kPressedColor = new Color(0xA6E5E5EA);
public static Color _kButtonDividerColor = new Color(0x403F3F3F);
public static Color _kContentTextColor = new Color(0xFF8F8F8F);
public static Color _kCancelButtonPressedColor = new Color(0xFFEAEAEA);
public static readonly Color _kBackgroundColor = new Color(0xD1F8F8F8);
public static readonly Color _kPressedColor = new Color(0xA6E5E5EA);
public static readonly Color _kButtonDividerColor = new Color(0x403F3F3F);
public static readonly Color _kContentTextColor = new Color(0xFF8F8F8F);
public static readonly Color _kCancelButtonPressedColor = new Color(0xFFEAEAEA);
public const float _kBlurAmount = 20.0f;
public const float _kEdgeHorizontalPadding = 8.0f;

if (this.actions == null || this.actions.isEmpty()) {
return new Container(height: 0.0f);
}
Debug.Log("_buildActions");
return new Container(
child: new _CupertinoAlertActionSection(

bool isDefaultAction = false,
bool isDestructiveAction = false
) {
Debug.Log("constructor");
D.assert(child != null);
D.assert(onPressed != null);
this.child = child;

public readonly Widget child;
public override Widget build(BuildContext context) {
Debug.Log("build");
TextStyle style = CupertinoActionSheetUtils._kActionSheetActionStyle;
if (this.isDefaultAction) {

if (this.isDestructiveAction) {
style = style.copyWith(color: CupertinoColors.destructiveRed);
}
return new GestureDetector(
onTap: () => this.onPressed(),

}
protected override void insertChildRenderObject(RenderObject child, object slot) {
this._placeChildInSlot(child, (_AlertSections) slot);
this._placeChildInSlot(child, slot);
this._placeChildInSlot(child, (_AlertSections) slot);
this._placeChildInSlot(child, slot);
}
public override void update(Widget newWidget) {

}
}
void _placeChildInSlot(RenderObject child, _AlertSections slot) {
switch (slot) {
void _placeChildInSlot(RenderObject child, object slot) {
switch ((_AlertSections) slot) {
case _AlertSections.contentSection:
this.renderObject.contentSection = child as RenderBox;
break;

class _CupertinoAlertActionSectionState : State<_CupertinoAlertActionSection> {
public override Widget build(BuildContext context) {
Debug.Log("AlertAction build");
interactiveButtons.Add(new _PressableActionButton(
interactiveButtons.Add(new _PressableActionSheetActionButton(
child: this.widget.children[i]
)
);

}
}
class _PressableActionSheetActionButton : StatefulWidget {
public _PressableActionSheetActionButton(
Widget child
) {
this.child = child;
}
public readonly Widget child;
public override State createState() {
return new _PressableActionSheetActionButtonState();
}
}
class _PressableActionSheetActionButtonState : State<_PressableActionSheetActionButton> {
bool _isPressed = false;
public override Widget build(BuildContext context) {
return new _ActionSheetActionButtonParentDataWidget(
isPressed: this._isPressed,
child: new GestureDetector(
behavior: HitTestBehavior.opaque,
onTapDown: (TapDownDetails details) => this.setState(() => { this._isPressed = true; }),
onTapUp: (TapUpDetails details) => this.setState(() => { this._isPressed = false; }),
onTapCancel: () => this.setState(() => this._isPressed = false),
child: this.widget.child
)
);
}
}
class _ActionSheetActionButtonParentDataWidget : ParentDataWidget<_CupertinoAlertActionsRenderWidget> {
public _ActionSheetActionButtonParentDataWidget(
Widget child,
bool isPressed = false,
Key key = null
) : base(key: key, child: child) {
this.isPressed = isPressed;
}
public readonly bool isPressed;
public override void applyParentData(RenderObject renderObject) {
D.assert(renderObject.parentData is _ActionSheetActionButtonParentData);
_ActionSheetActionButtonParentData parentData =
renderObject.parentData as _ActionSheetActionButtonParentData;
if (parentData.isPressed != this.isPressed) {
parentData.isPressed = this.isPressed;
AbstractNodeMixinDiagnosticableTree targetParent = renderObject.parent;
if (targetParent is RenderObject) {
((RenderObject) targetParent).markNeedsPaint();
}
}
}
}
class _ActionSheetActionButtonParentData : MultiChildLayoutParentData {
public _ActionSheetActionButtonParentData(
bool isPressed = false
) {
this.isPressed = isPressed;
}
public bool isPressed;
}
class _CupertinoAlertActionsRenderWidget : MultiChildRenderObjectWidget {
public _CupertinoAlertActionsRenderWidget(
List<Widget> actionButtons,

) : base(key: key, children: actionButtons) {
Debug.Log("AlertActionRenderWidget build");
this._dividerThickness = dividerThickness;
this._hasCancelButton = hasCancelButton;
}

) {
this._dividerThickness = dividerThickness;
this._hasCancelButton = hasCancelButton;
this.addAll(children);
Debug.Log("_RenderCupertinoAlertActions");
this.addAll(children ?? new List<RenderBox>());
}
public float dividerThickness {

};
public override void setupParentData(RenderObject child) {
if (!(child.parentData is _ActionButtonParentData)) {
child.parentData = new _ActionButtonParentData();
if (!(child.parentData is _ActionSheetActionButtonParentData)) {
child.parentData = new _ActionSheetActionButtonParentData();
}
}

RenderBox child = this.firstChild;
RenderBox prevChild = null;
while (child != null) {
D.assert(child.parentData is _ActionButtonParentData);
_ActionButtonParentData currentButtonParentData = child.parentData as _ActionButtonParentData;
D.assert(child.parentData is _ActionSheetActionButtonParentData);
_ActionSheetActionButtonParentData currentButtonParentData =
child.parentData as _ActionSheetActionButtonParentData;
D.assert(prevChild.parentData is _ActionButtonParentData);
_ActionButtonParentData previousButtonParentData = prevChild.parentData as _ActionButtonParentData;
D.assert(prevChild.parentData is _ActionSheetActionButtonParentData);
_ActionSheetActionButtonParentData previousButtonParentData =
prevChild.parentData as _ActionSheetActionButtonParentData;
isPrevButtonPressed = previousButtonParentData.isPressed;
}

8
Runtime/cupertino/button.cs


namespace Unity.UIWidgets.cupertino {
public class CupertinoButtonUtils {
public static Color _kDisabledBackground = new Color(0xFFA9A9A9);
public static Color _kDisabledForeground = new Color(0xFFD1D1D1);
public static EdgeInsets _kButtonPadding = EdgeInsets.all(16.0f);
public static EdgeInsets _kBackgroundButtonPadding = EdgeInsets.symmetric(vertical: 14.0f, horizontal: 64.0f);
public static readonly Color _kDisabledBackground = new Color(0xFFA9A9A9);
public static readonly Color _kDisabledForeground = new Color(0xFFD1D1D1);
public static readonly EdgeInsets _kButtonPadding = EdgeInsets.all(16.0f);
public static readonly EdgeInsets _kBackgroundButtonPadding = EdgeInsets.symmetric(vertical: 14.0f, horizontal: 64.0f);
}
public class CupertinoButton : StatefulWidget {

20
Runtime/cupertino/colors.cs


namespace Unity.UIWidgets.cupertino {
public class CupertinoColors {
public static Color activeBlue = new Color(0xFF007AFF);
public static readonly Color activeBlue = new Color(0xFF007AFF);
public static Color activeGreen = new Color(0xFF4CD964);
public static readonly Color activeGreen = new Color(0xFF4CD964);
public static Color activeOrange = new Color(0xFFFF9500);
public static readonly Color activeOrange = new Color(0xFFFF9500);
public static Color white = new Color(0xFFFFFFFF);
public static readonly Color white = new Color(0xFFFFFFFF);
public static Color black = new Color(0xFF000000);
public static readonly Color black = new Color(0xFF000000);
public static Color lightBackgroundGray = new Color(0xFFE5E5EA);
public static readonly Color lightBackgroundGray = new Color(0xFFE5E5EA);
public static Color extraLightBackgroundGray = new Color(0xFFEFEFF4);
public static readonly Color extraLightBackgroundGray = new Color(0xFFEFEFF4);
public static Color darkBackgroundGray = new Color(0xFF171717);
public static readonly Color darkBackgroundGray = new Color(0xFF171717);
public static Color inactiveGray = new Color(0xFF8E8E93);
public static readonly Color inactiveGray = new Color(0xFF8E8E93);
public static Color destructiveRed = new Color(0xFFFF3B30);
public static readonly Color destructiveRed = new Color(0xFFFF3B30);
}
}

18
Runtime/cupertino/dialog.cs


namespace Unity.UIWidgets.cupertino {
class CupertinoDialogUtils {
public static TextStyle _kCupertinoDialogTitleStyle = new TextStyle(
public static readonly TextStyle _kCupertinoDialogTitleStyle = new TextStyle(
fontFamily: ".SF UI Display",
fontSize: 18.0f,
fontWeight: FontWeight.w600,

);
public static TextStyle _kCupertinoDialogContentStyle = new TextStyle(
public static readonly TextStyle _kCupertinoDialogContentStyle = new TextStyle(
fontFamily: ".SF UI Text",
fontSize: 13.4f,
fontWeight: FontWeight.w400,

textBaseline: TextBaseline.alphabetic
);
public static TextStyle _kCupertinoDialogActionStyle = new TextStyle(
public static readonly TextStyle _kCupertinoDialogActionStyle = new TextStyle(
fontFamily: ".SF UI Text",
fontSize: 16.8f,
fontWeight: FontWeight.w400,

public const float _kCupertinoDialogWidth = 270.0f;
public const float _kAccessibilityCupertinoDialogWidth = 310.0f;
public static BoxDecoration _kCupertinoDialogBlurOverlayDecoration = new BoxDecoration(
public static readonly BoxDecoration _kCupertinoDialogBlurOverlayDecoration = new BoxDecoration(
color: CupertinoColors.white,
backgroundBlendMode: BlendMode.overlay
);

public const float _kMinButtonFontSize = 10.0f;
public const float _kDialogCornerRadius = 12.0f;
public const float _kDividerThickness = 1.0f;
public static Color _kDialogColor = new Color(0xC0FFFFFF);
public static Color _kDialogPressedColor = new Color(0x90FFFFFF);
public static Color _kButtonDividerColor = new Color(0x40FFFFFF);
public const float _kMaxRegularTextScaleFactor = 1.4f;
public const float _kMaxRegularTextScaleFactor = 1.4f;
public static readonly Color _kDialogColor = new Color(0xC0FFFFFF);
public static readonly Color _kDialogPressedColor = new Color(0x90FFFFFF);
public static readonly Color _kButtonDividerColor = new Color(0x40FFFFFF);
public static bool _isInAccessibilityMode(BuildContext context) {
MediaQueryData data = MediaQuery.of(context, nullOk: true);

270
Runtime/cupertino/icons.cs


namespace Unity.UIWidgets.cupertino {
public static class CupertinoIcons {
public static string iconFont = "CupertinoIcons";
public const string iconFont = "CupertinoIcons";
public static IconData left_chevron = new IconData(0xf3d2, fontFamily: iconFont);
public static IconData right_chevron = new IconData(0xf3d3, fontFamily: iconFont);
public static IconData share = new IconData(0xf4ca, fontFamily: iconFont);
public static IconData share_solid = new IconData(0xf4cb, fontFamily: iconFont);
public static IconData book = new IconData(0xf3e7, fontFamily: iconFont);
public static IconData book_solid = new IconData(0xf3e8, fontFamily: iconFont);
public static IconData bookmark = new IconData(0xf3e9, fontFamily: iconFont);
public static IconData bookmark_solid = new IconData(0xf3ea, fontFamily: iconFont);
public static IconData info = new IconData(0xf44c, fontFamily: iconFont);
public static IconData reply = new IconData(0xf4c6, fontFamily: iconFont);
public static IconData conversation_bubble = new IconData(0xf3fb, fontFamily: iconFont);
public static IconData profile_circled = new IconData(0xf419, fontFamily: iconFont);
public static IconData plus_circled = new IconData(0xf48a, fontFamily: iconFont);
public static IconData minus_circled = new IconData(0xf463, fontFamily: iconFont);
public static IconData flag = new IconData(0xf42c, fontFamily: iconFont);
public static IconData search = new IconData(0xf4a5, fontFamily: iconFont);
public static IconData check_mark = new IconData(0xf3fd, fontFamily: iconFont);
public static IconData check_mark_circled = new IconData(0xf3fe, fontFamily: iconFont);
public static IconData check_mark_circled_solid = new IconData(0xf3ff, fontFamily: iconFont);
public static IconData circle = new IconData(0xf401, fontFamily: iconFont);
public static IconData circle_filled = new IconData(0xf400, fontFamily: iconFont);
public static IconData back = new IconData(0xf3cf, fontFamily: iconFont);
public static IconData forward = new IconData(0xf3d1, fontFamily: iconFont);
public static IconData home = new IconData(0xf447, fontFamily: iconFont);
public static IconData shopping_cart = new IconData(0xf3f7, fontFamily: iconFont);
public static IconData ellipsis = new IconData(0xf46a, fontFamily: iconFont);
public static IconData phone = new IconData(0xf4b8, fontFamily: iconFont);
public static IconData phone_solid = new IconData(0xf4b9, fontFamily: iconFont);
public static IconData down_arrow = new IconData(0xf35d, fontFamily: iconFont);
public static IconData up_arrow = new IconData(0xf366, fontFamily: iconFont);
public static IconData battery_charging = new IconData(0xf111, fontFamily: iconFont);
public static IconData battery_empty = new IconData(0xf112, fontFamily: iconFont);
public static IconData battery_full = new IconData(0xf113, fontFamily: iconFont);
public static IconData battery_75_percent = new IconData(0xf114, fontFamily: iconFont);
public static IconData battery_25_percent = new IconData(0xf115, fontFamily: iconFont);
public static IconData bluetooth = new IconData(0xf116, fontFamily: iconFont);
public static IconData restart = new IconData(0xf21c, fontFamily: iconFont);
public static IconData reply_all = new IconData(0xf21d, fontFamily: iconFont);
public static IconData reply_thick_solid = new IconData(0xf21e, fontFamily: iconFont);
public static IconData share_up = new IconData(0xf220, fontFamily: iconFont);
public static IconData shuffle_thick = new IconData(0xf221, fontFamily: iconFont);
public static IconData photo_camera = new IconData(0xf3f5, fontFamily: iconFont);
public static IconData photo_camera_solid = new IconData(0xf3f6, fontFamily: iconFont);
public static IconData video_camera = new IconData(0xf4cc, fontFamily: iconFont);
public static IconData video_camera_solid = new IconData(0xf4cd, fontFamily: iconFont);
public static IconData switch_camera = new IconData(0xf49e, fontFamily: iconFont);
public static IconData switch_camera_solid = new IconData(0xf49f, fontFamily: iconFont);
public static IconData collections = new IconData(0xf3c9, fontFamily: iconFont);
public static IconData collections_solid = new IconData(0xf3ca, fontFamily: iconFont);
public static IconData folder = new IconData(0xf434, fontFamily: iconFont);
public static IconData folder_solid = new IconData(0xf435, fontFamily: iconFont);
public static IconData folder_open = new IconData(0xf38a, fontFamily: iconFont);
public static IconData delete = new IconData(0xf4c4, fontFamily: iconFont);
public static IconData delete_solid = new IconData(0xf4c5, fontFamily: iconFont);
public static IconData delete_simple = new IconData(0xf37f, fontFamily: iconFont);
public static IconData pen = new IconData(0xf2bf, fontFamily: iconFont);
public static IconData pencil = new IconData(0xf37e, fontFamily: iconFont);
public static IconData create = new IconData(0xf417, fontFamily: iconFont);
public static IconData create_solid = new IconData(0xf417, fontFamily: iconFont);
public static IconData refresh = new IconData(0xf49a, fontFamily: iconFont);
public static IconData refresh_circled = new IconData(0xf49b, fontFamily: iconFont);
public static IconData refresh_circled_solid = new IconData(0xf49c, fontFamily: iconFont);
public static IconData refresh_thin = new IconData(0xf49d, fontFamily: iconFont);
public static IconData refresh_thick = new IconData(0xf3a8, fontFamily: iconFont);
public static IconData refresh_bold = new IconData(0xf21c, fontFamily: iconFont);
public static IconData clear_thick = new IconData(0xf2d7, fontFamily: iconFont);
public static IconData clear_thick_circled = new IconData(0xf36e, fontFamily: iconFont);
public static IconData clear = new IconData(0xf404, fontFamily: iconFont);
public static IconData clear_circled = new IconData(0xf405, fontFamily: iconFont);
public static IconData clear_circled_solid = new IconData(0xf406, fontFamily: iconFont);
public static IconData add = new IconData(0xf489, fontFamily: iconFont);
public static IconData add_circled = new IconData(0xf48a, fontFamily: iconFont);
public static IconData add_circled_solid = new IconData(0xf48b, fontFamily: iconFont);
public static IconData gear = new IconData(0xf43c, fontFamily: iconFont);
public static IconData gear_solid = new IconData(0xf43d, fontFamily: iconFont);
public static IconData gear_big = new IconData(0xf2f7, fontFamily: iconFont);
public static IconData settings = new IconData(0xf411, fontFamily: iconFont);
public static IconData settings_solid = new IconData(0xf412, fontFamily: iconFont);
public static IconData music_note = new IconData(0xf46b, fontFamily: iconFont);
public static IconData double_music_note = new IconData(0xf46c, fontFamily: iconFont);
public static IconData play_arrow = new IconData(0xf487, fontFamily: iconFont);
public static IconData play_arrow_solid = new IconData(0xf488, fontFamily: iconFont);
public static IconData pause = new IconData(0xf477, fontFamily: iconFont);
public static IconData pause_solid = new IconData(0xf478, fontFamily: iconFont);
public static IconData loop = new IconData(0xf449, fontFamily: iconFont);
public static IconData loop_thick = new IconData(0xf44a, fontFamily: iconFont);
public static IconData volume_down = new IconData(0xf3b7, fontFamily: iconFont);
public static IconData volume_mute = new IconData(0xf3b8, fontFamily: iconFont);
public static IconData volume_off = new IconData(0xf3b9, fontFamily: iconFont);
public static IconData volume_up = new IconData(0xf3ba, fontFamily: iconFont);
public static IconData fullscreen = new IconData(0xf386, fontFamily: iconFont);
public static IconData fullscreen_exit = new IconData(0xf37d, fontFamily: iconFont);
public static IconData mic_off = new IconData(0xf45f, fontFamily: iconFont);
public static IconData mic = new IconData(0xf460, fontFamily: iconFont);
public static IconData mic_solid = new IconData(0xf461, fontFamily: iconFont);
public static IconData clock = new IconData(0xf4be, fontFamily: iconFont);
public static IconData clock_solid = new IconData(0xf4bf, fontFamily: iconFont);
public static IconData time = new IconData(0xf402, fontFamily: iconFont);
public static IconData time_solid = new IconData(0xf403, fontFamily: iconFont);
public static IconData padlock = new IconData(0xf4c8, fontFamily: iconFont);
public static IconData padlock_solid = new IconData(0xf4c9, fontFamily: iconFont);
public static IconData eye = new IconData(0xf424, fontFamily: iconFont);
public static IconData eye_solid = new IconData(0xf425, fontFamily: iconFont);
public static IconData person = new IconData(0xf47d, fontFamily: iconFont);
public static IconData person_solid = new IconData(0xf47e, fontFamily: iconFont);
public static IconData person_add = new IconData(0xf47f, fontFamily: iconFont);
public static IconData person_add_solid = new IconData(0xf480, fontFamily: iconFont);
public static IconData group = new IconData(0xf47b, fontFamily: iconFont);
public static IconData group_solid = new IconData(0xf47c, fontFamily: iconFont);
public static IconData mail = new IconData(0xf422, fontFamily: iconFont);
public static IconData mail_solid = new IconData(0xf423, fontFamily: iconFont);
public static IconData location = new IconData(0xf455, fontFamily: iconFont);
public static IconData location_solid = new IconData(0xf456, fontFamily: iconFont);
public static IconData tag = new IconData(0xf48c, fontFamily: iconFont);
public static IconData tag_solid = new IconData(0xf48d, fontFamily: iconFont);
public static IconData tags = new IconData(0xf48e, fontFamily: iconFont);
public static IconData tags_solid = new IconData(0xf48f, fontFamily: iconFont);
public static IconData bus = new IconData(0xf36d, fontFamily: iconFont);
public static IconData car = new IconData(0xf36f, fontFamily: iconFont);
public static IconData car_detailed = new IconData(0xf2c1, fontFamily: iconFont);
public static IconData train_style_one = new IconData(0xf3af, fontFamily: iconFont);
public static IconData train_style_two = new IconData(0xf3b4, fontFamily: iconFont);
public static IconData paw = new IconData(0xf479, fontFamily: iconFont);
public static IconData paw_solid = new IconData(0xf47a, fontFamily: iconFont);
public static IconData game_controller = new IconData(0xf43a, fontFamily: iconFont);
public static IconData game_controller_solid = new IconData(0xf43b, fontFamily: iconFont);
public static IconData lab_flask = new IconData(0xf430, fontFamily: iconFont);
public static IconData lab_flask_solid = new IconData(0xf431, fontFamily: iconFont);
public static IconData heart = new IconData(0xf442, fontFamily: iconFont);
public static IconData heart_solid = new IconData(0xf443, fontFamily: iconFont);
public static IconData bell = new IconData(0xf3e1, fontFamily: iconFont);
public static IconData bell_solid = new IconData(0xf3e2, fontFamily: iconFont);
public static IconData news = new IconData(0xf471, fontFamily: iconFont);
public static IconData news_solid = new IconData(0xf472, fontFamily: iconFont);
public static readonly IconData left_chevron = new IconData(0xf3d2, fontFamily: iconFont);
public static readonly IconData right_chevron = new IconData(0xf3d3, fontFamily: iconFont);
public static readonly IconData share = new IconData(0xf4ca, fontFamily: iconFont);
public static readonly IconData share_solid = new IconData(0xf4cb, fontFamily: iconFont);
public static readonly IconData book = new IconData(0xf3e7, fontFamily: iconFont);
public static readonly IconData book_solid = new IconData(0xf3e8, fontFamily: iconFont);
public static readonly IconData bookmark = new IconData(0xf3e9, fontFamily: iconFont);
public static readonly IconData bookmark_solid = new IconData(0xf3ea, fontFamily: iconFont);
public static readonly IconData info = new IconData(0xf44c, fontFamily: iconFont);
public static readonly IconData reply = new IconData(0xf4c6, fontFamily: iconFont);
public static readonly IconData conversation_bubble = new IconData(0xf3fb, fontFamily: iconFont);
public static readonly IconData profile_circled = new IconData(0xf419, fontFamily: iconFont);
public static readonly IconData plus_circled = new IconData(0xf48a, fontFamily: iconFont);
public static readonly IconData minus_circled = new IconData(0xf463, fontFamily: iconFont);
public static readonly IconData flag = new IconData(0xf42c, fontFamily: iconFont);
public static readonly IconData search = new IconData(0xf4a5, fontFamily: iconFont);
public static readonly IconData check_mark = new IconData(0xf3fd, fontFamily: iconFont);
public static readonly IconData check_mark_circled = new IconData(0xf3fe, fontFamily: iconFont);
public static readonly IconData check_mark_circled_solid = new IconData(0xf3ff, fontFamily: iconFont);
public static readonly IconData circle = new IconData(0xf401, fontFamily: iconFont);
public static readonly IconData circle_filled = new IconData(0xf400, fontFamily: iconFont);
public static readonly IconData back = new IconData(0xf3cf, fontFamily: iconFont);
public static readonly IconData forward = new IconData(0xf3d1, fontFamily: iconFont);
public static readonly IconData home = new IconData(0xf447, fontFamily: iconFont);
public static readonly IconData shopping_cart = new IconData(0xf3f7, fontFamily: iconFont);
public static readonly IconData ellipsis = new IconData(0xf46a, fontFamily: iconFont);
public static readonly IconData phone = new IconData(0xf4b8, fontFamily: iconFont);
public static readonly IconData phone_solid = new IconData(0xf4b9, fontFamily: iconFont);
public static readonly IconData down_arrow = new IconData(0xf35d, fontFamily: iconFont);
public static readonly IconData up_arrow = new IconData(0xf366, fontFamily: iconFont);
public static readonly IconData battery_charging = new IconData(0xf111, fontFamily: iconFont);
public static readonly IconData battery_empty = new IconData(0xf112, fontFamily: iconFont);
public static readonly IconData battery_full = new IconData(0xf113, fontFamily: iconFont);
public static readonly IconData battery_75_percent = new IconData(0xf114, fontFamily: iconFont);
public static readonly IconData battery_25_percent = new IconData(0xf115, fontFamily: iconFont);
public static readonly IconData bluetooth = new IconData(0xf116, fontFamily: iconFont);
public static readonly IconData restart = new IconData(0xf21c, fontFamily: iconFont);
public static readonly IconData reply_all = new IconData(0xf21d, fontFamily: iconFont);
public static readonly IconData reply_thick_solid = new IconData(0xf21e, fontFamily: iconFont);
public static readonly IconData share_up = new IconData(0xf220, fontFamily: iconFont);
public static readonly IconData shuffle_thick = new IconData(0xf221, fontFamily: iconFont);
public static readonly IconData photo_camera = new IconData(0xf3f5, fontFamily: iconFont);
public static readonly IconData photo_camera_solid = new IconData(0xf3f6, fontFamily: iconFont);
public static readonly IconData video_camera = new IconData(0xf4cc, fontFamily: iconFont);
public static readonly IconData video_camera_solid = new IconData(0xf4cd, fontFamily: iconFont);
public static readonly IconData switch_camera = new IconData(0xf49e, fontFamily: iconFont);
public static readonly IconData switch_camera_solid = new IconData(0xf49f, fontFamily: iconFont);
public static readonly IconData collections = new IconData(0xf3c9, fontFamily: iconFont);
public static readonly IconData collections_solid = new IconData(0xf3ca, fontFamily: iconFont);
public static readonly IconData folder = new IconData(0xf434, fontFamily: iconFont);
public static readonly IconData folder_solid = new IconData(0xf435, fontFamily: iconFont);
public static readonly IconData folder_open = new IconData(0xf38a, fontFamily: iconFont);
public static readonly IconData delete = new IconData(0xf4c4, fontFamily: iconFont);
public static readonly IconData delete_solid = new IconData(0xf4c5, fontFamily: iconFont);
public static readonly IconData delete_simple = new IconData(0xf37f, fontFamily: iconFont);
public static readonly IconData pen = new IconData(0xf2bf, fontFamily: iconFont);
public static readonly IconData pencil = new IconData(0xf37e, fontFamily: iconFont);
public static readonly IconData create = new IconData(0xf417, fontFamily: iconFont);
public static readonly IconData create_solid = new IconData(0xf417, fontFamily: iconFont);
public static readonly IconData refresh = new IconData(0xf49a, fontFamily: iconFont);
public static readonly IconData refresh_circled = new IconData(0xf49b, fontFamily: iconFont);
public static readonly IconData refresh_circled_solid = new IconData(0xf49c, fontFamily: iconFont);
public static readonly IconData refresh_thin = new IconData(0xf49d, fontFamily: iconFont);
public static readonly IconData refresh_thick = new IconData(0xf3a8, fontFamily: iconFont);
public static readonly IconData refresh_bold = new IconData(0xf21c, fontFamily: iconFont);
public static readonly IconData clear_thick = new IconData(0xf2d7, fontFamily: iconFont);
public static readonly IconData clear_thick_circled = new IconData(0xf36e, fontFamily: iconFont);
public static readonly IconData clear = new IconData(0xf404, fontFamily: iconFont);
public static readonly IconData clear_circled = new IconData(0xf405, fontFamily: iconFont);
public static readonly IconData clear_circled_solid = new IconData(0xf406, fontFamily: iconFont);
public static readonly IconData add = new IconData(0xf489, fontFamily: iconFont);
public static readonly IconData add_circled = new IconData(0xf48a, fontFamily: iconFont);
public static readonly IconData add_circled_solid = new IconData(0xf48b, fontFamily: iconFont);
public static readonly IconData gear = new IconData(0xf43c, fontFamily: iconFont);
public static readonly IconData gear_solid = new IconData(0xf43d, fontFamily: iconFont);
public static readonly IconData gear_big = new IconData(0xf2f7, fontFamily: iconFont);
public static readonly IconData settings = new IconData(0xf411, fontFamily: iconFont);
public static readonly IconData settings_solid = new IconData(0xf412, fontFamily: iconFont);
public static readonly IconData music_note = new IconData(0xf46b, fontFamily: iconFont);
public static readonly IconData double_music_note = new IconData(0xf46c, fontFamily: iconFont);
public static readonly IconData play_arrow = new IconData(0xf487, fontFamily: iconFont);
public static readonly IconData play_arrow_solid = new IconData(0xf488, fontFamily: iconFont);
public static readonly IconData pause = new IconData(0xf477, fontFamily: iconFont);
public static readonly IconData pause_solid = new IconData(0xf478, fontFamily: iconFont);
public static readonly IconData loop = new IconData(0xf449, fontFamily: iconFont);
public static readonly IconData loop_thick = new IconData(0xf44a, fontFamily: iconFont);
public static readonly IconData volume_down = new IconData(0xf3b7, fontFamily: iconFont);
public static readonly IconData volume_mute = new IconData(0xf3b8, fontFamily: iconFont);
public static readonly IconData volume_off = new IconData(0xf3b9, fontFamily: iconFont);
public static readonly IconData volume_up = new IconData(0xf3ba, fontFamily: iconFont);
public static readonly IconData fullscreen = new IconData(0xf386, fontFamily: iconFont);
public static readonly IconData fullscreen_exit = new IconData(0xf37d, fontFamily: iconFont);
public static readonly IconData mic_off = new IconData(0xf45f, fontFamily: iconFont);
public static readonly IconData mic = new IconData(0xf460, fontFamily: iconFont);
public static readonly IconData mic_solid = new IconData(0xf461, fontFamily: iconFont);
public static readonly IconData clock = new IconData(0xf4be, fontFamily: iconFont);
public static readonly IconData clock_solid = new IconData(0xf4bf, fontFamily: iconFont);
public static readonly IconData time = new IconData(0xf402, fontFamily: iconFont);
public static readonly IconData time_solid = new IconData(0xf403, fontFamily: iconFont);
public static readonly IconData padlock = new IconData(0xf4c8, fontFamily: iconFont);
public static readonly IconData padlock_solid = new IconData(0xf4c9, fontFamily: iconFont);
public static readonly IconData eye = new IconData(0xf424, fontFamily: iconFont);
public static readonly IconData eye_solid = new IconData(0xf425, fontFamily: iconFont);
public static readonly IconData person = new IconData(0xf47d, fontFamily: iconFont);
public static readonly IconData person_solid = new IconData(0xf47e, fontFamily: iconFont);
public static readonly IconData person_add = new IconData(0xf47f, fontFamily: iconFont);
public static readonly IconData person_add_solid = new IconData(0xf480, fontFamily: iconFont);
public static readonly IconData group = new IconData(0xf47b, fontFamily: iconFont);
public static readonly IconData group_solid = new IconData(0xf47c, fontFamily: iconFont);
public static readonly IconData mail = new IconData(0xf422, fontFamily: iconFont);
public static readonly IconData mail_solid = new IconData(0xf423, fontFamily: iconFont);
public static readonly IconData location = new IconData(0xf455, fontFamily: iconFont);
public static readonly IconData location_solid = new IconData(0xf456, fontFamily: iconFont);
public static readonly IconData tag = new IconData(0xf48c, fontFamily: iconFont);
public static readonly IconData tag_solid = new IconData(0xf48d, fontFamily: iconFont);
public static readonly IconData tags = new IconData(0xf48e, fontFamily: iconFont);
public static readonly IconData tags_solid = new IconData(0xf48f, fontFamily: iconFont);
public static readonly IconData bus = new IconData(0xf36d, fontFamily: iconFont);
public static readonly IconData car = new IconData(0xf36f, fontFamily: iconFont);
public static readonly IconData car_detailed = new IconData(0xf2c1, fontFamily: iconFont);
public static readonly IconData train_style_one = new IconData(0xf3af, fontFamily: iconFont);
public static readonly IconData train_style_two = new IconData(0xf3b4, fontFamily: iconFont);
public static readonly IconData paw = new IconData(0xf479, fontFamily: iconFont);
public static readonly IconData paw_solid = new IconData(0xf47a, fontFamily: iconFont);
public static readonly IconData game_controller = new IconData(0xf43a, fontFamily: iconFont);
public static readonly IconData game_controller_solid = new IconData(0xf43b, fontFamily: iconFont);
public static readonly IconData lab_flask = new IconData(0xf430, fontFamily: iconFont);
public static readonly IconData lab_flask_solid = new IconData(0xf431, fontFamily: iconFont);
public static readonly IconData heart = new IconData(0xf442, fontFamily: iconFont);
public static readonly IconData heart_solid = new IconData(0xf443, fontFamily: iconFont);
public static readonly IconData bell = new IconData(0xf3e1, fontFamily: iconFont);
public static readonly IconData bell_solid = new IconData(0xf3e2, fontFamily: iconFont);
public static readonly IconData news = new IconData(0xf471, fontFamily: iconFont);
public static readonly IconData news_solid = new IconData(0xf472, fontFamily: iconFont);
}
}

14
Runtime/cupertino/route.cs


public const int _kMaxPageBackAnimationTime = 300; // Milliseconds.
public static Color _kModalBarrierColor = new Color(0x6604040F);
public static readonly Color _kModalBarrierColor = new Color(0x6604040F);
public static TimeSpan _kModalPopupTransitionDuration = new TimeSpan(0, 0, 0, 0, 335);
public static readonly TimeSpan _kModalPopupTransitionDuration = new TimeSpan(0, 0, 0, 0, 335);
public static Animatable<Offset> _kRightMiddleTween = new OffsetTween(
public static readonly Animatable<Offset> _kRightMiddleTween = new OffsetTween(
public static Animatable<Offset> _kMiddleLeftTween = new OffsetTween(
public static readonly Animatable<Offset> _kMiddleLeftTween = new OffsetTween(
public static Animatable<Offset> _kBottomUpTween = new OffsetTween(
public static readonly Animatable<Offset> _kBottomUpTween = new OffsetTween(
public static DecorationTween _kGradientShadowTween = new DecorationTween(
public static readonly DecorationTween _kGradientShadowTween = new DecorationTween(
end: new _CupertinoEdgeShadowDecoration(
edgeGradient: new LinearGradient(
begin: new Alignment(0.9f, 0.0f),

}
public static Animatable<float> _dialogScaleTween = new FloatTween(begin: 1.3f, end: 1.0f)
public static readonly Animatable<float> _dialogScaleTween = new FloatTween(begin: 1.3f, end: 1.0f)
.chain(new CurveTween(curve: Curves.linearToEaseOut));
public static Widget _buildCupertinoDialogTransitions(BuildContext context, Animation<float> animation,

8
Runtime/cupertino/scrollbar.cs


namespace Unity.UIWidgets.cupertino {
class CupertinoScrollbarUtils {
public static Color _kScrollbarColor = new Color(0x99777777);
public static readonly Color _kScrollbarColor = new Color(0x99777777);
public static Radius _kScrollbarRadius = Radius.circular(1.25f);
public static TimeSpan _kScrollbarTimeToFade = new TimeSpan(0, 0, 0, 0, 50);
public static TimeSpan _kScrollbarFadeDuration = new TimeSpan(0, 0, 0, 0, 250);
public static readonly Radius _kScrollbarRadius = Radius.circular(1.25f);
public static readonly TimeSpan _kScrollbarTimeToFade = new TimeSpan(0, 0, 0, 0, 50);
public static readonly TimeSpan _kScrollbarFadeDuration = new TimeSpan(0, 0, 0, 0, 250);
}
public class CupertinoScrollbar : StatefulWidget {

6
Runtime/cupertino/switch.cs


public const float _kSwitchWidth = 59.0f;
public const float _kSwitchHeight = 39.0f;
public const float _kCupertinoSwitchDisabledOpacity = 0.5f;
public static Color _kTrackColor = CupertinoColors.lightBackgroundGray;
public static TimeSpan _kReactionDuration = new TimeSpan(0, 0, 0, 0, 300);
public static TimeSpan _kToggleDuration = new TimeSpan(0, 0, 0, 0, 200);
public static readonly Color _kTrackColor = CupertinoColors.lightBackgroundGray;
public static readonly TimeSpan _kReactionDuration = new TimeSpan(0, 0, 0, 0, 300);
public static readonly TimeSpan _kToggleDuration = new TimeSpan(0, 0, 0, 0, 200);
}
public class CupertinoSwitch : StatefulWidget {

2
Runtime/cupertino/text_selection.cs


namespace Unity.UIWidgets.cupertino {
public static class CupertinoTextSelectionUtils {
public static TextSelectionControls cupertinoTextSelectionControls = new _CupertinoTextSelectionControls();
public static readonly TextSelectionControls cupertinoTextSelectionControls = new _CupertinoTextSelectionControls();
public const float _kHandlesPadding = 18.0f;

32
Samples/UIWidgetsGallery/demo/cupertino/cupertino_alert_demo.cs


message: new Text(
"Please select the best dessert from the options below."),
actions: new List<Widget> {
// new CupertinoActionSheetAction(
// child: new Text("Profiteroles"),
// onPressed: () => {
// Navigator.pop(_context, "Profiteroles");
// }
// ),
// new CupertinoActionSheetAction(
// child: new Text("Cannolis"),
// onPressed: () => {
// Navigator.pop(_context, "Cannolis");
// }
// ),
// new CupertinoActionSheetAction(
// child: new Text("Trifle"),
// onPressed: () => { Navigator.pop(_context, "Trifle"); }
// )
new CupertinoActionSheetAction(
child: new Text("Profiteroles"),
onPressed: () => {
Navigator.pop(_context, "Profiteroles");
}
),
new CupertinoActionSheetAction(
child: new Text("Cannolis"),
onPressed: () => {
Navigator.pop(_context, "Cannolis");
}
),
new CupertinoActionSheetAction(
child: new Text("Trifle"),
onPressed: () => { Navigator.pop(_context, "Trifle"); }
)
},
cancelButton: new CupertinoActionSheetAction(
child: new Text("Cancel"),

正在加载...
取消
保存