Migrate game_template to Material 3 (#1613)

pull/1617/head
Miguel Beltran 2 years ago committed by GitHub
parent f088262e2e
commit 6bea60b091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -255,6 +255,7 @@ class MyApp extends StatelessWidget {
color: palette.ink, color: palette.ink,
), ),
), ),
useMaterial3: true,
), ),
routeInformationProvider: _router.routeInformationProvider, routeInformationProvider: _router.routeInformationProvider,
routeInformationParser: _router.routeInformationParser, routeInformationParser: _router.routeInformationParser,

@ -59,7 +59,7 @@ class LevelSelectionScreen extends StatelessWidget {
), ),
], ],
), ),
rectangularMenuArea: ElevatedButton( rectangularMenuArea: FilledButton(
onPressed: () { onPressed: () {
GoRouter.of(context).go('/'); GoRouter.of(context).go('/');
}, },

@ -44,7 +44,7 @@ class MainMenuScreen extends StatelessWidget {
rectangularMenuArea: Column( rectangularMenuArea: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
ElevatedButton( FilledButton(
onPressed: () { onPressed: () {
audioController.playSfx(SfxType.buttonTap); audioController.playSfx(SfxType.buttonTap);
GoRouter.of(context).go('/play'); GoRouter.of(context).go('/play');
@ -55,7 +55,7 @@ class MainMenuScreen extends StatelessWidget {
if (gamesServicesController != null) ...[ if (gamesServicesController != null) ...[
_hideUntilReady( _hideUntilReady(
ready: gamesServicesController.signedIn, ready: gamesServicesController.signedIn,
child: ElevatedButton( child: FilledButton(
onPressed: () => gamesServicesController.showAchievements(), onPressed: () => gamesServicesController.showAchievements(),
child: const Text('Achievements'), child: const Text('Achievements'),
), ),
@ -63,14 +63,14 @@ class MainMenuScreen extends StatelessWidget {
_gap, _gap,
_hideUntilReady( _hideUntilReady(
ready: gamesServicesController.signedIn, ready: gamesServicesController.signedIn,
child: ElevatedButton( child: FilledButton(
onPressed: () => gamesServicesController.showLeaderboard(), onPressed: () => gamesServicesController.showLeaderboard(),
child: const Text('Leaderboard'), child: const Text('Leaderboard'),
), ),
), ),
_gap, _gap,
], ],
ElevatedButton( FilledButton(
onPressed: () => GoRouter.of(context).push('/settings'), onPressed: () => GoRouter.of(context).push('/settings'),
child: const Text('Settings'), child: const Text('Settings'),
), ),

@ -93,7 +93,7 @@ class _PlaySessionScreenState extends State<PlaySessionScreen> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: SizedBox( child: SizedBox(
width: double.infinity, width: double.infinity,
child: ElevatedButton( child: FilledButton(
onPressed: () => GoRouter.of(context).go('/play'), onPressed: () => GoRouter.of(context).go('/play'),
child: const Text('Back'), child: const Text('Back'),
), ),

@ -101,7 +101,7 @@ class SettingsScreen extends StatelessWidget {
_gap, _gap,
], ],
), ),
rectangularMenuArea: ElevatedButton( rectangularMenuArea: FilledButton(
onPressed: () { onPressed: () {
GoRouter.of(context).pop(); GoRouter.of(context).pop();
}, },
@ -169,14 +169,19 @@ class _SettingsLine extends StatelessWidget {
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8), padding: const EdgeInsets.symmetric(horizontal: 8),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text(title, Expanded(
child: Text(
title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle( style: const TextStyle(
fontFamily: 'Permanent Marker', fontFamily: 'Permanent Marker',
fontSize: 30, fontSize: 30,
)), ),
const Spacer(), ),
),
icon, icon,
], ],
), ),

@ -61,7 +61,7 @@ class WinGameScreen extends StatelessWidget {
), ),
], ],
), ),
rectangularMenuArea: ElevatedButton( rectangularMenuArea: FilledButton(
onPressed: () { onPressed: () {
GoRouter.of(context).go('/play'); GoRouter.of(context).go('/play');
}, },

Loading…
Cancel
Save