diff --git a/android/build.gradle b/android/build.gradle index a7c6e0e..5e42287 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,9 +6,9 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:7.4.1' // START: FlutterFire Configuration - classpath 'com.google.gms:google-services:4.3.10' + classpath 'com.google.gms:google-services:4.3.14' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1' // END: FlutterFire Configuration classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" diff --git a/lib/main.dart b/lib/main.dart index 3b0d659..61998d4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -42,6 +42,7 @@ import 'package:firebase_core/firebase_core.dart'; import 'firebase_options.dart'; Future main() async { + WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, ); @@ -58,7 +59,6 @@ Future main() async { ); }); - WidgetsFlutterBinding.ensureInitialized(); // TODO: To enable Firebase Crashlytics, uncomment the following line. // See the 'Crashlytics' section of the main README.md file for details. diff --git a/lib/src/change_name/change_name_screen.dart b/lib/src/change_name/change_name_screen.dart index 7817c2e..c5b0d6a 100644 --- a/lib/src/change_name/change_name_screen.dart +++ b/lib/src/change_name/change_name_screen.dart @@ -14,27 +14,38 @@ class ChangeNameScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - body: ResponsiveScreen( - squarishMainArea: Center( - child: Column( - children: const [ - _NameChangeLine('P1 :', Player.player1), + body: SafeArea( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Center( + child: Column( + children: const [ + _NameChangeLine('P1 :', Player.player1), + _gap, + _NameChangeLine('P2 :', Player.player2), + ], + ), + ), + Column( + children: [ _gap, - _NameChangeLine('P2 :', Player.player2), + Padding( + padding: const EdgeInsets.all(20.0), + child: FilledButton( + + onPressed: () { + GoRouter.of(context).go('/play/session'); + }, + child: Text('Start')), + ), + ], ), - ), - rectangularMenuArea: Column( - children: [ - _gap, - FilledButton( - onPressed: () { - GoRouter.of(context).go('/play/session'); - }, - child: Text('Start')) ], ), ), + ); } } diff --git a/lib/src/main_menu/main_menu_screen.dart b/lib/src/main_menu/main_menu_screen.dart index 597ea47..7dea57e 100644 --- a/lib/src/main_menu/main_menu_screen.dart +++ b/lib/src/main_menu/main_menu_screen.dart @@ -25,91 +25,149 @@ class MainMenuScreen extends StatelessWidget { return Scaffold( backgroundColor: palette.backgroundMain, - body: ResponsiveScreen( - mainAreaProminence: 0.45, - squarishMainArea: Center( - child: Transform.rotate( - angle: -0.1, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: Transform.rotate( + angle: -0.1, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Pipo!\n', + // textAlign: TextAlign.center, + style: TextStyle( + fontFamily: 'Permanent Marker', + color: palette.redPen, + fontSize: 55 , + height: 1, + ), + ), + // SizedBox(height: 2,), + Text( + 'MDGSpace game!', + // textAlign: TextAlign.center, + style: TextStyle( + fontFamily: 'Permanent Marker', + color: palette.ink, + fontSize: 40, + height: 1, + ), + ), + ], + ), + ), + ), + Column( + mainAxisAlignment: MainAxisAlignment.end, children: [ - Text( - 'Pipo!\n', - textAlign: TextAlign.center, - style: TextStyle( - fontFamily: 'Permanent Marker', - color: palette.redPen, - fontSize: 55, - height: 1, + FilledButton( + onPressed: () { + audioController.playSfx(SfxType.buttonTap); + GoRouter.of(context).go('/play'); + }, + child: const Text('Play'), + ), + _gap, + if (gamesServicesController != null) ...[ + _hideUntilReady( + ready: gamesServicesController.signedIn, + child: FilledButton( + onPressed: () => + gamesServicesController.showAchievements(), + child: const Text('Achievements'), + ), + ), + _gap, + _hideUntilReady( + ready: gamesServicesController.signedIn, + child: FilledButton( + onPressed: () => + gamesServicesController.showLeaderboard(), + child: const Text('Leaderboard'), + ), ), + _gap, + ], + FilledButton( + onPressed: () => GoRouter.of(context).push('/settings'), + child: const Text('Settings'), ), - // SizedBox(height: 2,), - Text( - 'MDGSpace game!', - textAlign: TextAlign.center, - style: TextStyle( - fontFamily: 'Permanent Marker', - color: palette.ink, - fontSize: 40, - height: 1, + _gap, + Padding( + padding: const EdgeInsets.only(top: 32), + child: ValueListenableBuilder( + valueListenable: settingsController.muted, + builder: (context, muted, child) { + return IconButton( + onPressed: () => settingsController.toggleMuted(), + icon: Icon(muted ? Icons.volume_off : Icons.volume_up), + ); + }, ), ), + _gap, + const Text('Music by Mr Smith'), + _gap, ], ), - ), - ), - rectangularMenuArea: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - FilledButton( - onPressed: () { - audioController.playSfx(SfxType.buttonTap); - GoRouter.of(context).go('/play'); - }, - child: const Text('Play'), - ), - _gap, - if (gamesServicesController != null) ...[ - _hideUntilReady( - ready: gamesServicesController.signedIn, - child: FilledButton( - onPressed: () => gamesServicesController.showAchievements(), - child: const Text('Achievements'), - ), - ), - _gap, - _hideUntilReady( - ready: gamesServicesController.signedIn, - child: FilledButton( - onPressed: () => gamesServicesController.showLeaderboard(), - child: const Text('Leaderboard'), - ), - ), - _gap, - ], - FilledButton( - onPressed: () => GoRouter.of(context).push('/settings'), - child: const Text('Settings'), - ), - _gap, - Padding( - padding: const EdgeInsets.only(top: 32), - child: ValueListenableBuilder( - valueListenable: settingsController.muted, - builder: (context, muted, child) { - return IconButton( - onPressed: () => settingsController.toggleMuted(), - icon: Icon(muted ? Icons.volume_off : Icons.volume_up), - ); - }, - ), - ), - _gap, - const Text('Music by Mr Smith'), - _gap, ], ), - ), + + // Column( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // FilledButton( + // onPressed: () { + // audioController.playSfx(SfxType.buttonTap); + // GoRouter.of(context).go('/play'); + // }, + // child: const Text('Play'), + // ), + // _gap, + // if (gamesServicesController != null) ...[ + // _hideUntilReady( + // ready: gamesServicesController.signedIn, + // child: FilledButton( + // onPressed: () => gamesServicesController.showAchievements(), + // child: const Text('Achievements'), + // ), + // ), + // _gap, + // _hideUntilReady( + // ready: gamesServicesController.signedIn, + // child: FilledButton( + // onPressed: () => gamesServicesController.showLeaderboard(), + // child: const Text('Leaderboard'), + // ), + // ), + // _gap, + // ], + // FilledButton( + // onPressed: () => GoRouter.of(context).push('/settings'), + // child: const Text('Settings'), + // ), + // _gap, + // Padding( + // padding: const EdgeInsets.only(top: 32), + // child: ValueListenableBuilder( + // valueListenable: settingsController.muted, + // builder: (context, muted, child) { + // return IconButton( + // onPressed: () => settingsController.toggleMuted(), + // icon: Icon(muted ? Icons.volume_off : Icons.volume_up), + // ); + // }, + // ), + // ), + // _gap, + // const Text('Music by Mr Smith'), + // _gap, + // ], + // ), + // floatingActionButton: FloatingActionButton( // onPressed: () { // // change palette diff --git a/lib/src/play_session/play_session_screen.dart b/lib/src/play_session/play_session_screen.dart index 63ca865..b44c0f3 100644 --- a/lib/src/play_session/play_session_screen.dart +++ b/lib/src/play_session/play_session_screen.dart @@ -53,50 +53,53 @@ class _PlaySessionScreenState extends State { ignoring: _duringCelebration, child: Scaffold( backgroundColor: palette.backgroundPlaySession, - body: Stack( - children: [ - Center( - // This is the entirety of the "game". - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: Alignment.centerRight, - child: InkResponse( - onTap: () => GoRouter.of(context).push('/settings'), - child: Image.asset( - 'assets/images/settings.png', - semanticLabel: 'Settings', + body: SafeArea( + child: Stack( + children: [ + Center( + // This is the entirety of the "game". + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: Alignment.centerRight, + child: InkResponse( + onTap: () => GoRouter.of(context).push('/settings'), + child: Image.asset( + 'assets/images/settings.png', + semanticLabel: 'Settings', + ), ), ), - ), - const Spacer(), - GameGrid(), - const Spacer(), - Padding( - padding: const EdgeInsets.all(8.0), - child: SizedBox( - width: 300, - child: FilledButton( - onPressed: () => GoRouter.of(context).go('/play'), - child: const Text('Quit'), + const Spacer(), + GameGrid(), + const Spacer(), + Padding( + padding: const EdgeInsets.all(20.0), + child: SizedBox( + width: 300, + child: FilledButton( + onPressed: () => GoRouter.of(context).go('/play'), + child: const Text('Quit'), + ), ), ), - ), - ], + + ], + ), ), - ), - SizedBox.expand( - child: Visibility( - visible: _duringCelebration, - child: IgnorePointer( - child: Confetti( - isStopped: !_duringCelebration, + SizedBox.expand( + child: Visibility( + visible: _duringCelebration, + child: IgnorePointer( + child: Confetti( + isStopped: !_duringCelebration, + ), ), ), ), - ), - ], + ], + ), ), ), ),