浏览代码

Merge pull request #284 from IIzzaya/cupertino

[Cupertino] Update Cupertino gallery
/main
GitHub 5 年前
当前提交
30fb2bc5
共有 29 个文件被更改,包括 4314 次插入404 次删除
  1. 36
      Runtime/cupertino/nav_bar.cs
  2. 16
      Runtime/cupertino/scrollbar.cs
  3. 50
      Runtime/cupertino/switch.cs
  4. 25
      Runtime/ui/text.cs
  5. 5
      Samples/UIWidgetsGallery/Editor/GalleryMainEditor.cs
  6. 5
      Samples/UIWidgetsGallery/GalleryMain.cs
  7. 30
      Samples/UIWidgetsGallery/gallery/demo.cs
  8. 681
      Samples/UIWidgetsGallery/gallery/demos.cs
  9. 8
      Samples/UIWidgetsGallery/demo/cupertino.meta
  10. 1001
      Tests/Resources/SF-Pro-Text-Bold.otf
  11. 24
      Tests/Resources/SF-Pro-Text-Bold.otf.meta
  12. 1001
      Tests/Resources/SF-Pro-Text-Regular.otf
  13. 22
      Tests/Resources/SF-Pro-Text-Regular.otf.meta
  14. 1001
      Tests/Resources/SF-Pro-Text-Semibold.otf
  15. 23
      Tests/Resources/SF-Pro-Text-Semibold.otf.meta
  16. 11
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_buttons_demo.cs.meta
  17. 24
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_activity_indicator_demo.cs
  18. 11
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_activity_indicator_demo.cs.meta
  19. 273
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_alert_demo.cs
  20. 11
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_alert_demo.cs.meta
  21. 86
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_buttons_demo.cs
  22. 5
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_navigation_demo.cs
  23. 71
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_slider_demo.cs
  24. 11
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_slider_demo.cs.meta
  25. 73
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_switch_demo.cs
  26. 11
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_switch_demo.cs.meta
  27. 192
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_text_field_demo.cs
  28. 11
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_text_field_demo.cs.meta

36
Runtime/cupertino/nav_bar.cs


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

public static readonly _HeroTag _defaultHeroTag = new _HeroTag(null);
public static Widget _wrapWithBackground(
Border border,
Color backgroundColor,
Widget child,
Border border = null,
Color backgroundColor = null,
Widget child = null,
bool updateSystemUiOverlay = true
) {
Widget result = child;

bool transitionBetweenRoutes = true,
object heroTag = null
) : base(key: key) {
D.assert(
heroTag != null,
() => "heroTag cannot be null. Use transitionBetweenRoutes = false to " +
"disable Hero transition on this navigation bar."
);
D.assert(
!transitionBetweenRoutes || ReferenceEquals(heroTag, NavBarUtils._defaultHeroTag),
() => "Cannot specify a heroTag override if this navigation bar does not " +
"transition due to transitionBetweenRoutes = false."
);
this.leading = leading;
this.automaticallyImplyLeading = automaticallyImplyLeading;
this.automaticallyImplyMiddle = automaticallyImplyMiddle;

this.actionsForegroundColor = actionsForegroundColor;
this.transitionBetweenRoutes = transitionBetweenRoutes;
this.heroTag = heroTag ?? NavBarUtils._defaultHeroTag;
D.assert(
this.heroTag != null,
() => "heroTag cannot be null. Use transitionBetweenRoutes = false to " +
"disable Hero transition on this navigation bar."
);
D.assert(
!transitionBetweenRoutes || ReferenceEquals(this.heroTag, NavBarUtils._defaultHeroTag),
() => "Cannot specify a heroTag override if this navigation bar does not " +
"transition due to transitionBetweenRoutes = false."
);
}
public readonly Widget leading;

EdgeInsets padding = null,
bool? middleVisible = null
) : base(key: key) {
this.components = components;
this.padding = padding;
this.middleVisible = middleVisible ?? true;
}
public readonly _NavigationBarStaticComponents components;

