Unverified Commit 22c12f9f authored by Hans Muller's avatar Hans Muller Committed by GitHub

Gallery demos: reordered and retitled (#17220)

parent 50bd39a9
...@@ -153,17 +153,41 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -153,17 +153,41 @@ List<GalleryDemo> _buildGalleryDemos() {
routeName: BottomNavigationDemo.routeName, routeName: BottomNavigationDemo.routeName,
buildRoute: (BuildContext context) => new BottomNavigationDemo(), buildRoute: (BuildContext context) => new BottomNavigationDemo(),
), ),
new GalleryDemo(
title: 'Bottom sheet: Modal',
subtitle: 'A dismissable bottom sheet',
icon: GalleryIcons.bottom_sheets,
category: _kMaterialComponents,
routeName: ModalBottomSheetDemo.routeName,
buildRoute: (BuildContext context) => new ModalBottomSheetDemo(),
),
new GalleryDemo(
title: 'Bottom sheet: Persistent',
subtitle: 'A bottom sheet that sticks around',
icon: GalleryIcons.bottom_sheet_persistent,
category: _kMaterialComponents,
routeName: PersistentBottomSheetDemo.routeName,
buildRoute: (BuildContext context) => new PersistentBottomSheetDemo(),
),
new GalleryDemo( new GalleryDemo(
title: 'Buttons', title: 'Buttons',
subtitle: 'All kinds: flat, raised, dropdown, icon, etc', subtitle: 'Flat, raised, dropdown, and more',
icon: GalleryIcons.generic_buttons, icon: GalleryIcons.generic_buttons,
category: _kMaterialComponents, category: _kMaterialComponents,
routeName: ButtonsDemo.routeName, routeName: ButtonsDemo.routeName,
buildRoute: (BuildContext context) => new ButtonsDemo(), buildRoute: (BuildContext context) => new ButtonsDemo(),
), ),
new GalleryDemo(
title: 'Buttons: Floating Action Button',
subtitle: 'FAB with transitions',
icon: GalleryIcons.buttons,
category: _kMaterialComponents,
routeName: TabsFabDemo.routeName,
buildRoute: (BuildContext context) => new TabsFabDemo(),
),
new GalleryDemo( new GalleryDemo(
title: 'Cards', title: 'Cards',
subtitle: 'Material with rounded corners and a drop shadow', subtitle: 'Baseline cards with rounded corners',
icon: GalleryIcons.cards, icon: GalleryIcons.cards,
category: _kMaterialComponents, category: _kMaterialComponents,
routeName: CardsDemo.routeName, routeName: CardsDemo.routeName,
...@@ -171,7 +195,7 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -171,7 +195,7 @@ List<GalleryDemo> _buildGalleryDemos() {
), ),
new GalleryDemo( new GalleryDemo(
title: 'Chips', title: 'Chips',
subtitle: 'Label with an optional delete button and avatar', subtitle: 'Labeled with delete buttons and avatars',
icon: GalleryIcons.chips, icon: GalleryIcons.chips,
category: _kMaterialComponents, category: _kMaterialComponents,
routeName: ChipDemo.routeName, routeName: ChipDemo.routeName,
...@@ -186,32 +210,16 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -186,32 +210,16 @@ List<GalleryDemo> _buildGalleryDemos() {
buildRoute: (BuildContext context) => new DataTableDemo(), buildRoute: (BuildContext context) => new DataTableDemo(),
), ),
new GalleryDemo( new GalleryDemo(
title: 'Date and time pickers', title: 'Dialogs',
subtitle: 'Date and time selection widgets', subtitle: 'Simple, alert, and fullscreen',
icon: GalleryIcons.event,
category: _kMaterialComponents,
routeName: DateAndTimePickerDemo.routeName,
buildRoute: (BuildContext context) => new DateAndTimePickerDemo(),
),
new GalleryDemo(
title: 'Dialog',
subtitle: 'All kinds: simple, alert, fullscreen, etc',
icon: GalleryIcons.dialogs, icon: GalleryIcons.dialogs,
category: _kMaterialComponents, category: _kMaterialComponents,
routeName: DialogDemo.routeName, routeName: DialogDemo.routeName,
buildRoute: (BuildContext context) => new DialogDemo(), buildRoute: (BuildContext context) => new DialogDemo(),
), ),
new GalleryDemo(
title: 'Drawer',
subtitle: 'Navigation drawer with a standard header',
icon: GalleryIcons.menu,
category: _kMaterialComponents,
routeName: DrawerDemo.routeName,
buildRoute: (BuildContext context) => new DrawerDemo(),
),
new GalleryDemo( new GalleryDemo(
title: 'Expand/collapse list control', title: 'Expand/collapse list control',
subtitle: 'List with one level of sublists', subtitle: 'A list with one sub-list level',
icon: GalleryIcons.expand_all, icon: GalleryIcons.expand_all,
category: _kMaterialComponents, category: _kMaterialComponents,
routeName: TwoLevelListDemo.routeName, routeName: TwoLevelListDemo.routeName,
...@@ -225,14 +233,6 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -225,14 +233,6 @@ List<GalleryDemo> _buildGalleryDemos() {
routeName: ExpansionPanelsDemo.routeName, routeName: ExpansionPanelsDemo.routeName,
buildRoute: (BuildContext context) => new ExpansionPanelsDemo(), buildRoute: (BuildContext context) => new ExpansionPanelsDemo(),
), ),
new GalleryDemo(
title: 'Floating action button',
subtitle: 'Action buttons with transitions',
icon: GalleryIcons.buttons,
category: _kMaterialComponents,
routeName: TabsFabDemo.routeName,
buildRoute: (BuildContext context) => new TabsFabDemo(),
),
new GalleryDemo( new GalleryDemo(
title: 'Grid', title: 'Grid',
subtitle: 'Row and column layout', subtitle: 'Row and column layout',
...@@ -243,28 +243,28 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -243,28 +243,28 @@ List<GalleryDemo> _buildGalleryDemos() {
), ),
new GalleryDemo( new GalleryDemo(
title: 'Icons', title: 'Icons',
subtitle: 'Enabled and disabled icons with varying opacity', subtitle: 'Enabled and disabled icons with opacity',
icon: GalleryIcons.sentiment_very_satisfied, icon: GalleryIcons.sentiment_very_satisfied,
category: _kMaterialComponents, category: _kMaterialComponents,
routeName: IconsDemo.routeName, routeName: IconsDemo.routeName,
buildRoute: (BuildContext context) => new IconsDemo(), buildRoute: (BuildContext context) => new IconsDemo(),
), ),
new GalleryDemo( new GalleryDemo(
title: 'Leave-behind list items', title: 'Lists',
subtitle: 'Scrolling list layouts',
icon: GalleryIcons.list_alt,
category: _kMaterialComponents,
routeName: ListDemo.routeName,
buildRoute: (BuildContext context) => const ListDemo(),
),
new GalleryDemo(
title: 'Lists: leave-behind list items',
subtitle: 'List items with hidden actions', subtitle: 'List items with hidden actions',
icon: GalleryIcons.lists_leave_behind, icon: GalleryIcons.lists_leave_behind,
category: _kMaterialComponents, category: _kMaterialComponents,
routeName: LeaveBehindDemo.routeName, routeName: LeaveBehindDemo.routeName,
buildRoute: (BuildContext context) => const LeaveBehindDemo(), buildRoute: (BuildContext context) => const LeaveBehindDemo(),
), ),
new GalleryDemo(
title: 'List',
subtitle: 'Layout variations for scrollable lists',
icon: GalleryIcons.list_alt,
category: _kMaterialComponents,
routeName: ListDemo.routeName,
buildRoute: (BuildContext context) => const ListDemo(),
),
new GalleryDemo( new GalleryDemo(
title: 'Menus', title: 'Menus',
subtitle: 'Menu buttons and simple menus', subtitle: 'Menu buttons and simple menus',
...@@ -274,15 +274,15 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -274,15 +274,15 @@ List<GalleryDemo> _buildGalleryDemos() {
buildRoute: (BuildContext context) => const MenuDemo(), buildRoute: (BuildContext context) => const MenuDemo(),
), ),
new GalleryDemo( new GalleryDemo(
title: 'Modal bottom sheet', title: 'Navigation drawer',
subtitle: 'Modal sheet that slides up from the bottom', subtitle: 'Navigation drawer with standard header',
icon: GalleryIcons.bottom_sheets, icon: GalleryIcons.menu,
category: _kMaterialComponents, category: _kMaterialComponents,
routeName: ModalBottomSheetDemo.routeName, routeName: DrawerDemo.routeName,
buildRoute: (BuildContext context) => new ModalBottomSheetDemo(), buildRoute: (BuildContext context) => new DrawerDemo(),
), ),
new GalleryDemo( new GalleryDemo(
title: 'Page selector', title: 'Pagination',
subtitle: 'PageView with indicator', subtitle: 'PageView with indicator',
icon: GalleryIcons.page_control, icon: GalleryIcons.page_control,
category: _kMaterialComponents, category: _kMaterialComponents,
...@@ -290,16 +290,16 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -290,16 +290,16 @@ List<GalleryDemo> _buildGalleryDemos() {
buildRoute: (BuildContext context) => new PageSelectorDemo(), buildRoute: (BuildContext context) => new PageSelectorDemo(),
), ),
new GalleryDemo( new GalleryDemo(
title: 'Persistent bottom sheet', title: 'Pickers',
subtitle: 'Sheet that slides up from the bottom', subtitle: 'Date and time selection widgets',
icon: GalleryIcons.bottom_sheet_persistent, icon: GalleryIcons.event,
category: _kMaterialComponents, category: _kMaterialComponents,
routeName: PersistentBottomSheetDemo.routeName, routeName: DateAndTimePickerDemo.routeName,
buildRoute: (BuildContext context) => new PersistentBottomSheetDemo(), buildRoute: (BuildContext context) => new DateAndTimePickerDemo(),
), ),
new GalleryDemo( new GalleryDemo(
title: 'Progress indicators', title: 'Progress indicators',
subtitle: 'All kinds: linear, circular, indeterminate, etc', subtitle: 'Linear, circular, indeterminate',
icon: GalleryIcons.progress_activity, icon: GalleryIcons.progress_activity,
category: _kMaterialComponents, category: _kMaterialComponents,
routeName: ProgressIndicatorDemo.routeName, routeName: ProgressIndicatorDemo.routeName,
...@@ -313,14 +313,6 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -313,14 +313,6 @@ List<GalleryDemo> _buildGalleryDemos() {
routeName: OverscrollDemo.routeName, routeName: OverscrollDemo.routeName,
buildRoute: (BuildContext context) => const OverscrollDemo(), buildRoute: (BuildContext context) => const OverscrollDemo(),
), ),
new GalleryDemo(
title: 'Scrollable tabs',
subtitle: 'Tab bar that scrolls',
category: _kMaterialComponents,
icon: GalleryIcons.tabs,
routeName: ScrollableTabsDemo.routeName,
buildRoute: (BuildContext context) => new ScrollableTabsDemo(),
),
new GalleryDemo( new GalleryDemo(
title: 'Selection controls', title: 'Selection controls',
subtitle: 'Checkboxes, radio buttons, and switches', subtitle: 'Checkboxes, radio buttons, and switches',
...@@ -331,7 +323,7 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -331,7 +323,7 @@ List<GalleryDemo> _buildGalleryDemos() {
), ),
new GalleryDemo( new GalleryDemo(
title: 'Sliders', title: 'Sliders',
subtitle: 'Widgets that select a value by dragging the slider thumb', subtitle: 'Widgets for selecting a value by swiping',
icon: GalleryIcons.sliders, icon: GalleryIcons.sliders,
category: _kMaterialComponents, category: _kMaterialComponents,
routeName: SliderDemo.routeName, routeName: SliderDemo.routeName,
...@@ -339,7 +331,7 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -339,7 +331,7 @@ List<GalleryDemo> _buildGalleryDemos() {
), ),
new GalleryDemo( new GalleryDemo(
title: 'Snackbar', title: 'Snackbar',
subtitle: 'Temporary message that appears at the bottom', subtitle: 'Temporary messaging',
icon: GalleryIcons.snackbar, icon: GalleryIcons.snackbar,
category: _kMaterialComponents, category: _kMaterialComponents,
routeName: SnackBarDemo.routeName, routeName: SnackBarDemo.routeName,
...@@ -353,6 +345,14 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -353,6 +345,14 @@ List<GalleryDemo> _buildGalleryDemos() {
routeName: TabsDemo.routeName, routeName: TabsDemo.routeName,
buildRoute: (BuildContext context) => new TabsDemo(), buildRoute: (BuildContext context) => new TabsDemo(),
), ),
new GalleryDemo(
title: 'Tabs: Scrolling',
subtitle: 'Tab bar that scrolls',
category: _kMaterialComponents,
icon: GalleryIcons.tabs,
routeName: ScrollableTabsDemo.routeName,
buildRoute: (BuildContext context) => new ScrollableTabsDemo(),
),
new GalleryDemo( new GalleryDemo(
title: 'Text fields', title: 'Text fields',
subtitle: 'Single line of editable text and numbers', subtitle: 'Single line of editable text and numbers',
...@@ -363,7 +363,7 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -363,7 +363,7 @@ List<GalleryDemo> _buildGalleryDemos() {
), ),
new GalleryDemo( new GalleryDemo(
title: 'Tooltips', title: 'Tooltips',
subtitle: 'Short message displayed after a long-press', subtitle: 'Short message displayed on long-press',
icon: GalleryIcons.tooltip, icon: GalleryIcons.tooltip,
category: _kMaterialComponents, category: _kMaterialComponents,
routeName: TooltipDemo.routeName, routeName: TooltipDemo.routeName,
...@@ -373,7 +373,6 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -373,7 +373,6 @@ List<GalleryDemo> _buildGalleryDemos() {
// Cupertino Components // Cupertino Components
new GalleryDemo( new GalleryDemo(
title: 'Activity Indicator', title: 'Activity Indicator',
subtitle: 'Cupertino styled activity indicator',
icon: GalleryIcons.cupertino_progress, icon: GalleryIcons.cupertino_progress,
category: _kCupertinoComponents, category: _kCupertinoComponents,
routeName: CupertinoProgressIndicatorDemo.routeName, routeName: CupertinoProgressIndicatorDemo.routeName,
...@@ -381,7 +380,6 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -381,7 +380,6 @@ List<GalleryDemo> _buildGalleryDemos() {
), ),
new GalleryDemo( new GalleryDemo(
title: 'Buttons', title: 'Buttons',
subtitle: 'Cupertino styled buttons',
icon: GalleryIcons.generic_buttons, icon: GalleryIcons.generic_buttons,
category: _kCupertinoComponents, category: _kCupertinoComponents,
routeName: CupertinoButtonsDemo.routeName, routeName: CupertinoButtonsDemo.routeName,
...@@ -389,7 +387,6 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -389,7 +387,6 @@ List<GalleryDemo> _buildGalleryDemos() {
), ),
new GalleryDemo( new GalleryDemo(
title: 'Dialogs', title: 'Dialogs',
subtitle: 'Cupertino styled dialogs',
icon: GalleryIcons.dialogs, icon: GalleryIcons.dialogs,
category: _kCupertinoComponents, category: _kCupertinoComponents,
routeName: CupertinoDialogDemo.routeName, routeName: CupertinoDialogDemo.routeName,
...@@ -397,7 +394,6 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -397,7 +394,6 @@ List<GalleryDemo> _buildGalleryDemos() {
), ),
new GalleryDemo( new GalleryDemo(
title: 'Navigation', title: 'Navigation',
subtitle: 'Cupertino styled navigation patterns',
icon: GalleryIcons.bottom_navigation, icon: GalleryIcons.bottom_navigation,
category: _kCupertinoComponents, category: _kCupertinoComponents,
routeName: CupertinoNavigationDemo.routeName, routeName: CupertinoNavigationDemo.routeName,
...@@ -405,7 +401,6 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -405,7 +401,6 @@ List<GalleryDemo> _buildGalleryDemos() {
), ),
new GalleryDemo( new GalleryDemo(
title: 'Pickers', title: 'Pickers',
subtitle: 'Cupertino styled pickers',
icon: GalleryIcons.event, icon: GalleryIcons.event,
category: _kCupertinoComponents, category: _kCupertinoComponents,
routeName: CupertinoPickerDemo.routeName, routeName: CupertinoPickerDemo.routeName,
...@@ -413,7 +408,6 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -413,7 +408,6 @@ List<GalleryDemo> _buildGalleryDemos() {
), ),
new GalleryDemo( new GalleryDemo(
title: 'Pull to refresh', title: 'Pull to refresh',
subtitle: 'Cupertino styled refresh controls',
icon: GalleryIcons.cupertino_pull_to_refresh, icon: GalleryIcons.cupertino_pull_to_refresh,
category: _kCupertinoComponents, category: _kCupertinoComponents,
routeName: CupertinoRefreshControlDemo.routeName, routeName: CupertinoRefreshControlDemo.routeName,
...@@ -421,7 +415,6 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -421,7 +415,6 @@ List<GalleryDemo> _buildGalleryDemos() {
), ),
new GalleryDemo( new GalleryDemo(
title: 'Sliders', title: 'Sliders',
subtitle: 'Cupertino styled sliders',
icon: GalleryIcons.sliders, icon: GalleryIcons.sliders,
category: _kCupertinoComponents, category: _kCupertinoComponents,
routeName: CupertinoSliderDemo.routeName, routeName: CupertinoSliderDemo.routeName,
...@@ -429,7 +422,6 @@ List<GalleryDemo> _buildGalleryDemos() { ...@@ -429,7 +422,6 @@ List<GalleryDemo> _buildGalleryDemos() {
), ),
new GalleryDemo( new GalleryDemo(
title: 'Switches', title: 'Switches',
subtitle: 'Cupertino styled switches',
icon: GalleryIcons.cupertino_switch, icon: GalleryIcons.cupertino_switch,
category: _kCupertinoComponents, category: _kCupertinoComponents,
routeName: CupertinoSwitchDemo.routeName, routeName: CupertinoSwitchDemo.routeName,
......
...@@ -176,6 +176,25 @@ class _DemoItem extends StatelessWidget { ...@@ -176,6 +176,25 @@ class _DemoItem extends StatelessWidget {
final bool isDark = theme.brightness == Brightness.dark; final bool isDark = theme.brightness == Brightness.dark;
final double textScaleFactor = MediaQuery.of(context)?.textScaleFactor ?? 1.0; final double textScaleFactor = MediaQuery.of(context)?.textScaleFactor ?? 1.0;
final List<Widget> titleChildren = <Widget>[
new Text(
demo.title,
style: theme.textTheme.subhead.copyWith(
color: isDark ? Colors.white : const Color(0xFF202124),
),
),
];
if (demo.subtitle != null) {
titleChildren.add(
new Text(
demo.subtitle,
style: theme.textTheme.body1.copyWith(
color: isDark ? Colors.white : const Color(0xFF60646B)
),
),
);
}
return new RawMaterialButton( return new RawMaterialButton(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
splashColor: theme.primaryColor.withOpacity(0.12), splashColor: theme.primaryColor.withOpacity(0.12),
...@@ -201,19 +220,7 @@ class _DemoItem extends StatelessWidget { ...@@ -201,19 +220,7 @@ class _DemoItem extends StatelessWidget {
child: new Column( child: new Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[ children: titleChildren,
new Text(
demo.title,
style: theme.textTheme.subhead.copyWith(
color: isDark ? Colors.white : const Color(0xFF202124),
),
),
new Text(
demo.subtitle,
style: theme.textTheme.body1.copyWith(
color: isDark ? Colors.white : const Color(0xFF60646B)),
),
],
), ),
), ),
const SizedBox(width: 44.0), const SizedBox(width: 44.0),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment