Compare commits
2 Commits
astoica/pr
...
69a038c84f
| Author | SHA1 | Date | |
|---|---|---|---|
| 69a038c84f | |||
| ed7ca12753 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -41,3 +41,8 @@ app.*.map.json
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
|
||||
# Firebase
|
||||
lib/firebase_options.dart
|
||||
android/app/google-services.json
|
||||
firebase.json
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
plugins {
|
||||
id "com.android.application"
|
||||
// START: FlutterFire Configuration
|
||||
id 'com.google.gms.google-services'
|
||||
// END: FlutterFire Configuration
|
||||
id "kotlin-android"
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id "dev.flutter.flutter-gradle-plugin"
|
||||
|
||||
@@ -19,6 +19,9 @@ pluginManagement {
|
||||
plugins {
|
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
@@ -147,43 +147,50 @@ class _SuperGameState extends State<SuperGame> {
|
||||
_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
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
const Spacer(flex: 5),
|
||||
Center(
|
||||
child: Text(
|
||||
gameEnded()
|
||||
? "${Util.stateText(winner)} Wins"
|
||||
: "${Util.stateText(turn)}'s Turn",
|
||||
style: const TextStyle(fontSize: 25),
|
||||
),
|
||||
child: _turnText(),
|
||||
),
|
||||
const Spacer(flex: 1),
|
||||
GameHash(
|
||||
cellOnTapCallback: _cellOnTapCallback,
|
||||
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()),
|
||||
cellOnTapCallback: _cellOnTapCallback,
|
||||
children: _generateCells(),
|
||||
),
|
||||
const Spacer(flex: 5),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user