mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Migrate game_template to Material 3 (#1613)
This commit is contained in:
@@ -255,6 +255,7 @@ class MyApp extends StatelessWidget {
|
||||
color: palette.ink,
|
||||
),
|
||||
),
|
||||
useMaterial3: true,
|
||||
),
|
||||
routeInformationProvider: _router.routeInformationProvider,
|
||||
routeInformationParser: _router.routeInformationParser,
|
||||
|
||||
@@ -59,7 +59,7 @@ class LevelSelectionScreen extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
rectangularMenuArea: ElevatedButton(
|
||||
rectangularMenuArea: FilledButton(
|
||||
onPressed: () {
|
||||
GoRouter.of(context).go('/');
|
||||
},
|
||||
|
||||
@@ -44,7 +44,7 @@ class MainMenuScreen extends StatelessWidget {
|
||||
rectangularMenuArea: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
FilledButton(
|
||||
onPressed: () {
|
||||
audioController.playSfx(SfxType.buttonTap);
|
||||
GoRouter.of(context).go('/play');
|
||||
@@ -55,7 +55,7 @@ class MainMenuScreen extends StatelessWidget {
|
||||
if (gamesServicesController != null) ...[
|
||||
_hideUntilReady(
|
||||
ready: gamesServicesController.signedIn,
|
||||
child: ElevatedButton(
|
||||
child: FilledButton(
|
||||
onPressed: () => gamesServicesController.showAchievements(),
|
||||
child: const Text('Achievements'),
|
||||
),
|
||||
@@ -63,14 +63,14 @@ class MainMenuScreen extends StatelessWidget {
|
||||
_gap,
|
||||
_hideUntilReady(
|
||||
ready: gamesServicesController.signedIn,
|
||||
child: ElevatedButton(
|
||||
child: FilledButton(
|
||||
onPressed: () => gamesServicesController.showLeaderboard(),
|
||||
child: const Text('Leaderboard'),
|
||||
),
|
||||
),
|
||||
_gap,
|
||||
],
|
||||
ElevatedButton(
|
||||
FilledButton(
|
||||
onPressed: () => GoRouter.of(context).push('/settings'),
|
||||
child: const Text('Settings'),
|
||||
),
|
||||
|
||||
@@ -93,7 +93,7 @@ class _PlaySessionScreenState extends State<PlaySessionScreen> {
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
child: FilledButton(
|
||||
onPressed: () => GoRouter.of(context).go('/play'),
|
||||
child: const Text('Back'),
|
||||
),
|
||||
|
||||
@@ -101,7 +101,7 @@ class SettingsScreen extends StatelessWidget {
|
||||
_gap,
|
||||
],
|
||||
),
|
||||
rectangularMenuArea: ElevatedButton(
|
||||
rectangularMenuArea: FilledButton(
|
||||
onPressed: () {
|
||||
GoRouter.of(context).pop();
|
||||
},
|
||||
@@ -169,14 +169,19 @@ class _SettingsLine extends StatelessWidget {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(title,
|
||||
Expanded(
|
||||
child: Text(
|
||||
title,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
fontFamily: 'Permanent Marker',
|
||||
fontSize: 30,
|
||||
)),
|
||||
const Spacer(),
|
||||
),
|
||||
),
|
||||
),
|
||||
icon,
|
||||
],
|
||||
),
|
||||
|
||||
@@ -61,7 +61,7 @@ class WinGameScreen extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
rectangularMenuArea: ElevatedButton(
|
||||
rectangularMenuArea: FilledButton(
|
||||
onPressed: () {
|
||||
GoRouter.of(context).go('/play');
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user