2 Commits

Author SHA1 Message Date
69a038c84f added firestore to project 2025-01-03 14:38:14 -05:00
ed7ca12753 pre-firebase cleanup 2025-01-03 14:37:11 -05:00
4 changed files with 46 additions and 28 deletions

5
.gitignore vendored
View File

@@ -41,3 +41,8 @@ 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,5 +1,8 @@
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,6 +19,9 @@ 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,23 +147,24 @@ class _SuperGameState extends State<SuperGame> {
_showSubGameDialog(index); _showSubGameDialog(index);
} }
@override Widget _turnText() => Text(
Widget build(BuildContext context) {
return Column(
children: [
const Spacer(flex: 5),
Center(
child: Text(
gameEnded() gameEnded()
? "${Util.stateText(winner)} Wins" ? "${Util.stateText(winner)} Wins"
: "${Util.stateText(turn)}'s Turn", : "${Util.stateText(turn)}'s Turn",
style: const TextStyle(fontSize: 25), style: const TextStyle(fontSize: 25),
), );
),
const Spacer(flex: 1), Widget _subGmaeWidget(int i) {
GameHash( if (subGameEnded(i)) {
cellOnTapCallback: _cellOnTapCallback, return Text(
children: Iterable.generate(data.length) subGameWinner(i).name.toUpperCase(),
style: const TextStyle(fontSize: 40),
);
}
return TTCGame(turn: turn, data: data[i]);
}
List<Widget> _generateCells() => Iterable.generate(data.length)
.map( .map(
(i) => DecoratedBox( (i) => DecoratedBox(
decoration: BoxDecoration( decoration: BoxDecoration(
@@ -171,19 +172,25 @@ class _SuperGameState extends State<SuperGame> {
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(15), padding: const EdgeInsets.all(15),
child: !subGameEnded(i) child: _subGmaeWidget(i),
? TTCGame(
turn: turn,
data: data[i],
)
: Text(
subGameWinner(i).name.toUpperCase(),
style: const TextStyle(fontSize: 40),
),
), ),
), ),
) )
.toList()), .toList();
@override
Widget build(BuildContext context) {
return Column(
children: [
const Spacer(flex: 5),
Center(
child: _turnText(),
),
const Spacer(flex: 1),
GameHash(
cellOnTapCallback: _cellOnTapCallback,
children: _generateCells(),
),
const Spacer(flex: 5), const Spacer(flex: 5),
], ],
); );