Compare commits
2 Commits
a174ffc7c2
...
astoica/fi
| Author | SHA1 | Date | |
|---|---|---|---|
| 69a038c84f | |||
| ed7ca12753 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -147,43 +147,50 @@ 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: Text(
|
child: _turnText(),
|
||||||
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: Iterable.generate(data.length)
|
children: _generateCells(),
|
||||||
.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),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user