class _BackChevron : StatelessWidget {
public _BackChevron(Key key = null) : base(key: key) {
}
public _BackChevron(Key key = null) : base(key: key) { }
public override Widget build(BuildContext context) {
TextStyle textStyle = DefaultTextStyle.of(context).style;

) : base(key: componentsKeys.navBarBoxKey) {
D.assert(largeExpanded != null);
D.assert(!largeExpanded.Value || this.largeTitleTextStyle != null);
this.componentsKeys = componentsKeys;
this.backgroundColor = backgroundColor;
this.backButtonTextStyle = backButtonTextStyle;

16
Runtime/cupertino/scrollbar.cs


using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.cupertino {
public class CupertinoScrollbarUtils {
class CupertinoScrollbarUtils {
public static float _kScrollbarThickness = 2.5f;
public static float _kScrollbarMainAxisMargin = 4.0f;
public static float _kScrollbarCrossAxisMargin = 2.5f;
public static float _kScrollbarMinLength = 36.0f;
public static float _kScrollbarMinOverscrollLength = 8.0f;
public const float _kScrollbarThickness = 2.5f;
public const float _kScrollbarMainAxisMargin = 4.0f;
public const float _kScrollbarCrossAxisMargin = 2.5f;
public const float _kScrollbarMinLength = 36.0f;
public const float _kScrollbarMinOverscrollLength = 8.0f;
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 readonly Widget child;
public override State createState() => new _CupertinoScrollbarState();
public override State createState() {
return new _CupertinoScrollbarState();
}
}
class _CupertinoScrollbarState : TickerProviderStateMixin<CupertinoScrollbar> {

50
Runtime/cupertino/switch.cs


namespace Unity.UIWidgets.cupertino {
class CupertinoSwitchUtils {
public static float _kTrackWidth = 51.0f;
public static float _kTrackHeight = 31.0f;
public static float _kTrackRadius = _kTrackHeight / 2.0f;
public static float _kTrackInnerStart = _kTrackHeight / 2.0f;
public static float _kTrackInnerEnd = _kTrackWidth - _kTrackInnerStart;
public static float _kTrackInnerLength = _kTrackInnerEnd - _kTrackInnerStart;
public static float _kSwitchWidth = 59.0f;
public static float _kSwitchHeight = 39.0f;
public static float _kCupertinoSwitchDisabledOpacity = 0.5f;
public const float _kTrackWidth = 51.0f;
public const float _kTrackHeight = 31.0f;
public const float _kTrackRadius = _kTrackHeight / 2.0f;
public const float _kTrackInnerStart = _kTrackHeight / 2.0f;
public const float _kTrackInnerEnd = _kTrackWidth - _kTrackInnerStart;
public const float _kTrackInnerLength = _kTrackInnerEnd - _kTrackInnerStart;
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 readonly ValueChanged<bool> onChanged;
public readonly TickerProvider vsync;
public readonly DragStartBehavior dragStartBehavior;
return (RenderObject) new _RenderCupertinoSwitch(
return new _RenderCupertinoSwitch(
value: this.value,
activeColor: this.activeColor,
onChanged: this.onChanged,

Color activeColor,
TextDirection textDirection,
TickerProvider vsync,
ValueChanged<bool> onChanged,
ValueChanged<bool> onChanged = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.start
) : base(additionalConstraints: BoxConstraints.tightFor(
width: CupertinoSwitchUtils._kSwitchWidth,

}
this._value = value;
// this.markNeedsSemanticsUpdate();
this._position.curve = Curves.ease;
this._position.reverseCurve = Curves.ease.flipped;
if (value) {

}
bool _value;
public TickerProvider vsync {
get { return this._vsync; }

TapGestureRecognizer _tap;
HorizontalDragGestureRecognizer _drag;
public override void attach(object owne) {
base.attach(this.owner);
public override void attach(object _owner) {
base.attach(_owner);
if (this.value) {
this._positionController.forward();
}

this._position.curve = null;
this._position.reverseCurve = null;
float delta = details.primaryDelta / CupertinoSwitchUtils._kTrackInnerLength ?? 0f;
switch (this.textDirection) {
case TextDirection.rtl:
this._positionController.setValue(this._positionController.value - delta);
break;
case TextDirection.ltr:
this._positionController.setValue(this._positionController.value + delta);
break;
}
this._positionController.setValue(this._positionController.value + delta);
// switch (this.textDirection) {
// case TextDirection.rtl:
// this._positionController.setValue(this._positionController.value - delta);
// break;
// case TextDirection.ltr:
// this._positionController.setValue(this._positionController.value + delta);
// break;
// }
}
}

25
Runtime/ui/text.cs


public readonly int index;
public static readonly FontWeight w100 = new FontWeight(0);
public static readonly FontWeight w200 = new FontWeight(1);
public static readonly FontWeight w300 = new FontWeight(2);
public static readonly FontWeight w400 = new FontWeight(3);
public static readonly FontWeight w500 = new FontWeight(4);
public static readonly FontWeight w600 = new FontWeight(5);
public static readonly FontWeight w700 = new FontWeight(6);
public static readonly FontWeight w800 = new FontWeight(7);
public static readonly FontWeight w900 = new FontWeight(8);
public static readonly FontWeight w100 = new FontWeight(0); // Ultralight
public static readonly FontWeight w200 = new FontWeight(1); // Thin
public static readonly FontWeight w300 = new FontWeight(2); // Light
public static readonly FontWeight w400 = new FontWeight(3); // Regular
public static readonly FontWeight w500 = new FontWeight(4); // Medium
public static readonly FontWeight w600 = new FontWeight(5); // Semibold
public static readonly FontWeight w700 = new FontWeight(6); // Bold
public static readonly FontWeight w800 = new FontWeight(7); // Heavy
public static readonly FontWeight w900 = new FontWeight(8); // Black
public static readonly FontWeight bold = w700;

5
Samples/UIWidgetsGallery/Editor/GalleryMainEditor.cs


protected override void OnEnable() {
FontManager.instance.addFont(Resources.Load<Font>("MaterialIcons-Regular"), "Material Icons");
FontManager.instance.addFont(Resources.Load<Font>("GalleryIcons"), "GalleryIcons");
FontManager.instance.addFont(Resources.Load<Font>("CupertinoIcons"), "CupertinoIcons");
FontManager.instance.addFont(Resources.Load<Font>(path: "SF-Pro-Text-Regular"), ".SF Pro Text", FontWeight.w400);
FontManager.instance.addFont(Resources.Load<Font>(path: "SF-Pro-Text-Semibold"), ".SF Pro Text", FontWeight.w600);
FontManager.instance.addFont(Resources.Load<Font>(path: "SF-Pro-Text-Bold"), ".SF Pro Text", FontWeight.w700);
base.OnEnable();
}
}

5
Samples/UIWidgetsGallery/GalleryMain.cs


FontManager.instance.addFont(Resources.Load<Font>("MaterialIcons-Regular"), "Material Icons");
FontManager.instance.addFont(Resources.Load<Font>("GalleryIcons"), "GalleryIcons");
FontManager.instance.addFont(Resources.Load<Font>("CupertinoIcons"), "CupertinoIcons");
FontManager.instance.addFont(Resources.Load<Font>(path: "SF-Pro-Text-Regular"), ".SF Pro Text", FontWeight.w400);
FontManager.instance.addFont(Resources.Load<Font>(path: "SF-Pro-Text-Semibold"), ".SF Pro Text", FontWeight.w600);
FontManager.instance.addFont(Resources.Load<Font>(path: "SF-Pro-Text-Bold"), ".SF Pro Text", FontWeight.w700);
base.OnEnable();
}
}

30
Samples/UIWidgetsGallery/gallery/demo.cs


using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

&& other.description == this.description
&& other.documentationUrl == this.documentationUrl;
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;

}
public class FullScreenCodeDialogState : State<FullScreenCodeDialog> {
public FullScreenCodeDialogState() {
}
public FullScreenCodeDialogState() { }
string _exampleCode;

return new IconButton(
icon: new Icon(Icons.library_books),
tooltip: "API documentation",
onPressed: () => Application.OpenURL(this.documentationUrl)
);
}
}
class CupertinoDemoDocumentationButton : StatelessWidget {
public CupertinoDemoDocumentationButton(
string routeName,
Key key = null
) : base(key: key) {
this.documentationUrl = DemoUtils.kDemoDocumentationUrl[routeName];
D.assert(
DemoUtils.kDemoDocumentationUrl[routeName] != null,
() => $"A documentation URL was not specified for demo route {routeName} in kAllGalleryDemos"
);
}
public readonly string documentationUrl;
public override Widget build(BuildContext context) {
return new CupertinoButton(
padding: EdgeInsets.zero,
child: new Icon(CupertinoIcons.book),
onPressed: () => Application.OpenURL(this.documentationUrl)
);
}

681
Samples/UIWidgetsGallery/gallery/demos.cs


using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.widgets;
namespace UIWidgetsGallery.gallery {

if (ReferenceEquals(null, other)) {
return false;
}
return string.Equals(this.name, other.name) && Equals(this.icon, other.icon);
}

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

public override string ToString() {
return $"{this.GetType()}({this.title} {this.routeName})";
}
}
public static partial class DemoUtils {

title: "Shrine",
subtitle: "Basic shopping app",
icon: GalleryIcons.shrine,
category: DemoUtils._kDemos,
category: _kDemos,
routeName: ShrineDemo.routeName,
buildRoute: (BuildContext context) => new ShrineDemo()
),

icon: GalleryIcons.account_box,
category: DemoUtils._kDemos,
category: _kDemos,
routeName: ContactsDemo.routeName,
buildRoute: (BuildContext context) => new ContactsDemo()
),

icon: GalleryIcons.animation,
category: DemoUtils._kDemos,
category: _kDemos,
routeName: AnimationDemo.routeName,
buildRoute: (BuildContext context) => new AnimationDemo()
),

title: "Colors",
subtitle: "All of the predefined colors",
icon: GalleryIcons.colors,
category: DemoUtils._kStyle,
category: _kStyle,
routeName: ColorsDemo.routeName,
buildRoute: (BuildContext context) => new ColorsDemo()
),

icon: GalleryIcons.custom_typography,
category: DemoUtils._kStyle,
category: _kStyle,
routeName: TypographyDemo.routeName,
buildRoute: (BuildContext context) => new TypographyDemo()
),

title: "Backdrop",
subtitle: "Select a front layer from back layer",
icon: GalleryIcons.backdrop,
category: DemoUtils._kMaterialComponents,
category: _kMaterialComponents,
routeName: BackdropDemo.routeName,
buildRoute: (BuildContext context) => new BackdropDemo()
),

