diff --git a/ios/Flutter/flutter_export_environment.sh b/ios/Flutter/flutter_export_environment.sh new file mode 100644 index 0000000..dfbf159 --- /dev/null +++ b/ios/Flutter/flutter_export_environment.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# This is a generated file; do not edit or check into version control. +export "FLUTTER_ROOT=C:\Users\ehson\Downloads\flutter_windows_3.7.1-stable\flutter" +export "FLUTTER_APPLICATION_PATH=C:\Users\ehson\StudioProjects\FlutterTicTacToe" +export "COCOAPODS_PARALLEL_CODE_SIGN=true" +export "FLUTTER_TARGET=lib\main.dart" +export "FLUTTER_BUILD_DIR=build" +export "FLUTTER_BUILD_NAME=1.0.0" +export "FLUTTER_BUILD_NUMBER=1" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=true" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/lib/custom_dailog.dart b/lib/custom_dailog.dart index 699f744..017f862 100644 --- a/lib/custom_dailog.dart +++ b/lib/custom_dailog.dart @@ -14,9 +14,12 @@ class CustomDialog extends StatelessWidget { title: new Text(title), content: new Text(content), actions: [ - new FlatButton( + new TextButton( onPressed: callback, - color: Colors.white, + style:ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.white), + + ), child: new Text(actionText), ) ], diff --git a/lib/home_page.dart b/lib/home_page.dart index 01e3171..b84718c 100644 --- a/lib/home_page.dart +++ b/lib/home_page.dart @@ -10,7 +10,7 @@ class HomePage extends StatefulWidget { } class _HomePageState extends State { - List buttonsList; + List? buttonsList; var player1; var player2; var activePlayer; @@ -23,8 +23,8 @@ class _HomePageState extends State { } List doInit() { - player1 = new List(); - player2 = new List(); + player1 = []; + player2 = []; activePlayer = 1; var gameButtons = [ @@ -57,7 +57,7 @@ class _HomePageState extends State { gb.enabled = false; int winner = checkWinner(); if (winner == -1) { - if (buttonsList.every((p) => p.text != "")) { + if (buttonsList!.every((p) => p.text != "")) { showDialog( context: context, builder: (_) => new CustomDialog("Game Tied", @@ -70,7 +70,7 @@ class _HomePageState extends State { } void autoPlay() { - var emptyCells = new List(); + var emptyCells = []; var list = new List.generate(9, (i) => i + 1); for (var cellID in list) { if (!(player1.contains(cellID) || player2.contains(cellID))) { @@ -81,8 +81,8 @@ class _HomePageState extends State { var r = new Random(); var randIndex = r.nextInt(emptyCells.length-1); var cellID = emptyCells[randIndex]; - int i = buttonsList.indexWhere((p)=> p.id == cellID); - playGame(buttonsList[i]); + int i = buttonsList!.indexWhere((p)=> p.id == cellID); + playGame(buttonsList![i]); } @@ -192,33 +192,44 @@ class _HomePageState extends State { childAspectRatio: 1.0, crossAxisSpacing: 9.0, mainAxisSpacing: 9.0), - itemCount: buttonsList.length, + itemCount: buttonsList!.length, itemBuilder: (context, i) => new SizedBox( width: 100.0, height: 100.0, - child: new RaisedButton( - padding: const EdgeInsets.all(8.0), - onPressed: buttonsList[i].enabled - ? () => playGame(buttonsList[i]) + child: new ElevatedButton( + + style:ButtonStyle( + backgroundColor: MaterialStateProperty.all(buttonsList![i].bg), + padding: MaterialStateProperty.all(EdgeInsets.all(10)), + ), + //padding: const EdgeInsets.all(8.0), + onPressed: buttonsList![i].enabled + ? () => playGame(buttonsList![i]) : null, child: new Text( - buttonsList[i].text, + buttonsList![i].text, style: new TextStyle( color: Colors.white, fontSize: 20.0), + ), - color: buttonsList[i].bg, - disabledColor: buttonsList[i].bg, + + //disabledColor: buttonsList[i].bg, ), ), ), ), - new RaisedButton( + new ElevatedButton( child: new Text( "Reset", style: new TextStyle(color: Colors.white, fontSize: 20.0), ), - color: Colors.red, - padding: const EdgeInsets.all(20.0), + //color: Colors.red, + //padding: const EdgeInsets.all(20.0), + style:ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.redAccent), + + padding: MaterialStateProperty.all(EdgeInsets.all(20)), + ), onPressed: resetGame, ) ], diff --git a/pubspec.lock b/pubspec.lock index 93f3167..8081a5e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,90 +1,62 @@ # Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile +# See https://dart.dev/tools/pub/glossary#lockfile packages: - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "0.31.1" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.1" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" source: hosted - version: "2.0.6" - barback: - dependency: transitive - description: - name: barback - url: "https://pub.dartlang.org" - source: hosted - version: "0.15.2+15" + version: "2.10.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "1.0.3" - charcode: + version: "2.1.1" + characters: dependency: transitive description: - name: charcode - url: "https://pub.dartlang.org" + name: characters + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" source: hosted - version: "1.1.1" - cli_util: + version: "1.2.1" + clock: dependency: transitive description: - name: cli_util - url: "https://pub.dartlang.org" + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "0.1.2+1" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" source: hosted - version: "1.14.6" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2+1" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.14.1" + version: "1.17.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: e590b4212f085195dce802c2ae4c93dc3963e7e5f30a8f86ee212858c29ce186 + url: "https://pub.dev" source: hosted version: "0.1.2" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -95,297 +67,106 @@ packages: description: flutter source: sdk version: "0.0.0" - front_end: - dependency: transitive - description: - name: front_end - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0-alpha.9" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.5" - html: - dependency: transitive - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.13.3" - http: - dependency: transitive - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.3+16" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.4" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.1" - io: - dependency: transitive - description: - name: io - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.2+1" - isolate: - dependency: transitive - description: - name: isolate - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.1" - kernel: - dependency: transitive - description: - name: kernel - url: "https://pub.dartlang.org" + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" source: hosted - version: "0.3.0-alpha.9" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.3+1" + version: "0.6.5" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.1+4" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" source: hosted - version: "0.9.6" - multi_server_socket: + version: "0.12.13" + material_color_utilities: dependency: transitive description: - name: multi_server_socket - url: "https://pub.dartlang.org" + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "1.0.1" - node_preamble: - dependency: transitive - description: - name: node_preamble - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.0" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - package_resolver: + version: "0.2.0" + meta: dependency: transitive description: - name: package_resolver - url: "https://pub.dartlang.org" + name: meta + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.8.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.1" - plugin: - dependency: transitive - description: - name: plugin - url: "https://pub.dartlang.org" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" source: hosted - version: "0.2.0+2" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.4" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.3" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "0.29.0+1" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "0.7.2" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - shelf_static: - dependency: transitive - description: - name: shelf_static - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.7" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.2" + version: "1.8.2" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.4" - source_maps: - dependency: transitive - description: - name: source_maps - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.4" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.9.2" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "1.6.4" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - test: - dependency: transitive - description: - name: test - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "0.12.33" - typed_data: + version: "1.2.1" + test_api: dependency: transitive description: - name: typed_data - url: "https://pub.dartlang.org" + name: test_api + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" source: hosted - version: "1.1.5" - utf: - dependency: transitive - description: - name: utf - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0+4" + version: "0.4.16" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7+7" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.7" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.13" + version: "2.1.4" sdks: - dart: ">=2.0.0-dev.28.0 <=2.0.0-edge.0d5cf900b021bf5c9fa593ffa12b15bcd1cc5fe0" + dart: ">=2.18.0 <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index fb7d1bd..bec309a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,7 @@ name: tictactoe description: A new Flutter project. - +environment: + sdk: ">=2.17.1 <3.0.0" dependencies: flutter: sdk: flutter