[Gallery] Refactor list of demos to use common variables (#224)

pull/226/head
rami-a 5 years ago committed by GitHub
parent 00306723ba
commit 555ec07de3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -38,6 +38,8 @@ import 'package:gallery/demos/reference/typography_demo.dart';
import 'package:gallery/l10n/gallery_localizations.dart'; import 'package:gallery/l10n/gallery_localizations.dart';
import 'package:gallery/themes/material_demo_theme_data.dart'; import 'package:gallery/themes/material_demo_theme_data.dart';
const _docsBaseUrl = 'https://api.flutter.dev/flutter';
class GalleryDemo { class GalleryDemo {
GalleryDemo({ GalleryDemo({
@required this.title, @required this.title,
@ -71,46 +73,41 @@ class GalleryDemoConfiguration {
} }
List<GalleryDemo> materialDemos(BuildContext context) { List<GalleryDemo> materialDemos(BuildContext context) {
final localizations = GalleryLocalizations.of(context);
return [ return [
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoBottomAppBarTitle, title: localizations.demoBottomAppBarTitle,
icon: GalleryIcons.bottomAppBar, icon: GalleryIcons.bottomAppBar,
subtitle: GalleryLocalizations.of(context).demoBottomAppBarSubtitle, subtitle: localizations.demoBottomAppBarSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoBottomAppBarTitle, title: localizations.demoBottomAppBarTitle,
description: description: localizations.demoBottomAppBarDescription,
GalleryLocalizations.of(context).demoBottomAppBarDescription, documentationUrl: '$_docsBaseUrl/material/BottomAppBar-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/material/BottomAppBar-class.html',
buildRoute: (_) => BottomAppBarDemo(), buildRoute: (_) => BottomAppBarDemo(),
code: CodeSegments.bottomAppBarDemo, code: CodeSegments.bottomAppBarDemo,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoBottomNavigationTitle, title: localizations.demoBottomNavigationTitle,
icon: GalleryIcons.bottomNavigation, icon: GalleryIcons.bottomNavigation,
subtitle: GalleryLocalizations.of(context).demoBottomNavigationSubtitle, subtitle: localizations.demoBottomNavigationSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context) title: localizations.demoBottomNavigationPersistentLabels,
.demoBottomNavigationPersistentLabels, description: localizations.demoBottomNavigationDescription,
description:
GalleryLocalizations.of(context).demoBottomNavigationDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/material/BottomNavigationBar-class.html', '$_docsBaseUrl/material/BottomNavigationBar-class.html',
buildRoute: (_) => buildRoute: (_) =>
BottomNavigationDemo(type: BottomNavigationDemoType.withLabels), BottomNavigationDemo(type: BottomNavigationDemoType.withLabels),
code: CodeSegments.bottomNavigationDemo, code: CodeSegments.bottomNavigationDemo,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context) title: localizations.demoBottomNavigationSelectedLabel,
.demoBottomNavigationSelectedLabel, description: localizations.demoBottomNavigationDescription,
description:
GalleryLocalizations.of(context).demoBottomNavigationDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/material/BottomNavigationBar-class.html', '$_docsBaseUrl/material/BottomNavigationBar-class.html',
buildRoute: (_) => BottomNavigationDemo( buildRoute: (_) => BottomNavigationDemo(
type: BottomNavigationDemoType.withoutLabels), type: BottomNavigationDemoType.withoutLabels),
code: CodeSegments.bottomNavigationDemo, code: CodeSegments.bottomNavigationDemo,
@ -118,77 +115,67 @@ List<GalleryDemo> materialDemos(BuildContext context) {
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoBottomSheetTitle, title: localizations.demoBottomSheetTitle,
icon: GalleryIcons.bottomSheets, icon: GalleryIcons.bottomSheets,
subtitle: GalleryLocalizations.of(context).demoBottomSheetSubtitle, subtitle: localizations.demoBottomSheetSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: title: localizations.demoBottomSheetPersistentTitle,
GalleryLocalizations.of(context).demoBottomSheetPersistentTitle, description: localizations.demoBottomSheetPersistentDescription,
description: GalleryLocalizations.of(context) documentationUrl: '$_docsBaseUrl/material/BottomSheet-class.html',
.demoBottomSheetPersistentDescription,
documentationUrl:
'https://api.flutter.dev/flutter/material/BottomSheet-class.html',
buildRoute: (_) => buildRoute: (_) =>
BottomSheetDemo(type: BottomSheetDemoType.persistent), BottomSheetDemo(type: BottomSheetDemoType.persistent),
code: CodeSegments.bottomSheetDemoPersistent, code: CodeSegments.bottomSheetDemoPersistent,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoBottomSheetModalTitle, title: localizations.demoBottomSheetModalTitle,
description: description: localizations.demoBottomSheetModalDescription,
GalleryLocalizations.of(context).demoBottomSheetModalDescription, documentationUrl: '$_docsBaseUrl/material/BottomSheet-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/material/BottomSheet-class.html',
buildRoute: (_) => BottomSheetDemo(type: BottomSheetDemoType.modal), buildRoute: (_) => BottomSheetDemo(type: BottomSheetDemoType.modal),
code: CodeSegments.bottomSheetDemoModal, code: CodeSegments.bottomSheetDemoModal,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoButtonTitle, title: localizations.demoButtonTitle,
icon: GalleryIcons.genericButtons, icon: GalleryIcons.genericButtons,
subtitle: GalleryLocalizations.of(context).demoButtonSubtitle, subtitle: localizations.demoButtonSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoFlatButtonTitle, title: localizations.demoFlatButtonTitle,
description: description: localizations.demoFlatButtonDescription,
GalleryLocalizations.of(context).demoFlatButtonDescription,
documentationUrl: documentationUrl:
'https://docs.flutter.io/flutter/material/FlatButton-class.html', 'https://docs.flutter.io/flutter/material/FlatButton-class.html',
buildRoute: (_) => ButtonDemo(type: ButtonDemoType.flat), buildRoute: (_) => ButtonDemo(type: ButtonDemoType.flat),
code: CodeSegments.buttonDemoFlat, code: CodeSegments.buttonDemoFlat,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoRaisedButtonTitle, title: localizations.demoRaisedButtonTitle,
description: description: localizations.demoRaisedButtonDescription,
GalleryLocalizations.of(context).demoRaisedButtonDescription,
documentationUrl: documentationUrl:
'https://docs.flutter.io/flutter/material/RaisedButton-class.html', 'https://docs.flutter.io/flutter/material/RaisedButton-class.html',
buildRoute: (_) => ButtonDemo(type: ButtonDemoType.raised), buildRoute: (_) => ButtonDemo(type: ButtonDemoType.raised),
code: CodeSegments.buttonDemoRaised, code: CodeSegments.buttonDemoRaised,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoOutlineButtonTitle, title: localizations.demoOutlineButtonTitle,
description: description: localizations.demoOutlineButtonDescription,
GalleryLocalizations.of(context).demoOutlineButtonDescription,
documentationUrl: documentationUrl:
'https://docs.flutter.io/flutter/material/OutlineButton-class.html', 'https://docs.flutter.io/flutter/material/OutlineButton-class.html',
buildRoute: (_) => ButtonDemo(type: ButtonDemoType.outline), buildRoute: (_) => ButtonDemo(type: ButtonDemoType.outline),
code: CodeSegments.buttonDemoOutline, code: CodeSegments.buttonDemoOutline,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoToggleButtonTitle, title: localizations.demoToggleButtonTitle,
description: description: localizations.demoToggleButtonDescription,
GalleryLocalizations.of(context).demoToggleButtonDescription,
documentationUrl: documentationUrl:
'https://docs.flutter.io/flutter/material/ToggleButtons-class.html', 'https://docs.flutter.io/flutter/material/ToggleButtons-class.html',
buildRoute: (_) => ButtonDemo(type: ButtonDemoType.toggle), buildRoute: (_) => ButtonDemo(type: ButtonDemoType.toggle),
code: CodeSegments.buttonDemoToggle, code: CodeSegments.buttonDemoToggle,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoFloatingButtonTitle, title: localizations.demoFloatingButtonTitle,
description: description: localizations.demoFloatingButtonDescription,
GalleryLocalizations.of(context).demoFloatingButtonDescription,
documentationUrl: documentationUrl:
'https://docs.flutter.io/flutter/material/FloatingActionButton-class.html', 'https://docs.flutter.io/flutter/material/FloatingActionButton-class.html',
buildRoute: (_) => ButtonDemo(type: ButtonDemoType.floating), buildRoute: (_) => ButtonDemo(type: ButtonDemoType.floating),
@ -197,189 +184,163 @@ List<GalleryDemo> materialDemos(BuildContext context) {
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoChipTitle, title: localizations.demoChipTitle,
icon: GalleryIcons.chips, icon: GalleryIcons.chips,
subtitle: GalleryLocalizations.of(context).demoChipSubtitle, subtitle: localizations.demoChipSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoActionChipTitle, title: localizations.demoActionChipTitle,
description: description: localizations.demoActionChipDescription,
GalleryLocalizations.of(context).demoActionChipDescription, documentationUrl: '$_docsBaseUrl/material/ActionChip-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/material/ActionChip-class.html',
buildRoute: (_) => ChipDemo(type: ChipDemoType.action), buildRoute: (_) => ChipDemo(type: ChipDemoType.action),
code: CodeSegments.chipDemoAction, code: CodeSegments.chipDemoAction,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoChoiceChipTitle, title: localizations.demoChoiceChipTitle,
description: description: localizations.demoChoiceChipDescription,
GalleryLocalizations.of(context).demoChoiceChipDescription, documentationUrl: '$_docsBaseUrl/material/ChoiceChip-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/material/ChoiceChip-class.html',
buildRoute: (_) => ChipDemo(type: ChipDemoType.choice), buildRoute: (_) => ChipDemo(type: ChipDemoType.choice),
code: CodeSegments.chipDemoChoice, code: CodeSegments.chipDemoChoice,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoFilterChipTitle, title: localizations.demoFilterChipTitle,
description: description: localizations.demoFilterChipDescription,
GalleryLocalizations.of(context).demoFilterChipDescription, documentationUrl: '$_docsBaseUrl/material/FilterChip-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/material/FilterChip-class.html',
buildRoute: (_) => ChipDemo(type: ChipDemoType.filter), buildRoute: (_) => ChipDemo(type: ChipDemoType.filter),
code: CodeSegments.chipDemoFilter, code: CodeSegments.chipDemoFilter,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoInputChipTitle, title: localizations.demoInputChipTitle,
description: description: localizations.demoInputChipDescription,
GalleryLocalizations.of(context).demoInputChipDescription, documentationUrl: '$_docsBaseUrl/material/InputChip-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/material/InputChip-class.html',
buildRoute: (_) => ChipDemo(type: ChipDemoType.input), buildRoute: (_) => ChipDemo(type: ChipDemoType.input),
code: CodeSegments.chipDemoInput, code: CodeSegments.chipDemoInput,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoDialogTitle, title: localizations.demoDialogTitle,
icon: GalleryIcons.dialogs, icon: GalleryIcons.dialogs,
subtitle: GalleryLocalizations.of(context).demoDialogSubtitle, subtitle: localizations.demoDialogSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoAlertDialogTitle, title: localizations.demoAlertDialogTitle,
description: description: localizations.demoAlertDialogDescription,
GalleryLocalizations.of(context).demoAlertDialogDescription, documentationUrl: '$_docsBaseUrl/material/AlertDialog-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/material/AlertDialog-class.html',
buildRoute: (_) => DialogDemo(type: DialogDemoType.alert), buildRoute: (_) => DialogDemo(type: DialogDemoType.alert),
code: CodeSegments.dialogDemo, code: CodeSegments.dialogDemo,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoAlertTitleDialogTitle, title: localizations.demoAlertTitleDialogTitle,
description: description: localizations.demoAlertDialogDescription,
GalleryLocalizations.of(context).demoAlertDialogDescription, documentationUrl: '$_docsBaseUrl/material/AlertDialog-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/material/AlertDialog-class.html',
buildRoute: (_) => DialogDemo(type: DialogDemoType.alertTitle), buildRoute: (_) => DialogDemo(type: DialogDemoType.alertTitle),
code: CodeSegments.dialogDemo, code: CodeSegments.dialogDemo,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoSimpleDialogTitle, title: localizations.demoSimpleDialogTitle,
description: description: localizations.demoSimpleDialogDescription,
GalleryLocalizations.of(context).demoSimpleDialogDescription, documentationUrl: '$_docsBaseUrl/material/SimpleDialog-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/material/SimpleDialog-class.html',
buildRoute: (_) => DialogDemo(type: DialogDemoType.simple), buildRoute: (_) => DialogDemo(type: DialogDemoType.simple),
code: CodeSegments.dialogDemo, code: CodeSegments.dialogDemo,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoFullscreenDialogTitle, title: localizations.demoFullscreenDialogTitle,
description: description: localizations.demoFullscreenDialogDescription,
GalleryLocalizations.of(context).demoFullscreenDialogDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/widgets/PageRoute/fullscreenDialog.html', '$_docsBaseUrl/widgets/PageRoute/fullscreenDialog.html',
buildRoute: (_) => DialogDemo(type: DialogDemoType.fullscreen), buildRoute: (_) => DialogDemo(type: DialogDemoType.fullscreen),
code: CodeSegments.dialogDemo, code: CodeSegments.dialogDemo,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoGridListsTitle, title: localizations.demoGridListsTitle,
icon: GalleryIcons.gridOn, icon: GalleryIcons.gridOn,
subtitle: GalleryLocalizations.of(context).demoGridListsSubtitle, subtitle: localizations.demoGridListsSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoGridListsImageOnlyTitle, title: localizations.demoGridListsImageOnlyTitle,
description: description: localizations.demoGridListsDescription,
GalleryLocalizations.of(context).demoGridListsDescription, documentationUrl: '$_docsBaseUrl/widgets/GridView-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/widgets/GridView-class.html',
buildRoute: (context) => buildRoute: (context) =>
GridListDemo(type: GridListDemoType.imageOnly), GridListDemo(type: GridListDemoType.imageOnly),
code: CodeSegments.gridListsDemo, code: CodeSegments.gridListsDemo,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoGridListsHeaderTitle, title: localizations.demoGridListsHeaderTitle,
description: description: localizations.demoGridListsDescription,
GalleryLocalizations.of(context).demoGridListsDescription, documentationUrl: '$_docsBaseUrl/widgets/GridView-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/widgets/GridView-class.html',
buildRoute: (context) => GridListDemo(type: GridListDemoType.header), buildRoute: (context) => GridListDemo(type: GridListDemoType.header),
code: CodeSegments.gridListsDemo, code: CodeSegments.gridListsDemo,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoGridListsFooterTitle, title: localizations.demoGridListsFooterTitle,
description: description: localizations.demoGridListsDescription,
GalleryLocalizations.of(context).demoGridListsDescription, documentationUrl: '$_docsBaseUrl/widgets/GridView-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/widgets/GridView-class.html',
buildRoute: (context) => GridListDemo(type: GridListDemoType.footer), buildRoute: (context) => GridListDemo(type: GridListDemoType.footer),
code: CodeSegments.gridListsDemo, code: CodeSegments.gridListsDemo,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoListsTitle, title: localizations.demoListsTitle,
icon: GalleryIcons.listAlt, icon: GalleryIcons.listAlt,
subtitle: GalleryLocalizations.of(context).demoListsSubtitle, subtitle: localizations.demoListsSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoOneLineListsTitle, title: localizations.demoOneLineListsTitle,
description: GalleryLocalizations.of(context).demoListsDescription, description: localizations.demoListsDescription,
documentationUrl: documentationUrl: '$_docsBaseUrl/material/ListTile-class.html',
'https://api.flutter.dev/flutter/material/ListTile-class.html',
buildRoute: (context) => ListDemo(type: ListDemoType.oneLine), buildRoute: (context) => ListDemo(type: ListDemoType.oneLine),
code: CodeSegments.listDemo, code: CodeSegments.listDemo,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoTwoLineListsTitle, title: localizations.demoTwoLineListsTitle,
description: GalleryLocalizations.of(context).demoListsDescription, description: localizations.demoListsDescription,
documentationUrl: documentationUrl: '$_docsBaseUrl/material/ListTile-class.html',
'https://api.flutter.dev/flutter/material/ListTile-class.html',
buildRoute: (context) => ListDemo(type: ListDemoType.twoLine), buildRoute: (context) => ListDemo(type: ListDemoType.twoLine),
code: CodeSegments.listDemo, code: CodeSegments.listDemo,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoMenuTitle, title: localizations.demoMenuTitle,
icon: GalleryIcons.moreVert, icon: GalleryIcons.moreVert,
subtitle: GalleryLocalizations.of(context).demoMenuSubtitle, subtitle: localizations.demoMenuSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoContextMenuTitle, title: localizations.demoContextMenuTitle,
description: GalleryLocalizations.of(context).demoMenuDescription, description: localizations.demoMenuDescription,
documentationUrl: documentationUrl: '$_docsBaseUrl/material/PopupMenuItem-class.html',
'https://api.flutter.dev/flutter/material/PopupMenuItem-class.html',
buildRoute: (context) => MenuDemo( buildRoute: (context) => MenuDemo(
type: MenuDemoType.contextMenu, type: MenuDemoType.contextMenu,
), ),
code: CodeSegments.menuDemoContext, code: CodeSegments.menuDemoContext,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoSectionedMenuTitle, title: localizations.demoSectionedMenuTitle,
description: GalleryLocalizations.of(context).demoMenuDescription, description: localizations.demoMenuDescription,
documentationUrl: documentationUrl: '$_docsBaseUrl/material/PopupMenuItem-class.html',
'https://api.flutter.dev/flutter/material/PopupMenuItem-class.html',
buildRoute: (context) => MenuDemo( buildRoute: (context) => MenuDemo(
type: MenuDemoType.sectionedMenu, type: MenuDemoType.sectionedMenu,
), ),
code: CodeSegments.menuDemoSectioned, code: CodeSegments.menuDemoSectioned,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoChecklistMenuTitle, title: localizations.demoChecklistMenuTitle,
description: GalleryLocalizations.of(context).demoMenuDescription, description: localizations.demoMenuDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/material/CheckedPopupMenuItem-class.html', '$_docsBaseUrl/material/CheckedPopupMenuItem-class.html',
buildRoute: (context) => MenuDemo( buildRoute: (context) => MenuDemo(
type: MenuDemoType.checklistMenu, type: MenuDemoType.checklistMenu,
), ),
code: CodeSegments.menuDemoChecklist, code: CodeSegments.menuDemoChecklist,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoSimpleMenuTitle, title: localizations.demoSimpleMenuTitle,
description: GalleryLocalizations.of(context).demoMenuDescription, description: localizations.demoMenuDescription,
documentationUrl: documentationUrl: '$_docsBaseUrl/material/PopupMenuItem-class.html',
'https://api.flutter.dev/flutter/material/PopupMenuItem-class.html',
buildRoute: (context) => MenuDemo( buildRoute: (context) => MenuDemo(
type: MenuDemoType.simpleMenu, type: MenuDemoType.simpleMenu,
), ),
@ -388,29 +349,25 @@ List<GalleryDemo> materialDemos(BuildContext context) {
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoProgressIndicatorTitle, title: localizations.demoProgressIndicatorTitle,
icon: GalleryIcons.progressActivity, icon: GalleryIcons.progressActivity,
subtitle: GalleryLocalizations.of(context).demoProgressIndicatorSubtitle, subtitle: localizations.demoProgressIndicatorSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context) title: localizations.demoCircularProgressIndicatorTitle,
.demoCircularProgressIndicatorTitle, description: localizations.demoCircularProgressIndicatorDescription,
description: GalleryLocalizations.of(context)
.demoCircularProgressIndicatorDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/material/CircularProgressIndicator-class.html', '$_docsBaseUrl/material/CircularProgressIndicator-class.html',
buildRoute: (context) => ProgressIndicatorDemo( buildRoute: (context) => ProgressIndicatorDemo(
type: ProgressIndicatorDemoType.circular, type: ProgressIndicatorDemoType.circular,
), ),
code: CodeSegments.progressIndicatorsDemo, code: CodeSegments.progressIndicatorsDemo,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: title: localizations.demoLinearProgressIndicatorTitle,
GalleryLocalizations.of(context).demoLinearProgressIndicatorTitle, description: localizations.demoLinearProgressIndicatorDescription,
description: GalleryLocalizations.of(context)
.demoLinearProgressIndicatorDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/material/LinearProgressIndicator-class.html', '$_docsBaseUrl/material/LinearProgressIndicator-class.html',
buildRoute: (context) => ProgressIndicatorDemo( buildRoute: (context) => ProgressIndicatorDemo(
type: ProgressIndicatorDemoType.linear, type: ProgressIndicatorDemoType.linear,
), ),
@ -419,41 +376,32 @@ List<GalleryDemo> materialDemos(BuildContext context) {
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoSelectionControlsTitle, title: localizations.demoSelectionControlsTitle,
icon: GalleryIcons.checkBox, icon: GalleryIcons.checkBox,
subtitle: GalleryLocalizations.of(context).demoSelectionControlsSubtitle, subtitle: localizations.demoSelectionControlsSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context) title: localizations.demoSelectionControlsCheckboxTitle,
.demoSelectionControlsCheckboxTitle, description: localizations.demoSelectionControlsCheckboxDescription,
description: GalleryLocalizations.of(context) documentationUrl: '$_docsBaseUrl/material/Checkbox-class.html',
.demoSelectionControlsCheckboxDescription,
documentationUrl:
'https://api.flutter.dev/flutter/material/Checkbox-class.html',
buildRoute: (context) => SelectionControlsDemo( buildRoute: (context) => SelectionControlsDemo(
type: SelectionControlsDemoType.checkbox, type: SelectionControlsDemoType.checkbox,
), ),
code: CodeSegments.selectionControlsDemoCheckbox, code: CodeSegments.selectionControlsDemoCheckbox,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: title: localizations.demoSelectionControlsRadioTitle,
GalleryLocalizations.of(context).demoSelectionControlsRadioTitle, description: localizations.demoSelectionControlsRadioDescription,
description: GalleryLocalizations.of(context) documentationUrl: '$_docsBaseUrl/material/Radio-class.html',
.demoSelectionControlsRadioDescription,
documentationUrl:
'https://api.flutter.dev/flutter/material/Radio-class.html',
buildRoute: (context) => SelectionControlsDemo( buildRoute: (context) => SelectionControlsDemo(
type: SelectionControlsDemoType.radio, type: SelectionControlsDemoType.radio,
), ),
code: CodeSegments.selectionControlsDemoRadio, code: CodeSegments.selectionControlsDemoRadio,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: title: localizations.demoSelectionControlsSwitchTitle,
GalleryLocalizations.of(context).demoSelectionControlsSwitchTitle, description: localizations.demoSelectionControlsSwitchDescription,
description: GalleryLocalizations.of(context) documentationUrl: '$_docsBaseUrl/material/Switch-class.html',
.demoSelectionControlsSwitchDescription,
documentationUrl:
'https://api.flutter.dev/flutter/material/Switch-class.html',
buildRoute: (context) => SelectionControlsDemo( buildRoute: (context) => SelectionControlsDemo(
type: SelectionControlsDemoType.switches, type: SelectionControlsDemoType.switches,
), ),
@ -462,34 +410,29 @@ List<GalleryDemo> materialDemos(BuildContext context) {
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoSlidersTitle, title: localizations.demoSlidersTitle,
icon: GalleryIcons.sliders, icon: GalleryIcons.sliders,
subtitle: GalleryLocalizations.of(context).demoSlidersSubtitle, subtitle: localizations.demoSlidersSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoSlidersTitle, title: localizations.demoSlidersTitle,
description: GalleryLocalizations.of(context).demoSlidersDescription, description: localizations.demoSlidersDescription,
documentationUrl: documentationUrl: '$_docsBaseUrl/material/Slider-class.html',
'https://api.flutter.dev/flutter/material/Slider-class.html',
buildRoute: (context) => SlidersDemo(type: SlidersDemoType.sliders), buildRoute: (context) => SlidersDemo(type: SlidersDemoType.sliders),
code: CodeSegments.slidersDemo, code: CodeSegments.slidersDemo,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoRangeSlidersTitle, title: localizations.demoRangeSlidersTitle,
description: description: localizations.demoRangeSlidersDescription,
GalleryLocalizations.of(context).demoRangeSlidersDescription, documentationUrl: '$_docsBaseUrl/material/RangeSlider-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/material/RangeSlider-class.html',
buildRoute: (context) => buildRoute: (context) =>
SlidersDemo(type: SlidersDemoType.rangeSliders), SlidersDemo(type: SlidersDemoType.rangeSliders),
code: CodeSegments.rangeSlidersDemo, code: CodeSegments.rangeSlidersDemo,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoCustomSlidersTitle, title: localizations.demoCustomSlidersTitle,
description: description: localizations.demoCustomSlidersDescription,
GalleryLocalizations.of(context).demoCustomSlidersDescription, documentationUrl: '$_docsBaseUrl/material/SliderTheme-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/material/SliderTheme-class.html',
buildRoute: (context) => buildRoute: (context) =>
SlidersDemo(type: SlidersDemoType.customSliders), SlidersDemo(type: SlidersDemoType.customSliders),
code: CodeSegments.customSlidersDemo, code: CodeSegments.customSlidersDemo,
@ -497,62 +440,56 @@ List<GalleryDemo> materialDemos(BuildContext context) {
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoSnackbarsTitle, title: localizations.demoSnackbarsTitle,
icon: GalleryIcons.snackbar, icon: GalleryIcons.snackbar,
subtitle: GalleryLocalizations.of(context).demoSnackbarsSubtitle, subtitle: localizations.demoSnackbarsSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoSnackbarsTitle, title: localizations.demoSnackbarsTitle,
description: description: localizations.demoSnackbarsDescription,
GalleryLocalizations.of(context).demoSnackbarsDescription, documentationUrl: '$_docsBaseUrl/material/SnackBar-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/material/SnackBar-class.html',
buildRoute: (context) => SnackbarsDemo(), buildRoute: (context) => SnackbarsDemo(),
code: CodeSegments.snackbarsDemo, code: CodeSegments.snackbarsDemo,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoTabsTitle, title: localizations.demoTabsTitle,
icon: GalleryIcons.tabs, icon: GalleryIcons.tabs,
subtitle: GalleryLocalizations.of(context).demoTabsSubtitle, subtitle: localizations.demoTabsSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoTabsTitle, title: localizations.demoTabsTitle,
description: GalleryLocalizations.of(context).demoTabsDescription, description: localizations.demoTabsDescription,
documentationUrl: documentationUrl: '$_docsBaseUrl/material/TabBarView-class.html',
'https://api.flutter.dev/flutter/material/TabBarView-class.html',
buildRoute: (context) => TabsDemo(), buildRoute: (context) => TabsDemo(),
code: CodeSegments.tabsDemo, code: CodeSegments.tabsDemo,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoTextFieldTitle, title: localizations.demoTextFieldTitle,
icon: GalleryIcons.textFieldsAlt, icon: GalleryIcons.textFieldsAlt,
subtitle: GalleryLocalizations.of(context).demoTextFieldSubtitle, subtitle: localizations.demoTextFieldSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoTextFieldTitle, title: localizations.demoTextFieldTitle,
description: description: localizations.demoTextFieldDescription,
GalleryLocalizations.of(context).demoTextFieldDescription, documentationUrl: '$_docsBaseUrl/material/TextField-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/material/TextField-class.html',
buildRoute: (_) => TextFieldDemo(), buildRoute: (_) => TextFieldDemo(),
code: CodeSegments.textFieldDemo, code: CodeSegments.textFieldDemo,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoTooltipTitle, title: localizations.demoTooltipTitle,
icon: GalleryIcons.tooltip, icon: GalleryIcons.tooltip,
subtitle: GalleryLocalizations.of(context).demoTooltipSubtitle, subtitle: localizations.demoTooltipSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoTooltipTitle, title: localizations.demoTooltipTitle,
description: GalleryLocalizations.of(context).demoTooltipDescription, description: localizations.demoTooltipDescription,
documentationUrl: documentationUrl: '$_docsBaseUrl/material/Tooltip-class.html',
'https://api.flutter.dev/flutter/material/Tooltip-class.html',
buildRoute: (_) => TooltipDemo(), buildRoute: (_) => TooltipDemo(),
code: CodeSegments.tooltipDemo, code: CodeSegments.tooltipDemo,
), ),
@ -562,78 +499,67 @@ List<GalleryDemo> materialDemos(BuildContext context) {
} }
List<GalleryDemo> cupertinoDemos(BuildContext context) { List<GalleryDemo> cupertinoDemos(BuildContext context) {
final localizations = GalleryLocalizations.of(context);
return [ return [
GalleryDemo( GalleryDemo(
title: title: localizations.demoCupertinoActivityIndicatorTitle,
GalleryLocalizations.of(context).demoCupertinoActivityIndicatorTitle,
icon: GalleryIcons.cupertinoProgress, icon: GalleryIcons.cupertinoProgress,
subtitle: GalleryLocalizations.of(context) subtitle: localizations.demoCupertinoActivityIndicatorSubtitle,
.demoCupertinoActivityIndicatorSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context) title: localizations.demoCupertinoActivityIndicatorTitle,
.demoCupertinoActivityIndicatorTitle, description: localizations.demoCupertinoActivityIndicatorDescription,
description: GalleryLocalizations.of(context)
.demoCupertinoActivityIndicatorDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/cupertino/CupertinoActivityIndicator-class.html', '$_docsBaseUrl/cupertino/CupertinoActivityIndicator-class.html',
buildRoute: (_) => CupertinoProgressIndicatorDemo(), buildRoute: (_) => CupertinoProgressIndicatorDemo(),
code: CodeSegments.cupertinoActivityIndicatorDemo, code: CodeSegments.cupertinoActivityIndicatorDemo,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoCupertinoAlertsTitle, title: localizations.demoCupertinoAlertsTitle,
icon: GalleryIcons.dialogs, icon: GalleryIcons.dialogs,
subtitle: GalleryLocalizations.of(context).demoCupertinoAlertsSubtitle, subtitle: localizations.demoCupertinoAlertsSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoCupertinoAlertTitle, title: localizations.demoCupertinoAlertTitle,
description: description: localizations.demoCupertinoAlertDescription,
GalleryLocalizations.of(context).demoCupertinoAlertDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/cupertino/CupertinoAlertDialog-class.html', '$_docsBaseUrl/cupertino/CupertinoAlertDialog-class.html',
buildRoute: (_) => CupertinoAlertDemo(type: AlertDemoType.alert), buildRoute: (_) => CupertinoAlertDemo(type: AlertDemoType.alert),
code: CodeSegments.cupertinoAlertDemo, code: CodeSegments.cupertinoAlertDemo,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: title: localizations.demoCupertinoAlertWithTitleTitle,
GalleryLocalizations.of(context).demoCupertinoAlertWithTitleTitle, description: localizations.demoCupertinoAlertDescription,
description:
GalleryLocalizations.of(context).demoCupertinoAlertDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/cupertino/CupertinoAlertDialog-class.html', '$_docsBaseUrl/cupertino/CupertinoAlertDialog-class.html',
buildRoute: (_) => CupertinoAlertDemo(type: AlertDemoType.alertTitle), buildRoute: (_) => CupertinoAlertDemo(type: AlertDemoType.alertTitle),
code: CodeSegments.cupertinoAlertDemo, code: CodeSegments.cupertinoAlertDemo,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: title: localizations.demoCupertinoAlertButtonsTitle,
GalleryLocalizations.of(context).demoCupertinoAlertButtonsTitle, description: localizations.demoCupertinoAlertDescription,
description:
GalleryLocalizations.of(context).demoCupertinoAlertDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/cupertino/CupertinoAlertDialog-class.html', '$_docsBaseUrl/cupertino/CupertinoAlertDialog-class.html',
buildRoute: (_) => buildRoute: (_) =>
CupertinoAlertDemo(type: AlertDemoType.alertButtons), CupertinoAlertDemo(type: AlertDemoType.alertButtons),
code: CodeSegments.cupertinoAlertDemo, code: CodeSegments.cupertinoAlertDemo,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context) title: localizations.demoCupertinoAlertButtonsOnlyTitle,
.demoCupertinoAlertButtonsOnlyTitle, description: localizations.demoCupertinoAlertDescription,
description:
GalleryLocalizations.of(context).demoCupertinoAlertDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/cupertino/CupertinoAlertDialog-class.html', '$_docsBaseUrl/cupertino/CupertinoAlertDialog-class.html',
buildRoute: (_) => buildRoute: (_) =>
CupertinoAlertDemo(type: AlertDemoType.alertButtonsOnly), CupertinoAlertDemo(type: AlertDemoType.alertButtonsOnly),
code: CodeSegments.cupertinoAlertDemo, code: CodeSegments.cupertinoAlertDemo,
), ),
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoCupertinoActionSheetTitle, title: localizations.demoCupertinoActionSheetTitle,
description: GalleryLocalizations.of(context) description: localizations.demoCupertinoActionSheetDescription,
.demoCupertinoActionSheetDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/cupertino/CupertinoActionSheet-class.html', '$_docsBaseUrl/cupertino/CupertinoActionSheet-class.html',
buildRoute: (_) => buildRoute: (_) =>
CupertinoAlertDemo(type: AlertDemoType.actionSheet), CupertinoAlertDemo(type: AlertDemoType.actionSheet),
code: CodeSegments.cupertinoAlertDemo, code: CodeSegments.cupertinoAlertDemo,
@ -641,120 +567,105 @@ List<GalleryDemo> cupertinoDemos(BuildContext context) {
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoCupertinoButtonsTitle, title: localizations.demoCupertinoButtonsTitle,
icon: GalleryIcons.genericButtons, icon: GalleryIcons.genericButtons,
subtitle: GalleryLocalizations.of(context).demoCupertinoButtonsSubtitle, subtitle: localizations.demoCupertinoButtonsSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoCupertinoButtonsTitle, title: localizations.demoCupertinoButtonsTitle,
description: description: localizations.demoCupertinoButtonsDescription,
GalleryLocalizations.of(context).demoCupertinoButtonsDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/cupertino/CupertinoButton-class.html', '$_docsBaseUrl/cupertino/CupertinoButton-class.html',
buildRoute: (_) => CupertinoButtonDemo(), buildRoute: (_) => CupertinoButtonDemo(),
code: CodeSegments.cupertinoButtonDemo, code: CodeSegments.cupertinoButtonDemo,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoCupertinoNavigationBarTitle, title: localizations.demoCupertinoNavigationBarTitle,
icon: GalleryIcons.bottomSheetPersistent, icon: GalleryIcons.bottomSheetPersistent,
subtitle: subtitle: localizations.demoCupertinoNavigationBarSubtitle,
GalleryLocalizations.of(context).demoCupertinoNavigationBarSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: title: localizations.demoCupertinoNavigationBarTitle,
GalleryLocalizations.of(context).demoCupertinoNavigationBarTitle, description: localizations.demoCupertinoNavigationBarDescription,
description: GalleryLocalizations.of(context)
.demoCupertinoNavigationBarDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/cupertino/CupertinoNavigationBar-class.html', '$_docsBaseUrl/cupertino/CupertinoNavigationBar-class.html',
buildRoute: (_) => CupertinoNavigationBarDemo(), buildRoute: (_) => CupertinoNavigationBarDemo(),
code: CodeSegments.cupertinoNavigationBarDemo, code: CodeSegments.cupertinoNavigationBarDemo,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoCupertinoPullToRefreshTitle, title: localizations.demoCupertinoPullToRefreshTitle,
icon: GalleryIcons.cupertinoPullToRefresh, icon: GalleryIcons.cupertinoPullToRefresh,
subtitle: subtitle: localizations.demoCupertinoPullToRefreshSubtitle,
GalleryLocalizations.of(context).demoCupertinoPullToRefreshSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: title: localizations.demoCupertinoPullToRefreshTitle,
GalleryLocalizations.of(context).demoCupertinoPullToRefreshTitle, description: localizations.demoCupertinoPullToRefreshDescription,
description: GalleryLocalizations.of(context)
.demoCupertinoPullToRefreshDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/cupertino/CupertinoSliverRefreshControl-class.html', '$_docsBaseUrl/cupertino/CupertinoSliverRefreshControl-class.html',
buildRoute: (_) => CupertinoRefreshControlDemo(), buildRoute: (_) => CupertinoRefreshControlDemo(),
code: CodeSegments.cupertinoRefreshDemo, code: CodeSegments.cupertinoRefreshDemo,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: title: localizations.demoCupertinoSegmentedControlTitle,
GalleryLocalizations.of(context).demoCupertinoSegmentedControlTitle,
icon: GalleryIcons.tabs, icon: GalleryIcons.tabs,
subtitle: GalleryLocalizations.of(context) subtitle: localizations.demoCupertinoSegmentedControlSubtitle,
.demoCupertinoSegmentedControlSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context) title: localizations.demoCupertinoSegmentedControlTitle,
.demoCupertinoSegmentedControlTitle, description: localizations.demoCupertinoSegmentedControlDescription,
description: GalleryLocalizations.of(context)
.demoCupertinoSegmentedControlDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/cupertino/CupertinoSegmentedControl-class.html', '$_docsBaseUrl/cupertino/CupertinoSegmentedControl-class.html',
buildRoute: (_) => CupertinoSegmentedControlDemo(), buildRoute: (_) => CupertinoSegmentedControlDemo(),
code: CodeSegments.cupertinoSegmentedControlDemo, code: CodeSegments.cupertinoSegmentedControlDemo,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoCupertinoSliderTitle, title: localizations.demoCupertinoSliderTitle,
icon: GalleryIcons.sliders, icon: GalleryIcons.sliders,
subtitle: GalleryLocalizations.of(context).demoCupertinoSliderSubtitle, subtitle: localizations.demoCupertinoSliderSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoCupertinoSliderTitle, title: localizations.demoCupertinoSliderTitle,
description: description: localizations.demoCupertinoSliderDescription,
GalleryLocalizations.of(context).demoCupertinoSliderDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/cupertino/CupertinoSlider-class.html', '$_docsBaseUrl/cupertino/CupertinoSlider-class.html',
buildRoute: (_) => CupertinoSliderDemo(), buildRoute: (_) => CupertinoSliderDemo(),
code: CodeSegments.cupertinoSliderDemo, code: CodeSegments.cupertinoSliderDemo,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoSelectionControlsSwitchTitle, title: localizations.demoSelectionControlsSwitchTitle,
icon: GalleryIcons.cupertinoSwitch, icon: GalleryIcons.cupertinoSwitch,
subtitle: GalleryLocalizations.of(context).demoCupertinoSwitchSubtitle, subtitle: localizations.demoCupertinoSwitchSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: title: localizations.demoSelectionControlsSwitchTitle,
GalleryLocalizations.of(context).demoSelectionControlsSwitchTitle, description: localizations.demoCupertinoSwitchDescription,
description:
GalleryLocalizations.of(context).demoCupertinoSwitchDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/cupertino/CupertinoSwitch-class.html', '$_docsBaseUrl/cupertino/CupertinoSwitch-class.html',
buildRoute: (_) => CupertinoSwitchDemo(), buildRoute: (_) => CupertinoSwitchDemo(),
code: CodeSegments.cupertinoSwitchDemo, code: CodeSegments.cupertinoSwitchDemo,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoCupertinoTabBarTitle, title: localizations.demoCupertinoTabBarTitle,
icon: GalleryIcons.bottomNavigation, icon: GalleryIcons.bottomNavigation,
subtitle: GalleryLocalizations.of(context).demoCupertinoTabBarSubtitle, subtitle: localizations.demoCupertinoTabBarSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoCupertinoTabBarTitle, title: localizations.demoCupertinoTabBarTitle,
description: description: localizations.demoCupertinoTabBarDescription,
GalleryLocalizations.of(context).demoCupertinoTabBarDescription,
documentationUrl: documentationUrl:
'https://api.flutter.dev/flutter/cupertino/CupertinoTabBar-class.html', '$_docsBaseUrl/cupertino/CupertinoTabBar-class.html',
buildRoute: (_) => CupertinoTabBarDemo(), buildRoute: (_) => CupertinoTabBarDemo(),
code: CodeSegments.cupertinoNavigationDemo, code: CodeSegments.cupertinoNavigationDemo,
), ),
@ -764,33 +675,31 @@ List<GalleryDemo> cupertinoDemos(BuildContext context) {
} }
List<GalleryDemo> referenceDemos(BuildContext context) { List<GalleryDemo> referenceDemos(BuildContext context) {
final localizations = GalleryLocalizations.of(context);
return [ return [
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoColorsTitle, title: localizations.demoColorsTitle,
icon: GalleryIcons.colors, icon: GalleryIcons.colors,
subtitle: GalleryLocalizations.of(context).demoColorsSubtitle, subtitle: localizations.demoColorsSubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoColorsTitle, title: localizations.demoColorsTitle,
description: GalleryLocalizations.of(context).demoColorsDescription, description: localizations.demoColorsDescription,
documentationUrl: documentationUrl: '$_docsBaseUrl/material/MaterialColor-class.html',
'https://api.flutter.dev/flutter/material/MaterialColor-class.html',
buildRoute: (_) => ColorsDemo(), buildRoute: (_) => ColorsDemo(),
code: CodeSegments.colorsDemo, code: CodeSegments.colorsDemo,
), ),
], ],
), ),
GalleryDemo( GalleryDemo(
title: GalleryLocalizations.of(context).demoTypographyTitle, title: localizations.demoTypographyTitle,
icon: GalleryIcons.customTypography, icon: GalleryIcons.customTypography,
subtitle: GalleryLocalizations.of(context).demoTypographySubtitle, subtitle: localizations.demoTypographySubtitle,
configurations: [ configurations: [
GalleryDemoConfiguration( GalleryDemoConfiguration(
title: GalleryLocalizations.of(context).demoTypographyTitle, title: localizations.demoTypographyTitle,
description: description: localizations.demoTypographyDescription,
GalleryLocalizations.of(context).demoTypographyDescription, documentationUrl: '$_docsBaseUrl/material/TextTheme-class.html',
documentationUrl:
'https://api.flutter.dev/flutter/material/TextTheme-class.html',
buildRoute: (_) => TypographyDemo(), buildRoute: (_) => TypographyDemo(),
code: CodeSegments.typographyDemo, code: CodeSegments.typographyDemo,
), ),

Loading…
Cancel
Save