icon: GalleryIcons.bottom_app_bar,
category: DemoUtils._kMaterialComponents,
category: _kMaterialComponents,
routeName: BottomAppBarDemo.routeName,
documentationUrl: "https://docs.flutter.io/flutter/material/BottomAppBar-class.html",
buildRoute: (BuildContext context) => new BottomAppBarDemo()

subtitle: "Bottom navigation with cross-fading views",
icon: GalleryIcons.bottom_navigation,
category: DemoUtils._kMaterialComponents,
category: _kMaterialComponents,
routeName: BottomNavigationDemo.routeName,
documentationUrl: "https://docs.flutter.io/flutter/material/BottomNavigationBar-class.html",
buildRoute: (BuildContext context) => new BottomNavigationDemo()

title: "Buttons",
subtitle: "Flat, raised, dropdown, and more",
icon: GalleryIcons.generic_buttons,
category: DemoUtils._kMaterialComponents,
category: _kMaterialComponents,
routeName: ButtonsDemo.routeName,
buildRoute: (BuildContext context) => new ButtonsDemo()
),

title: "Cards",
subtitle: "Baseline cards with rounded corners",
icon: GalleryIcons.cards,
category: DemoUtils._kMaterialComponents,
category: _kMaterialComponents,
routeName: CardsDemo.routeName,
documentationUrl: "https://docs.flutter.io/flutter/material/Card-class.html",
buildRoute: (BuildContext context) => new CardsDemo()

