3 Commits

Author SHA1 Message Date
a174ffc7c2 cleanup of super game rendering 2024-12-30 12:32:52 -05:00
e9362706a1 rendering update 2024-12-30 12:18:12 -05:00
5c334577bf unified code for cumputing next player 2024-12-30 12:09:02 -05:00
4 changed files with 28 additions and 46 deletions

5
.gitignore vendored
View File

@@ -41,8 +41,3 @@ app.*.map.json
/android/app/debug /android/app/debug
/android/app/profile /android/app/profile
/android/app/release /android/app/release
# Firebase
lib/firebase_options.dart
android/app/google-services.json
firebase.json

View File

@@ -1,8 +1,5 @@
plugins { plugins {
id "com.android.application" id "com.android.application"
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
// END: FlutterFire Configuration
id "kotlin-android" id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin" id "dev.flutter.flutter-gradle-plugin"

View File

@@ -19,9 +19,6 @@ pluginManagement {
plugins { plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.1.0" apply false id "com.android.application" version "8.1.0" apply false
// START: FlutterFire Configuration
id "com.google.gms.google-services" version "4.3.15" apply false
// END: FlutterFire Configuration
id "org.jetbrains.kotlin.android" version "1.8.22" apply false id "org.jetbrains.kotlin.android" version "1.8.22" apply false
} }

View File

@@ -147,50 +147,43 @@ class _SuperGameState extends State<SuperGame> {
_showSubGameDialog(index); _showSubGameDialog(index);
} }
Widget _turnText() => Text(
gameEnded()
? "${Util.stateText(winner)} Wins"
: "${Util.stateText(turn)}'s Turn",
style: const TextStyle(fontSize: 25),
);
Widget _subGmaeWidget(int i) {
if (subGameEnded(i)) {
return Text(
subGameWinner(i).name.toUpperCase(),
style: const TextStyle(fontSize: 40),
);
}
return TTCGame(turn: turn, data: data[i]);
}
List<Widget> _generateCells() => Iterable.generate(data.length)
.map(
(i) => DecoratedBox(
decoration: BoxDecoration(
color: nextPlay == i ? Colors.lightGreenAccent : null,
),
child: Padding(
padding: const EdgeInsets.all(15),
child: _subGmaeWidget(i),
),
),
)
.toList();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
children: [ children: [
const Spacer(flex: 5), const Spacer(flex: 5),
Center( Center(
child: _turnText(), child: Text(
gameEnded()
? "${Util.stateText(winner)} Wins"
: "${Util.stateText(turn)}'s Turn",
style: const TextStyle(fontSize: 25),
),
), ),
const Spacer(flex: 1), const Spacer(flex: 1),
GameHash( GameHash(
cellOnTapCallback: _cellOnTapCallback, cellOnTapCallback: _cellOnTapCallback,
children: _generateCells(), children: Iterable.generate(data.length)
), .map(
(i) => DecoratedBox(
decoration: BoxDecoration(
color: nextPlay == i ? Colors.lightGreenAccent : null,
),
child: Padding(
padding: const EdgeInsets.all(15),
child: !subGameEnded(i)
? TTCGame(
turn: turn,
data: data[i],
)
: Text(
subGameWinner(i).name.toUpperCase(),
style: const TextStyle(fontSize: 40),
),
),
),
)
.toList()),
const Spacer(flex: 5), const Spacer(flex: 5),
], ],
); );