@@ -2,7 +2,6 @@ import "package:flutter/material.dart";
22import "package:go_router/go_router.dart" ;
33import "package:provider/provider.dart" ;
44import "../../exports.dart" ;
5- import "package:flutter_gen/gen_l10n/app_localizations.dart" ;
65import '../menu_view/phone_menu_layout.dart' ;
76import '../menu_view/tablet_menu_layout.dart' ;
87
@@ -23,23 +22,15 @@ class _MyMenuViewState extends State<MyMenuView> {
2322
2423 @override
2524 Widget build (BuildContext context) {
26- final provider = Provider .of <ThemeProvider >(context, listen: false );
27- final scheme = Theme .of (context).colorScheme;
28- final width = MediaQuery .of (context).size.width;
29- final height = MediaQuery .of (context).size.height;
30- final aspectRatio = MediaQuery .of (context).size.aspectRatio;
31- final l10n = AppLocalizations .of (context)! ;
32-
3325 return Scaffold (
34- backgroundColor: scheme .background,
26+ backgroundColor: Theme . of (context).colorScheme .background,
3527 body: Consumer <GameModel >(
3628 builder: (context, gameModel, child) {
3729 return SafeArea (
3830 child: LayoutBuilder (
3931 builder: (context, constraints) {
4032 final isTablet = constraints.maxWidth >= 640 ;
4133 final size = Size (constraints.maxWidth, constraints.maxHeight);
42-
4334 final menuView = isTablet
4435 ? TabletMenuView (
4536 gameModel: gameModel,
@@ -49,64 +40,7 @@ class _MyMenuViewState extends State<MyMenuView> {
4940 gameModel: gameModel,
5041 size: size,
5142 );
52-
53- return Column (
54- children: [
55- Expanded (child: menuView),
56- SizedBox (height: height * 0.04 ),
57- Padding (
58- padding: aspectRatio < 0.65
59- ? EdgeInsets .zero
60- : const EdgeInsets .only (left: 15 ),
61- child: ConstrainedBox (
62- constraints: BoxConstraints (maxHeight: height * 0.2 ),
63- child: FittedBox (
64- child: Text (
65- aspectRatio < 0.65 ? l10n.slogan : l10n.sloganWide,
66- style: TextStyles .title1.copyWith (
67- color: scheme.primary,
68- ),
69- ),
70- ),
71- ),
72- ),
73- Expanded (
74- child: Padding (
75- padding: aspectRatio < 0.65
76- ? EdgeInsets .zero
77- : EdgeInsets .only (
78- top: height * 0.1 ,
79- left: width * 0.15 ,
80- right: width * 0.05 ,
81- bottom: height * 0.03 ),
82- child: SvgPicture .asset (
83- alignment: Alignment .bottomRight,
84- width: double .infinity,
85- "${MenuPageStringConst .pathToIcon }pieces.svg" ,
86- ),
87- ),
88- ),
89- Align (
90- alignment: Alignment .bottomCenter,
91- child: Padding (
92- padding: const EdgeInsets .only (bottom: 20 ),
93- child: ConstrainedBox (
94- constraints: BoxConstraints (maxHeight: height * 0.08 ),
95- child: NextPageButton (
96- text: l10n.startGameButton,
97- textColor: ColorsConst .primaryColor0,
98- buttonColor: scheme.secondaryContainer,
99- isClickable: true ,
100- onTap: () {
101- context.go (RouteLocations .settingsScreen,
102- extra: gameModel);
103- },
104- ),
105- ),
106- ),
107- ),
108- ],
109- );
43+ return menuView;
11044 },
11145 ),
11246 );
0 commit comments