documentationUrl: "https://docs.flutter.io/flutter/material/Chip-class.html",
buildRoute: (BuildContext context) => new ChipDemo()
),
// new GalleryDemo(
// title: "Data tables",
// subtitle: "Rows and columns",
// icon: GalleryIcons.data_table,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: DataTableDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/PaginatedDataTable-class.html",
// buildRoute: (BuildContext context) => DataTableDemo()
// ),
// new GalleryDemo(
// title: "Dialogs",
// subtitle: "Simple, alert, and fullscreen",
// icon: GalleryIcons.dialogs,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: DialogDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/showDialog.html",
// buildRoute: (BuildContext context) => DialogDemo()
// ),
// new GalleryDemo(
// title: "Elevations",
// subtitle: "Shadow values on cards",
// // TODO(larche): Change to custom icon for elevations when one exists.
// icon: GalleryIcons.cupertino_progress,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: ElevationDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/Material/elevation.html",
// buildRoute: (BuildContext context) => ElevationDemo()
// ),
// new GalleryDemo(
// title: "Expand/collapse list control",
// subtitle: "A list with one sub-list level",
// icon: GalleryIcons.expand_all,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: TwoLevelListDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/ExpansionTile-class.html",
// buildRoute: (BuildContext context) => TwoLevelListDemo()
// ),
// new GalleryDemo(
// title: "Expansion panels",
// subtitle: "List of expanding panels",
// icon: GalleryIcons.expand_all,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: ExpansionPanelsDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/ExpansionPanel-class.html",
// buildRoute: (BuildContext context) => ExpansionPanelsDemo()
// ),
// new GalleryDemo(
// title: "Grid",
// subtitle: "Row and column layout",
// icon: GalleryIcons.grid_on,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: GridListDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/widgets/GridView-class.html",
// buildRoute: (BuildContext context) => new GridListDemo()
// ),
// new GalleryDemo(
// title: "Icons",
// subtitle: "Enabled and disabled icons with opacity",
// icon: GalleryIcons.sentiment_very_satisfied,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: IconsDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/IconButton-class.html",
// buildRoute: (BuildContext context) => IconsDemo()
// ),
// new GalleryDemo(
// title: "Lists",
// subtitle: "Scrolling list layouts",
// icon: GalleryIcons.list_alt,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: ListDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/ListTile-class.html",
// buildRoute: (BuildContext context) => new ListDemo()
// ),
// new GalleryDemo(
// title: "Lists: leave-behind list items",
// subtitle: "List items with hidden actions",
// icon: GalleryIcons.lists_leave_behind,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: LeaveBehindDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/widgets/Dismissible-class.html",
// buildRoute: (BuildContext context) => new LeaveBehindDemo()
// ),
// new GalleryDemo(
// title: "Lists: reorderable",
// subtitle: "Reorderable lists",
// icon: GalleryIcons.list_alt,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: ReorderableListDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/ReorderableListView-class.html",
// buildRoute: (BuildContext context) => new ReorderableListDemo()
// ),
// new GalleryDemo(
// title: "Menus",
// subtitle: "Menu buttons and simple menus",
// icon: GalleryIcons.more_vert,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: MenuDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/PopupMenuButton-class.html",
// buildRoute: (BuildContext context) => new MenuDemo()
// ),
// new GalleryDemo(
// title: "Navigation drawer",
// subtitle: "Navigation drawer with standard header",
// icon: GalleryIcons.menu,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: DrawerDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/Drawer-class.html",
// buildRoute: (BuildContext context) => DrawerDemo()
// ),
// new GalleryDemo(
// title: "Pagination",
// subtitle: "PageView with indicator",
// icon: GalleryIcons.page_control,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: PageSelectorDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/TabBarView-class.html",
// buildRoute: (BuildContext context) => PageSelectorDemo()
// ),
// new GalleryDemo(
// title: "Pickers",
// subtitle: "Date and time selection widgets",
// icon: GalleryIcons.@event,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: DateAndTimePickerDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/showDatePicker.html",
// buildRoute: (BuildContext context) => DateAndTimePickerDemo()
// ),
// new GalleryDemo(
// title: "Progress indicators",
// subtitle: "Linear, circular, indeterminate",
// icon: GalleryIcons.progress_activity,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: ProgressIndicatorDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/LinearProgressIndicator-class.html",
// buildRoute: (BuildContext context) => ProgressIndicatorDemo()
// ),
// new GalleryDemo(
// title: "Pull to refresh",
// subtitle: "Refresh indicators",
// icon: GalleryIcons.refresh,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: OverscrollDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/RefreshIndicator-class.html",
// buildRoute: (BuildContext context) => OverscrollDemo()
// ),
// new GalleryDemo(
// title: "Search",
// subtitle: "Expandable search",
// icon: Icons.search,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: SearchDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/showSearch.html",
// buildRoute: (BuildContext context) => SearchDemo()
// ),
// new GalleryDemo(
// title: "Selection controls",
// subtitle: "Checkboxes, radio buttons, and switches",
// icon: GalleryIcons.check_box,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: SelectionControlsDemo.routeName,
// buildRoute: (BuildContext context) => SelectionControlsDemo()
// ),
// new GalleryDemo(
// title: "Sliders",
// subtitle: "Widgets for selecting a value by swiping",
// icon: GalleryIcons.sliders,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: SliderDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/Slider-class.html",
// buildRoute: (BuildContext context) => SliderDemo()
// ),
// new GalleryDemo(
// title: "Snackbar",
// subtitle: "Temporary messaging",
// icon: GalleryIcons.snackbar,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: SnackBarDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/ScaffoldState/showSnackBar.html",
// buildRoute: (BuildContext context) => SnackBarDemo()
// ),
// new GalleryDemo(
// title: "Tabs",
// subtitle: "Tabs with independently scrollable views",
// icon: GalleryIcons.tabs,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: TabsDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/TabBarView-class.html",
// buildRoute: (BuildContext context) => TabsDemo()
// ),
// new GalleryDemo(
// title: "Tabs: Scrolling",
// subtitle: "Tab bar that scrolls",
// category: GalleryDemoCategory._kMaterialComponents,
// icon: GalleryIcons.tabs,
// routeName: ScrollableTabsDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/TabBar-class.html",
// buildRoute: (BuildContext context) => ScrollableTabsDemo()
// ),
// new GalleryDemo(
// title: "Text fields",
// subtitle: "Single line of editable text and numbers",
// icon: GalleryIcons.text_fields_alt,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: TextFormFieldDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/TextFormField-class.html",
// buildRoute: (BuildContext context) => const TextFormFieldDemo()
// ),
// new GalleryDemo(
// title: "Tooltips",
// subtitle: "Short message displayed on long-press",
// icon: GalleryIcons.tooltip,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: TooltipDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/Tooltip-class.html",
// buildRoute: (BuildContext context) => TooltipDemo()
// ),
//
// // Cupertino Components
// new GalleryDemo(
// title: "Activity Indicator",
// icon: GalleryIcons.cupertino_progress,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoProgressIndicatorDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoActivityIndicator-class.html",
// buildRoute: (BuildContext context) => CupertinoProgressIndicatorDemo()
// ),
// new GalleryDemo(
// title: "Alerts",
// icon: GalleryIcons.dialogs,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoAlertDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/cupertino/showCupertinoDialog.html",
// buildRoute: (BuildContext context) => CupertinoAlertDemo()
// ),
// new GalleryDemo(
// title: "Buttons",
// icon: GalleryIcons.generic_buttons,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoButtonsDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoButton-class.html",
// buildRoute: (BuildContext context) => CupertinoButtonsDemo()
// ),
// new GalleryDemo(
// title: "Navigation",
// icon: GalleryIcons.bottom_navigation,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoNavigationDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoTabScaffold-class.html",
// buildRoute: (BuildContext context) => CupertinoNavigationDemo()
// ),
// new GalleryDemo(
// title: "Pickers",
// icon: GalleryIcons.@event,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoPickerDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoPicker-class.html",
// buildRoute: (BuildContext context) => CupertinoPickerDemo()
// ),
// new GalleryDemo(
// title: "Pull to refresh",
// icon: GalleryIcons.cupertino_pull_to_refresh,
// category: _kCupertinoComponents,
// routeName: CupertinoRefreshControlDemo.routeName,
// documentationUrl:
// "https://docs.flutter.io/flutter/cupertino/CupertinoSliverRefreshControl-class.html",
// buildRoute: (BuildContext context) => CupertinoRefreshControlDemo()
// ),
// new GalleryDemo(
// title: "Segmented Control",
// icon: GalleryIcons.tabs,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoSegmentedControlDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoSegmentedControl-class.html",
// buildRoute: (BuildContext context) => CupertinoSegmentedControlDemo()
// ),
// new GalleryDemo(
// title: "Sliders",
// icon: GalleryIcons.sliders,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoSliderDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoSlider-class.html",
// buildRoute: (BuildContext context) => CupertinoSliderDemo()
// ),
// new GalleryDemo(
// title: "Switches",
// icon: GalleryIcons.cupertino_switch,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoSwitchDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoSwitch-class.html",
// buildRoute: (BuildContext context) => CupertinoSwitchDemo()
// ),
// new GalleryDemo(
// title: "Text Fields",
// icon: GalleryIcons.text_fields_alt,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoTextFieldDemo.routeName,
// buildRoute: (BuildContext context) => CupertinoTextFieldDemo()
// ),
//
// // Media
// new GalleryDemo(
// title: "Animated images",
// subtitle: "GIF and WebP animations",
// icon: GalleryIcons.animation,
// category: GalleryDemoCategory._kMedia,
// routeName: ImagesDemo.routeName,
// buildRoute: (BuildContext context) => ImagesDemo()
// ),
// new GalleryDemo(
// title: "Video",
// subtitle: "Video playback",
// icon: GalleryIcons.drive_video,
// category: GalleryDemoCategory._kMedia,
// routeName: VideoDemo.routeName,
// buildRoute: (BuildContext context) => new VideoDemo()
// ),
// new GalleryDemo(
// title: "Data tables",
// subtitle: "Rows and columns",
// icon: GalleryIcons.data_table,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: DataTableDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/PaginatedDataTable-class.html",
// buildRoute: (BuildContext context) => DataTableDemo()
// ),
// new GalleryDemo(
// title: "Dialogs",
// subtitle: "Simple, alert, and fullscreen",
// icon: GalleryIcons.dialogs,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: DialogDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/showDialog.html",
// buildRoute: (BuildContext context) => DialogDemo()
// ),
// new GalleryDemo(
// title: "Elevations",
// subtitle: "Shadow values on cards",
// // TODO(larche): Change to custom icon for elevations when one exists.
// icon: GalleryIcons.cupertino_progress,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: ElevationDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/Material/elevation.html",
// buildRoute: (BuildContext context) => ElevationDemo()
// ),
// new GalleryDemo(
// title: "Expand/collapse list control",
// subtitle: "A list with one sub-list level",
// icon: GalleryIcons.expand_all,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: TwoLevelListDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/ExpansionTile-class.html",
// buildRoute: (BuildContext context) => TwoLevelListDemo()
// ),
// new GalleryDemo(
// title: "Expansion panels",
// subtitle: "List of expanding panels",
// icon: GalleryIcons.expand_all,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: ExpansionPanelsDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/ExpansionPanel-class.html",
// buildRoute: (BuildContext context) => ExpansionPanelsDemo()
// ),
// new GalleryDemo(
// title: "Grid",
// subtitle: "Row and column layout",
// icon: GalleryIcons.grid_on,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: GridListDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/widgets/GridView-class.html",
// buildRoute: (BuildContext context) => new GridListDemo()
// ),
// new GalleryDemo(
// title: "Icons",
// subtitle: "Enabled and disabled icons with opacity",
// icon: GalleryIcons.sentiment_very_satisfied,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: IconsDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/IconButton-class.html",
// buildRoute: (BuildContext context) => IconsDemo()
// ),
// new GalleryDemo(
// title: "Lists",
// subtitle: "Scrolling list layouts",
// icon: GalleryIcons.list_alt,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: ListDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/ListTile-class.html",
// buildRoute: (BuildContext context) => new ListDemo()
// ),
// new GalleryDemo(
// title: "Lists: leave-behind list items",
// subtitle: "List items with hidden actions",
// icon: GalleryIcons.lists_leave_behind,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: LeaveBehindDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/widgets/Dismissible-class.html",
// buildRoute: (BuildContext context) => new LeaveBehindDemo()
// ),
// new GalleryDemo(
// title: "Lists: reorderable",
// subtitle: "Reorderable lists",
// icon: GalleryIcons.list_alt,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: ReorderableListDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/ReorderableListView-class.html",
// buildRoute: (BuildContext context) => new ReorderableListDemo()
// ),
// new GalleryDemo(
// title: "Menus",
// subtitle: "Menu buttons and simple menus",
// icon: GalleryIcons.more_vert,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: MenuDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/PopupMenuButton-class.html",
// buildRoute: (BuildContext context) => new MenuDemo()
// ),
// new GalleryDemo(
// title: "Navigation drawer",
// subtitle: "Navigation drawer with standard header",
// icon: GalleryIcons.menu,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: DrawerDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/Drawer-class.html",
// buildRoute: (BuildContext context) => DrawerDemo()
// ),
// new GalleryDemo(
// title: "Pagination",
// subtitle: "PageView with indicator",
// icon: GalleryIcons.page_control,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: PageSelectorDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/TabBarView-class.html",
// buildRoute: (BuildContext context) => PageSelectorDemo()
// ),
// new GalleryDemo(
// title: "Pickers",
// subtitle: "Date and time selection widgets",
// icon: GalleryIcons.@event,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: DateAndTimePickerDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/showDatePicker.html",
// buildRoute: (BuildContext context) => DateAndTimePickerDemo()
// ),
// new GalleryDemo(
// title: "Progress indicators",
// subtitle: "Linear, circular, indeterminate",
// icon: GalleryIcons.progress_activity,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: ProgressIndicatorDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/LinearProgressIndicator-class.html",
// buildRoute: (BuildContext context) => ProgressIndicatorDemo()
// ),
// new GalleryDemo(
// title: "Pull to refresh",
// subtitle: "Refresh indicators",
// icon: GalleryIcons.refresh,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: OverscrollDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/RefreshIndicator-class.html",
// buildRoute: (BuildContext context) => OverscrollDemo()
// ),
// new GalleryDemo(
// title: "Search",
// subtitle: "Expandable search",
// icon: Icons.search,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: SearchDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/showSearch.html",
// buildRoute: (BuildContext context) => SearchDemo()
// ),
// new GalleryDemo(
// title: "Selection controls",
// subtitle: "Checkboxes, radio buttons, and switches",
// icon: GalleryIcons.check_box,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: SelectionControlsDemo.routeName,
// buildRoute: (BuildContext context) => SelectionControlsDemo()
// ),
// new GalleryDemo(
// title: "Sliders",
// subtitle: "Widgets for selecting a value by swiping",
// icon: GalleryIcons.sliders,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: SliderDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/Slider-class.html",
// buildRoute: (BuildContext context) => SliderDemo()
// ),
// new GalleryDemo(
// title: "Snackbar",
// subtitle: "Temporary messaging",
// icon: GalleryIcons.snackbar,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: SnackBarDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/ScaffoldState/showSnackBar.html",
// buildRoute: (BuildContext context) => SnackBarDemo()
// ),
// new GalleryDemo(
// title: "Tabs",
// subtitle: "Tabs with independently scrollable views",
// icon: GalleryIcons.tabs,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: TabsDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/TabBarView-class.html",
// buildRoute: (BuildContext context) => TabsDemo()
// ),
// new GalleryDemo(
// title: "Tabs: Scrolling",
// subtitle: "Tab bar that scrolls",
// category: GalleryDemoCategory._kMaterialComponents,
// icon: GalleryIcons.tabs,
// routeName: ScrollableTabsDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/TabBar-class.html",
// buildRoute: (BuildContext context) => ScrollableTabsDemo()
// ),
// new GalleryDemo(
// title: "Text fields",
// subtitle: "Single line of editable text and numbers",
// icon: GalleryIcons.text_fields_alt,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: TextFormFieldDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/TextFormField-class.html",
// buildRoute: (BuildContext context) => const TextFormFieldDemo()
// ),
// new GalleryDemo(
// title: "Tooltips",
// subtitle: "Short message displayed on long-press",
// icon: GalleryIcons.tooltip,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: TooltipDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/Tooltip-class.html",
// buildRoute: (BuildContext context) => TooltipDemo()
// ),
//
// Cupertino Components
// new GalleryDemo(
// title: "Activity Indicator",
// icon: GalleryIcons.cupertino_progress,
// category: _kCupertinoComponents,
// routeName: CupertinoProgressIndicatorDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoActivityIndicator-class.html",
// buildRoute: (BuildContext context) => CupertinoProgressIndicatorDemo()
// ),
// new GalleryDemo(
// title: "Alerts",
// icon: GalleryIcons.dialogs,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoAlertDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/cupertino/showCupertinoDialog.html",
// buildRoute: (BuildContext context) => CupertinoAlertDemo()
// ),
new GalleryDemo(
title: "Buttons",
icon: GalleryIcons.generic_buttons,
category: _kCupertinoComponents,
routeName: CupertinoButtonsDemo.routeName,
documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoButton-class.html",
buildRoute: (BuildContext context) => new CupertinoButtonsDemo()
),
// new GalleryDemo(
// title: "Navigation",
// icon: GalleryIcons.bottom_navigation,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoNavigationDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoTabScaffold-class.html",
// buildRoute: (BuildContext context) => CupertinoNavigationDemo()
// ),
// new GalleryDemo(
// title: "Pickers",
// icon: GalleryIcons.@event,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoPickerDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoPicker-class.html",
// buildRoute: (BuildContext context) => CupertinoPickerDemo()
// ),
// new GalleryDemo(
// title: "Pull to refresh",
// icon: GalleryIcons.cupertino_pull_to_refresh,
// category: _kCupertinoComponents,
// routeName: CupertinoRefreshControlDemo.routeName,
// documentationUrl:
// "https://docs.flutter.io/flutter/cupertino/CupertinoSliverRefreshControl-class.html",
// buildRoute: (BuildContext context) => CupertinoRefreshControlDemo()
// ),
// new GalleryDemo(
// title: "Segmented Control",
// icon: GalleryIcons.tabs,
// category: GalleryDemoCategory._kCupertinoComponents,
// routeName: CupertinoSegmentedControlDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoSegmentedControl-class.html",
// buildRoute: (BuildContext context) => CupertinoSegmentedControlDemo()
// ),
new GalleryDemo(
title: "Sliders",
icon: GalleryIcons.sliders,
category: _kCupertinoComponents,
routeName: CupertinoSliderDemo.routeName,
documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoSlider-class.html",
buildRoute: (BuildContext context) => new CupertinoSliderDemo()
),
new GalleryDemo(
title: "Switches",
icon: GalleryIcons.cupertino_switch,
category: _kCupertinoComponents,
routeName: CupertinoSwitchDemo.routeName,
documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoSwitch-class.html",
buildRoute: (BuildContext context) => new CupertinoSwitchDemo()
),
new GalleryDemo(
title: "Text Fields",
icon: GalleryIcons.text_fields_alt,
category: _kCupertinoComponents,
routeName: CupertinoTextFieldDemo.routeName,
buildRoute: (BuildContext context) => new CupertinoTextFieldDemo()
),
//
// // Media
// new GalleryDemo(
// title: "Animated images",
// subtitle: "GIF and WebP animations",
// icon: GalleryIcons.animation,
// category: GalleryDemoCategory._kMedia,
// routeName: ImagesDemo.routeName,
// buildRoute: (BuildContext context) => ImagesDemo()
// ),
// new GalleryDemo(
// title: "Video",
// subtitle: "Video playback",
// icon: GalleryIcons.drive_video,
// category: GalleryDemoCategory._kMedia,
// routeName: VideoDemo.routeName,
// buildRoute: (BuildContext context) => new VideoDemo()
// ),
// galleryDemos.Insert(0,
// new GalleryDemo(
// title: "Pesto",
// subtitle: "Simple recipe browser",
// icon: Icons.adjust,
// category: GalleryDemoCategory._kDemos,
// routeName: PestoDemo.routeName,
// buildRoute: (BuildContext context) => new PestoDemo()
// )
// );
// galleryDemos.Insert(0,
// new GalleryDemo(
// title: "Pesto",
// subtitle: "Simple recipe browser",
// icon: Icons.adjust,
// category: GalleryDemoCategory._kDemos,
// routeName: PestoDemo.routeName,
// buildRoute: (BuildContext context) => new PestoDemo()
// )
// );
return true;
});

