Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ptch : fixes UI changes mentioned in #10 #16

Open
wants to merge 1 commit into
base: prod
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';

Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
Expand All @@ -58,7 +59,6 @@ Future<void> 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.
Expand Down
41 changes: 26 additions & 15 deletions lib/src/change_name/change_name_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
],
),
),

);
}
}
Expand Down
210 changes: 134 additions & 76 deletions lib/src/main_menu/main_menu_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>(
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<bool>(
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<bool>(
// 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
Expand Down
75 changes: 39 additions & 36 deletions lib/src/play_session/play_session_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,50 +53,53 @@ class _PlaySessionScreenState extends State<PlaySessionScreen> {
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,
),
),
),
),
),
],
],
),
),
),
),
Expand Down