1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00

[material_3_demo] Use switch expressions (#2193)

This commit is contained in:
Kevin Moore
2024-03-06 11:44:05 -08:00
committed by GitHub
parent e5f3bacaf8
commit 5b6d214d2a
3 changed files with 29 additions and 40 deletions

View File

@@ -108,29 +108,26 @@ class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
}
Widget createScreenFor(
ScreenSelected screenSelected, bool showNavBarExample) {
switch (screenSelected) {
case ScreenSelected.component:
return Expanded(
child: OneTwoTransition(
animation: railAnimation,
one: FirstComponentList(
showNavBottomBar: showNavBarExample,
ScreenSelected screenSelected,
bool showNavBarExample,
) =>
switch (screenSelected) {
ScreenSelected.component => Expanded(
child: OneTwoTransition(
animation: railAnimation,
one: FirstComponentList(
showNavBottomBar: showNavBarExample,
scaffoldKey: scaffoldKey,
showSecondList: showMediumSizeLayout || showLargeSizeLayout),
two: SecondComponentList(
scaffoldKey: scaffoldKey,
showSecondList: showMediumSizeLayout || showLargeSizeLayout),
two: SecondComponentList(
scaffoldKey: scaffoldKey,
),
),
),
);
case ScreenSelected.color:
return const ColorPalettesScreen();
case ScreenSelected.typography:
return const TypographyScreen();
case ScreenSelected.elevation:
return const ElevationScreen();
}
}
ScreenSelected.color => const ColorPalettesScreen(),
ScreenSelected.typography => const TypographyScreen(),
ScreenSelected.elevation => const ElevationScreen()
};
PreferredSizeWidget createAppBar() {
return AppBar(