demo => demo.documentationUrl
);
}
}
}

8
Samples/UIWidgetsGallery/demo/cupertino.meta


fileFormatVersion: 2
guid: b971f24af9c984210a511bd0e81945a3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/Resources/SF-Pro-Text-Bold.otf
文件差异内容过多而无法显示
查看文件

24
Tests/Resources/SF-Pro-Text-Bold.otf.meta


fileFormatVersion: 2
guid: fe4433873da2c44a58194766452da171
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontName: SF Pro Text
fontNames:
- SF Pro Text
fallbackFontReferences:
- {fileID: 12800000, guid: d59013752e4e844828a89a2b96cfa704, type: 3}
- {fileID: 12800000, guid: a7b8140888514456bb2e63f86338624a, type: 3}
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/Resources/SF-Pro-Text-Regular.otf
文件差异内容过多而无法显示
查看文件

22
Tests/Resources/SF-Pro-Text-Regular.otf.meta


fileFormatVersion: 2
guid: a7b8140888514456bb2e63f86338624a
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontName: SF Pro Text
fontNames:
- SF Pro Text
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/Resources/SF-Pro-Text-Semibold.otf
文件差异内容过多而无法显示
查看文件

23
Tests/Resources/SF-Pro-Text-Semibold.otf.meta


