浏览代码

add demow

/zgh-devtools
Shiyun Wen 4 年前
当前提交
c405c37f
共有 2 个文件被更改,包括 93 次插入5 次删除
  1. 12
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine_demo.cs
  2. 86
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/demos.cs

12
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine_demo.cs


namespace UIWidgetsGallery.demo
{
class ShrineDemo : StatelessWidget {
public ShrineDemo(Key key = null) : base(key: key){}
class ShrineDemo : StatelessWidget
{
public ShrineDemo(Key key = null) : base(key: key){}
public static readonly string routeName = "/shrine"; // Used by the Gallery app.
public static readonly string routeName = "/shrine";
public override Widget build(BuildContext context) => new ShrineApp();
public override Widget build(BuildContext context)
{
return new ShrineApp();
}
}
}

86
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/demos.cs


public static List<GalleryDemo> _buildGalleryDemos()
{
List<GalleryDemo> cupertinoDemos = new List<GalleryDemo>()
{
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) => new 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) => new 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) => 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) => new CupertinoNavigationDemo()
),
new GalleryDemo(
title: "Pickers",
icon: GalleryIcons.events,
category: GalleryDemoCategory._kCupertinoComponents,
routeName: CupertinoPickerDemo.routeName,
documentationUrl: "https://docs.flutter.io/flutter/cupertino/CupertinoPicker-class.html",
buildRoute: (BuildContext context) => new CupertinoPickerDemo()
),
new GalleryDemo(
title: "Pull to refresh",
icon: GalleryIcons.cupertino_pull_to_refresh,
routeName: CupertinoRefreshControlDemo.routeName,
documentationUrl:
"https://docs.flutter.io/flutter/cupertino/CupertinoSliverRefreshControl-class.html",
buildRoute: (BuildContext context) => new 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) => new 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) => new 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) => new CupertinoSwitchDemo()
),
new GalleryDemo(
title: "Text Fields",
icon: GalleryIcons.text_fields_alt,
category: GalleryDemoCategory._kCupertinoComponents,
routeName: CupertinoTextFieldDemo.routeName,
buildRoute: (BuildContext context) => new CupertinoTextFieldDemo()
)
};
List<GalleryDemo> galleryDemos = new List<GalleryDemo>
{
new GalleryDemo(

)
};
return galleryDemos;
return cupertinoDemos;
}
public static readonly List<GalleryDemo> kAllGalleryDemos = _buildGalleryDemos();

正在加载...
取消
保存