fileFormatVersion: 2
guid: d59013752e4e844828a89a2b96cfa704
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontName: SF Pro Text
fontNames:
- SF Pro Text
fallbackFontReferences:
- {fileID: 12800000, guid: a7b8140888514456bb2e63f86338624a, type: 3}
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:

11
Samples/UIWidgetsGallery/demo/cupertino/cupertino_buttons_demo.cs.meta


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

24
Samples/UIWidgetsGallery/demo/cupertino/cupertino_activity_indicator_demo.cs


using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.widgets;
namespace UIWidgetsGallery.gallery {
/*
class CupertinoProgressIndicatorDemo : StatelessWidget {
public static string routeName = "/cupertino/progress_indicator";
public override
Widget build(BuildContext context) {
return new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
previousPageTitle: "Cupertino",
middle: new Text("Activity Indicator"),
trailing: new CupertinoDemoDocumentationButton(routeName)
),
child: new Center(
child: new CupertinoActivityIndicator()
)
);
}
}
*/
}

11
Samples/UIWidgetsGallery/demo/cupertino/cupertino_activity_indicator_demo.cs.meta


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

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


using System.Collections.Generic;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.widgets;
namespace UIWidgetsGallery.gallery {
/*
class CupertinoAlertDemo : StatefulWidget {
public static string routeName = "/cupertino/alert";
public override State createState() => new _CupertinoAlertDemoState();
}
class _CupertinoAlertDemoState : State<CupertinoAlertDemo> {
string lastSelectedValue;
void showDemoDialog(
BuildContext context = null,
Widget child = null
) {
CupertinoRouteUtils.showCupertinoDialog<string>(
context: context,
builder: (BuildContext _context) => child
).Then((string value) => {
if (value != null) {
this.setState(() => { this.lastSelectedValue = value; });
}
});
}
void showDemoActionSheet(
BuildContext context = null,
Widget child = null
) {
CupertinoRouteUtils.showCupertinoModalPopup<string>(
context: context,
builder: (BuildContext _context) => child
).Then((string value) => {
if (value != null) {
this.setState(() => { this.lastSelectedValue = value; });
}
});
}
public override Widget build(BuildContext context) {
return new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
middle: new Text("Alerts"),
previousPageTitle: "Cupertino",
trailing: new CupertinoDemoDocumentationButton(CupertinoAlertDemo.routeName)
),
child:
new DefaultTextStyle(
style: CupertinoTheme.of(context).textTheme.textStyle,
child: new Builder(
builder: (BuildContext _context) => {
List<Widget> stackChildren = new List<Widget> {
new ListView(
padding: EdgeInsets.symmetric(vertical: 24.0f, horizontal: 72.0f)
+ MediaQuery.of(_context).padding,
children: new List<Widget> {
CupertinoButton.filled(
child: new Text("Alert"),
onPressed: () => {
this.showDemoDialog(
context: _context,
child: new CupertinoAlertDialog(
title: new Text("Discard draft?"),
actions: new List<Widget> {
new CupertinoDialogAction(
child: new Text("Discard"),
isDestructiveAction: true,
onPressed: () => { Navigator.pop(_context, "Discard"); }
),
new CupertinoDialogAction(
child: new Text("Cancel"),
isDefaultAction: true,
onPressed: () => { Navigator.pop(_context, "Cancel"); }
),
}
)
);
}
),
new Padding(padding: EdgeInsets.all(8.0f)),
CupertinoButton.filled(
child: new Text("Alert with Title"),
padding: EdgeInsets.symmetric(vertical: 16.0f, horizontal: 36.0f),
onPressed: () => {
this.showDemoDialog(
context: _context,
child: new CupertinoAlertDialog(
title: new Text(
"Allow \"Maps\" to access your location while you are using the app?")
,
content: new Text(
"Your current location will be displayed on the map and used \n" +
"for directions, nearby search results, and estimated travel times.")
,
actions: new List<Widget> {
new CupertinoDialogAction(
child: new Text("Don\"t Allow"),
onPressed: () => {
Navigator.pop(_context, "Disallow");
}
),
new CupertinoDialogAction(
child: new Text("Allow"),
onPressed: () => { Navigator.pop(_context, "Allow"); }
),
}
)
);
}
),
new Padding(padding: EdgeInsets.all(8.0f)),
CupertinoButton.filled(
child: new Text("Alert with Buttons"),
padding: EdgeInsets.symmetric(vertical: 16.0f, horizontal: 36.0f),
onPressed: () => {
this.showDemoDialog(
context: _context,
child: new CupertinoDessertDialog(
title: new Text("Select Favorite Dessert"),
content: new Text(
"Please select your favorite type of dessert from the \n" +
"list below. Your selection will be used to customize the suggested \n" +
"list of eateries in your area.")
)
);
}
),
new Padding(padding: EdgeInsets.all(8.0f)),
CupertinoButton.filled(
child: new Text("Alert Buttons Only"),
padding: EdgeInsets.symmetric(vertical: 16.0f, horizontal: 36.0f),
onPressed: () => {
this.showDemoDialog(
context: _context,
child: new CupertinoDessertDialog()
);
}
),
new Padding(padding: EdgeInsets.all(8.0f)),
CupertinoButton.filled(
child: new Text("Action Sheet"),
padding: EdgeInsets.symmetric(vertical: 16.0f, horizontal: 36.0f),
onPressed: () => {
this.showDemoActionSheet(
context: _context,
child: new CupertinoActionSheet(
title: new Text("Favorite Dessert"),
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"); }
),
},
cancelButton: new CupertinoActionSheetAction(
child: new Text("Cancel"),
isDefaultAction:
true,
onPressed:
() => { Navigator.pop(_context, "Cancel"); }
)
)
);
}
)
}
)
};
if (this.lastSelectedValue != null) {
stackChildren.Add(
new Positioned(
bottom: 32.0f,
child: new Text("You selected: $lastSelectedValue")
)
);
}
return new Stack(
alignment: Alignment.center,
children: stackChildren
);
}
)
)
);
}
}
class CupertinoDessertDialog : StatelessWidget {
public CupertinoDessertDialog(
Key key = null,
Widget title = null,
Widget content = null
) : base(key: key) {
this.title = title;
this.content = content;
}
public readonly Widget title;
public readonly Widget content;
public override Widget build(BuildContext context) {
return new CupertinoAlertDialog(
title: title,
content: content,
actions: new List<Widget> {
new CupertinoDialogAction(
child: new Text("Cheesecake"),
onPressed: () => { Navigator.pop(context, "Cheesecake"); }
),
new CupertinoDialogAction(
child: new Text("Tiramisu"),
onPressed: () => { Navigator.pop(context, "Tiramisu"); }
),
new CupertinoDialogAction(
child: new Text("Apple Pie"),
onPressed:
() => { Navigator.pop(context, "Apple Pie"); }
),
new CupertinoDialogAction(
child: new Text("Devil\"s food cake"),
onPressed:
() => { Navigator.pop(context, "Devil\"s food cake"); }
),
new CupertinoDialogAction(
child: new Text("Banana Split"),
onPressed:
() => { Navigator.pop(context, "Banana Split"); }
),
new CupertinoDialogAction(
child: new Text("Oatmeal Cookie"),
onPressed:
() => { Navigator.pop(context, "Oatmeal Cookies"); }
),
new CupertinoDialogAction(
child: new Text("Chocolate Brownie"),
onPressed:
() => { Navigator.pop(context, "Chocolate Brownies"); }
),
new CupertinoDialogAction(
child: new Text("Cancel"),
isDestructiveAction:
true,
onPressed:
() => { Navigator.pop(context, "Cancel"); }
),
}
);
}
}
*/
}

11
Samples/UIWidgetsGallery/demo/cupertino/cupertino_alert_demo.cs.meta


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

86
Samples/UIWidgetsGallery/demo/cupertino/cupertino_buttons_demo.cs


using System.Collections.Generic;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.widgets;
namespace UIWidgetsGallery.gallery {
class CupertinoButtonsDemo : StatefulWidget {
public static string routeName = "/cupertino/buttons";
public override State createState() {
return new _CupertinoButtonDemoState();
}
}
class _CupertinoButtonDemoState : State<CupertinoButtonsDemo> {
int _pressedCount = 0;
public override Widget build(BuildContext context) {
return new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
middle: new Text("Buttons"),
previousPageTitle: "Cupertino",
trailing: new CupertinoDemoDocumentationButton(CupertinoButtonsDemo.routeName)
),
child: new DefaultTextStyle(
style: CupertinoTheme.of(context).textTheme.textStyle,
child: new SafeArea(
child: new Column(
children: new List<Widget> {
new Padding(
padding: EdgeInsets.all(16.0f),
child: new Text(
"iOS themed buttons are flat. They can have borders or backgrounds but only when necessary."
)
),
new Expanded(
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: new List<Widget> {
new Text(this._pressedCount > 0
? $"Button pressed {this._pressedCount} time" +
(this._pressedCount == 1 ? "" : "s")
: " "),
new Padding(padding: EdgeInsets.all(12.0f)),
new Align(
alignment: new Alignment(0.0f, -0.2f),
child:
new Row(
mainAxisSize: MainAxisSize.min,
children: new List<Widget> {
new CupertinoButton(
child: new Text("Cupertino Button"),
onPressed:
() => { this.setState(() => { this._pressedCount += 1; }); }
),
new CupertinoButton(
child: new Text("Disabled"),
onPressed: null
)
}
)
),
new Padding(padding: EdgeInsets.all(12.0f)),
CupertinoButton.filled(
child: new Text("With Background"),
onPressed:
() => { this.setState(() => { this._pressedCount += 1; }); }
),
new Padding(padding: EdgeInsets.all(12.0f)),
CupertinoButton.filled(
child: new Text("Disabled"),
onPressed: null
),
}
)
)
}
)
)
)
);
}
}
}

5
Samples/UIWidgetsGallery/demo/cupertino/cupertino_navigation_demo.cs


namespace UIWidgetsGallery.gallery {
public class cupertino_navigation_demo {
}
}

71
Samples/UIWidgetsGallery/demo/cupertino/cupertino_slider_demo.cs


using System.Collections.Generic;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.widgets;
namespace UIWidgetsGallery.gallery {
class CupertinoSliderDemo : StatefulWidget {
public static string routeName = "/cupertino/slider";
public override State createState() {
return new _CupertinoSliderDemoState();
}
}
class _CupertinoSliderDemoState : State<CupertinoSliderDemo> {
float _value = 25.0f;
float _discreteValue = 20.0f;
public override Widget build(BuildContext context) {
return new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
middle: new Text("Sliders"),
previousPageTitle: "Cupertino",
trailing: new CupertinoDemoDocumentationButton(CupertinoSliderDemo.routeName)
),
child: new DefaultTextStyle(
style: CupertinoTheme.of(context).textTheme.textStyle,
child: new SafeArea(
child: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: new List<Widget> {
new Column(
mainAxisSize: MainAxisSize.min,
children: new List<Widget> {
new CupertinoSlider(
value: this._value,
min: 0.0f,
max: 100.0f,
divisions: 100, // TODO: FIX BUG
onChanged: (float value) => {
this.setState(() => { this._value = value; });
}
),
new Text($"Cupertino Continuous: {this._value.ToString("F1")}"),
}
),
new Column(
mainAxisSize: MainAxisSize.min,
children: new List<Widget> {
new CupertinoSlider(
value: this._discreteValue,
min: 0.0f,
max: 100.0f,
divisions: 5,
onChanged: (float value) => {
this.setState(() => { this._discreteValue = value; });
}
),
new Text($"Cupertino Discrete: {this._discreteValue}"),
}
),
}
)
)
)
)
);
}
}
}

11
Samples/UIWidgetsGallery/demo/cupertino/cupertino_slider_demo.cs.meta


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

73
Samples/UIWidgetsGallery/demo/cupertino/cupertino_switch_demo.cs


using System.Collections.Generic;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.widgets;
namespace UIWidgetsGallery.gallery {
class CupertinoSwitchDemo : StatefulWidget {
public static string routeName = "/cupertino/switch";
public override State createState() => new _CupertinoSwitchDemoState();
}
class _CupertinoSwitchDemoState : State<CupertinoSwitchDemo> {
bool _switchValue = false;
public override Widget build(BuildContext context) {
return new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
middle: new Text("Switch"),
previousPageTitle: "Cupertino",
trailing: new CupertinoDemoDocumentationButton(CupertinoSwitchDemo.routeName)
),
child: new DefaultTextStyle(
style: CupertinoTheme.of(context).textTheme.textStyle,
child: new SafeArea(
child: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: new List<Widget> {
new Column(
children: new List<Widget> {
new CupertinoSwitch(
value: this._switchValue,
onChanged: (bool value) => {
this.setState(() => { this._switchValue = value; });
}
),
new Text(
"Enabled - " + (this._switchValue ? "On" : "Off")
),
}
),
new Column(
children: new List<Widget> {
new CupertinoSwitch(
value: true,
onChanged: null
),
new Text(
"Disabled - On"
),
}
),
new Column(
children: new List<Widget> {
new CupertinoSwitch(
value: false,
onChanged: null
),
new Text(
"Disabled - Off"
),
}
)
}
)
)
)
)
);
}
}
}

11
Samples/UIWidgetsGallery/demo/cupertino/cupertino_switch_demo.cs.meta


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

192
Samples/UIWidgetsGallery/demo/cupertino/cupertino_text_field_demo.cs


using System.Collections.Generic;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.service;
using Unity.UIWidgets.widgets;
namespace UIWidgetsGallery.gallery {
class CupertinoTextFieldDemo : StatefulWidget {
public const string routeName = "/cupertino/text_fields";
public override State createState() {
return new _CupertinoTextFieldDemoState();
}
}
class _CupertinoTextFieldDemoState : State<CupertinoTextFieldDemo> {
TextEditingController _chatTextController;
TextEditingController _locationTextController;
public override void initState() {
base.initState();
this._chatTextController = new TextEditingController();
this._locationTextController = new TextEditingController(text: "Montreal, Canada");
}
Widget _buildChatTextField() {
return new CupertinoTextField(
controller: this._chatTextController,
textCapitalization: TextCapitalization.sentences,
placeholder: "Text Message",
decoration: new BoxDecoration(
border: Border.all(
width: 0.0f,
color: CupertinoColors.inactiveGray
),
borderRadius: BorderRadius.circular(15.0f)
),
maxLines: null,
keyboardType: TextInputType.multiline,
prefix: new Padding(padding: EdgeInsets.symmetric(horizontal: 4.0f)),
suffix:
new Padding(
padding: EdgeInsets.symmetric(horizontal: 4.0f),
child: new CupertinoButton(
color: CupertinoColors.activeGreen,
minSize: 0.0f,
child: new Icon(
CupertinoIcons.up_arrow,
size: 21.0f,
color: CupertinoColors.white
),
padding: EdgeInsets.all(2.0f),
borderRadius:
BorderRadius.circular(15.0f),
onPressed: () => this.setState(() => this._chatTextController.clear())
)
),
autofocus: true,
suffixMode: OverlayVisibilityMode.editing,
onSubmitted: (string text) => this.setState(() => this._chatTextController.clear())
);
}
Widget _buildNameField() {
return new CupertinoTextField(
prefix: new Icon(
CupertinoIcons.person_solid,
color: CupertinoColors.lightBackgroundGray,
size: 28.0f
),
padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
clearButtonMode: OverlayVisibilityMode.editing,
textCapitalization: TextCapitalization.words,
autocorrect: false,
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
),
placeholder: "Name"
);
}
Widget _buildEmailField() {
return new CupertinoTextField(
prefix: new Icon(
CupertinoIcons.mail_solid,
color: CupertinoColors.lightBackgroundGray,
size: 28.0f
),
padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
clearButtonMode: OverlayVisibilityMode.editing,
keyboardType: TextInputType.emailAddress,
autocorrect: false,
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
),
placeholder: "Email"
);
}
Widget _buildLocationField() {
return new CupertinoTextField(
controller: this._locationTextController,
prefix: new Icon(
CupertinoIcons.location_solid,
color: CupertinoColors.lightBackgroundGray,
size: 28.0f
),
padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
clearButtonMode: OverlayVisibilityMode.editing,
textCapitalization: TextCapitalization.words,
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
),
placeholder: "Location"
);
}
Widget _buildPinField() {
return new CupertinoTextField(
prefix: new Icon(
CupertinoIcons.padlock_solid,
color: CupertinoColors.lightBackgroundGray,
size: 28.0f
),
padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
clearButtonMode: OverlayVisibilityMode.editing,
keyboardType: TextInputType.number,
autocorrect: false,
obscureText: true,
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
),
placeholder: "Create a PIN"
);
}
Widget _buildTagsField() {
return new CupertinoTextField(
controller: new TextEditingController(text: "colleague, reading club"),
prefix: new Icon(
CupertinoIcons.tags_solid,
color: CupertinoColors.lightBackgroundGray,
size: 28.0f
),
enabled: false,
padding: EdgeInsets.symmetric(horizontal: 6.0f, vertical: 12.0f),
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(width: 0.0f, color: CupertinoColors.inactiveGray))
)
);
}
public override Widget build(BuildContext context) {
return new DefaultTextStyle(
style: new TextStyle(
fontFamily: ".SF Pro Text", // ".SF UI Text",
inherit: false,
fontSize: 17.0f,
color: CupertinoColors.black
),
child: new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
previousPageTitle: "Cupertino",
middle: new Text("Text Fields")
),
child: new SafeArea(
child: new ListView(
children: new List<Widget> {
new Padding(
padding: EdgeInsets.symmetric(vertical: 32.0f, horizontal: 16.0f),
child: new Column(
children: new List<Widget> {
this._buildNameField(),
this._buildEmailField(),
this._buildLocationField(),
this._buildPinField(),
this._buildTagsField(),
}
)
),
new Padding(
padding: EdgeInsets.symmetric(vertical: 32.0f, horizontal: 16.0f),
child: this._buildChatTextField()
),
}
)
)
)
);
}
}
}

11
Samples/UIWidgetsGallery/demo/cupertino/cupertino_text_field_demo.cs.meta


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