diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..34ff3a0 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,25 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "huacu_mobile", + "request": "launch", + "type": "dart" + }, + { + "name": "huacu_mobile (profile mode)", + "request": "launch", + "type": "dart", + "flutterMode": "profile" + }, + { + "name": "huacu_mobile (release mode)", + "request": "launch", + "type": "dart", + "flutterMode": "release" + } + ] +} \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index bf20d78..5110f4f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -65,7 +65,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.huacu_mobile" + applicationId "xyz.nuark.mobile.huacu_mobile" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. minSdkVersion flutter.minSdkVersion diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 4f31fe3..cdeee42 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,9 +2,10 @@ package="com.example.huacu_mobile"> + android:icon="@mipmap/ic_launcher" + android:roundIcon="@mipmap/ic_launcher_round"> + + + + + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..e7b046d --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index db77bb4..d725460 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png new file mode 100644 index 0000000..87e467f Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..68ccfb1 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png new file mode 100644 index 0000000..c034567 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..79883cc Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 17987b7..9975571 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png new file mode 100644 index 0000000..a3a7173 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..18d0ca2 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png new file mode 100644 index 0000000..6e88b37 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..3c69435 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 09d4391..2d396d4 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png new file mode 100644 index 0000000..ace9f71 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..816697e Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png new file mode 100644 index 0000000..facecfd Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..cd3f177 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index d5f1c8d..2227ae9 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png new file mode 100644 index 0000000..0ea310d Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..c934436 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png new file mode 100644 index 0000000..2806463 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..840d07a Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 4d6372e..41ac82e 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png new file mode 100644 index 0000000..e8b2932 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..6135629 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png new file mode 100644 index 0000000..45c3a99 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..bdf0846 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/assets/ic_background.png b/assets/ic_background.png new file mode 100644 index 0000000..ef46f8b Binary files /dev/null and b/assets/ic_background.png differ diff --git a/assets/ic_foreground.png b/assets/ic_foreground.png new file mode 100644 index 0000000..220d9f9 Binary files /dev/null and b/assets/ic_foreground.png differ diff --git a/assets/ic_logo_border.png b/assets/ic_logo_border.png new file mode 100644 index 0000000..2fe2d1d Binary files /dev/null and b/assets/ic_logo_border.png differ diff --git a/assets/ic_logo_monochrome.png b/assets/ic_logo_monochrome.png new file mode 100644 index 0000000..e59c52d Binary files /dev/null and b/assets/ic_logo_monochrome.png differ diff --git a/assets/ic_logo_rectangle.png b/assets/ic_logo_rectangle.png new file mode 100644 index 0000000..4909822 Binary files /dev/null and b/assets/ic_logo_rectangle.png differ diff --git a/assets/ic_logo_round.png b/assets/ic_logo_round.png new file mode 100644 index 0000000..94b257c Binary files /dev/null and b/assets/ic_logo_round.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index d36b1fa..eabd851 100644 --- a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,122 +1,122 @@ { - "images" : [ + "images": [ { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" + "filename": "Icon-App-20x20@2x.png", + "idiom": "iphone", + "scale": "2x", + "size": "20x20" }, { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" + "filename": "Icon-App-20x20@3x.png", + "idiom": "iphone", + "scale": "3x", + "size": "20x20" }, { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" + "filename": "Icon-App-29x29@1x.png", + "idiom": "iphone", + "scale": "1x", + "size": "29x29" }, { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" + "filename": "Icon-App-29x29@2x.png", + "idiom": "iphone", + "scale": "2x", + "size": "29x29" }, { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" + "filename": "Icon-App-29x29@3x.png", + "idiom": "iphone", + "scale": "3x", + "size": "29x29" }, { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" + "filename": "Icon-App-40x40@2x.png", + "idiom": "iphone", + "scale": "2x", + "size": "40x40" }, { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" + "filename": "Icon-App-40x40@3x.png", + "idiom": "iphone", + "scale": "3x", + "size": "40x40" }, { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" + "filename": "Icon-App-60x60@2x.png", + "idiom": "iphone", + "scale": "2x", + "size": "60x60" }, { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" + "filename": "Icon-App-60x60@3x.png", + "idiom": "iphone", + "scale": "3x", + "size": "60x60" }, { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" + "filename": "Icon-App-20x20@1x.png", + "idiom": "ipad", + "scale": "1x", + "size": "20x20" }, { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" + "filename": "Icon-App-20x20@2x.png", + "idiom": "ipad", + "scale": "2x", + "size": "20x20" }, { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" + "filename": "Icon-App-29x29@1x.png", + "idiom": "ipad", + "scale": "1x", + "size": "29x29" }, { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" + "filename": "Icon-App-29x29@2x.png", + "idiom": "ipad", + "scale": "2x", + "size": "29x29" }, { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" + "filename": "Icon-App-40x40@1x.png", + "idiom": "ipad", + "scale": "1x", + "size": "40x40" }, { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" + "filename": "Icon-App-40x40@2x.png", + "idiom": "ipad", + "scale": "2x", + "size": "40x40" }, { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" + "filename": "Icon-App-76x76@1x.png", + "idiom": "ipad", + "scale": "1x", + "size": "76x76" }, { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" + "filename": "Icon-App-76x76@2x.png", + "idiom": "ipad", + "scale": "2x", + "size": "76x76" }, { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" + "filename": "Icon-App-83.5x83.5@2x.png", + "idiom": "ipad", + "scale": "2x", + "size": "83.5x83.5" }, { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" + "filename": "Icon-App-1024x1024@1x.png", + "idiom": "ios-marketing", + "scale": "1x", + "size": "1024x1024" } ], - "info" : { - "version" : 1, - "author" : "xcode" + "info": { + "author": "icons_launcher", + "version": 1 } -} +} \ No newline at end of file diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png index dc9ada4..1562d56 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf0..bb5ca9c 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd9..5c85c46 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b..c023bb1 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde121..a5910b3 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e..731cd59 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc230..94366d4 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd9..5c85c46 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8..34a770b 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b86..3e7b484 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b86..3e7b484 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d16..f3093ad 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d..7840c2b 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41..3684403 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f58..09ef699 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 886ea98..0b6e6d8 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - huacu_mobile + HUACU CFBundlePackageType APPL CFBundleShortVersionString diff --git a/lib/game_pallete.dart b/lib/game_pallete.dart index d0f09dd..6f0ba52 100644 --- a/lib/game_pallete.dart +++ b/lib/game_pallete.dart @@ -1,204 +1,506 @@ import 'dart:ui'; +import 'package:flutter/material.dart'; + const pallete = { - "A0": Color.fromRGBO(0, 0, 186, 1), - "A1": Color.fromRGBO(0, 26, 186, 1), - "A2": Color.fromRGBO(0, 51, 186, 1), - "A3": Color.fromRGBO(0, 77, 186, 1), - "A4": Color.fromRGBO(0, 102, 186, 1), - "A5": Color.fromRGBO(0, 128, 186, 1), - "A6": Color.fromRGBO(0, 153, 186, 1), - "A7": Color.fromRGBO(0, 179, 186, 1), - "A8": Color.fromRGBO(0, 204, 186, 1), - "A9": Color.fromRGBO(0, 230, 186, 1), - "B0": Color.fromRGBO(13, 0, 186, 1), - "B1": Color.fromRGBO(13, 26, 186, 1), - "B2": Color.fromRGBO(13, 51, 186, 1), - "B3": Color.fromRGBO(13, 77, 186, 1), - "B4": Color.fromRGBO(13, 102, 186, 1), - "B5": Color.fromRGBO(13, 128, 186, 1), - "B6": Color.fromRGBO(13, 153, 186, 1), - "B7": Color.fromRGBO(13, 179, 186, 1), - "B8": Color.fromRGBO(13, 204, 186, 1), - "B9": Color.fromRGBO(13, 230, 186, 1), - "C0": Color.fromRGBO(26, 0, 186, 1), - "C1": Color.fromRGBO(26, 26, 186, 1), - "C2": Color.fromRGBO(26, 51, 186, 1), - "C3": Color.fromRGBO(26, 77, 186, 1), - "C4": Color.fromRGBO(26, 102, 186, 1), - "C5": Color.fromRGBO(26, 128, 186, 1), - "C6": Color.fromRGBO(26, 153, 186, 1), - "C7": Color.fromRGBO(26, 179, 186, 1), - "C8": Color.fromRGBO(26, 204, 186, 1), - "C9": Color.fromRGBO(26, 230, 186, 1), - "D0": Color.fromRGBO(38, 0, 186, 1), - "D1": Color.fromRGBO(38, 26, 186, 1), - "D2": Color.fromRGBO(38, 51, 186, 1), - "D3": Color.fromRGBO(38, 77, 186, 1), - "D4": Color.fromRGBO(38, 102, 186, 1), - "D5": Color.fromRGBO(38, 128, 186, 1), - "D6": Color.fromRGBO(38, 153, 186, 1), - "D7": Color.fromRGBO(38, 179, 186, 1), - "D8": Color.fromRGBO(38, 204, 186, 1), - "D9": Color.fromRGBO(38, 230, 186, 1), - "E0": Color.fromRGBO(51, 0, 186, 1), - "E1": Color.fromRGBO(51, 26, 186, 1), - "E2": Color.fromRGBO(51, 51, 186, 1), - "E3": Color.fromRGBO(51, 77, 186, 1), - "E4": Color.fromRGBO(51, 102, 186, 1), - "E5": Color.fromRGBO(51, 128, 186, 1), - "E6": Color.fromRGBO(51, 153, 186, 1), - "E7": Color.fromRGBO(51, 179, 186, 1), - "E8": Color.fromRGBO(51, 204, 186, 1), - "E9": Color.fromRGBO(51, 230, 186, 1), - "F0": Color.fromRGBO(64, 0, 186, 1), - "F1": Color.fromRGBO(64, 26, 186, 1), - "F2": Color.fromRGBO(64, 51, 186, 1), - "F3": Color.fromRGBO(64, 77, 186, 1), - "F4": Color.fromRGBO(64, 102, 186, 1), - "F5": Color.fromRGBO(64, 128, 186, 1), - "F6": Color.fromRGBO(64, 153, 186, 1), - "F7": Color.fromRGBO(64, 179, 186, 1), - "F8": Color.fromRGBO(64, 204, 186, 1), - "F9": Color.fromRGBO(64, 230, 186, 1), - "G0": Color.fromRGBO(77, 0, 186, 1), - "G1": Color.fromRGBO(77, 26, 186, 1), - "G2": Color.fromRGBO(77, 51, 186, 1), - "G3": Color.fromRGBO(77, 77, 186, 1), - "G4": Color.fromRGBO(77, 102, 186, 1), - "G5": Color.fromRGBO(77, 128, 186, 1), - "G6": Color.fromRGBO(77, 153, 186, 1), - "G7": Color.fromRGBO(77, 179, 186, 1), - "G8": Color.fromRGBO(77, 204, 186, 1), - "G9": Color.fromRGBO(77, 230, 186, 1), - "H0": Color.fromRGBO(89, 0, 186, 1), - "H1": Color.fromRGBO(89, 26, 186, 1), - "H2": Color.fromRGBO(89, 51, 186, 1), - "H3": Color.fromRGBO(89, 77, 186, 1), - "H4": Color.fromRGBO(89, 102, 186, 1), - "H5": Color.fromRGBO(89, 128, 186, 1), - "H6": Color.fromRGBO(89, 153, 186, 1), - "H7": Color.fromRGBO(89, 179, 186, 1), - "H8": Color.fromRGBO(89, 204, 186, 1), - "H9": Color.fromRGBO(89, 230, 186, 1), - "I0": Color.fromRGBO(102, 0, 186, 1), - "I1": Color.fromRGBO(102, 26, 186, 1), - "I2": Color.fromRGBO(102, 51, 186, 1), - "I3": Color.fromRGBO(102, 77, 186, 1), - "I4": Color.fromRGBO(102, 102, 186, 1), - "I5": Color.fromRGBO(102, 128, 186, 1), - "I6": Color.fromRGBO(102, 153, 186, 1), - "I7": Color.fromRGBO(102, 179, 186, 1), - "I8": Color.fromRGBO(102, 204, 186, 1), - "I9": Color.fromRGBO(102, 230, 186, 1), - "J0": Color.fromRGBO(115, 0, 186, 1), - "J1": Color.fromRGBO(115, 26, 186, 1), - "J2": Color.fromRGBO(115, 51, 186, 1), - "J3": Color.fromRGBO(115, 77, 186, 1), - "J4": Color.fromRGBO(115, 102, 186, 1), - "J5": Color.fromRGBO(115, 128, 186, 1), - "J6": Color.fromRGBO(115, 153, 186, 1), - "J7": Color.fromRGBO(115, 179, 186, 1), - "J8": Color.fromRGBO(115, 204, 186, 1), - "J9": Color.fromRGBO(115, 230, 186, 1), - "K0": Color.fromRGBO(128, 0, 186, 1), - "K1": Color.fromRGBO(128, 26, 186, 1), - "K2": Color.fromRGBO(128, 51, 186, 1), - "K3": Color.fromRGBO(128, 77, 186, 1), - "K4": Color.fromRGBO(128, 102, 186, 1), - "K5": Color.fromRGBO(128, 128, 186, 1), - "K6": Color.fromRGBO(128, 153, 186, 1), - "K7": Color.fromRGBO(128, 179, 186, 1), - "K8": Color.fromRGBO(128, 204, 186, 1), - "K9": Color.fromRGBO(128, 230, 186, 1), - "L0": Color.fromRGBO(140, 0, 186, 1), - "L1": Color.fromRGBO(140, 26, 186, 1), - "L2": Color.fromRGBO(140, 51, 186, 1), - "L3": Color.fromRGBO(140, 77, 186, 1), - "L4": Color.fromRGBO(140, 102, 186, 1), - "L5": Color.fromRGBO(140, 128, 186, 1), - "L6": Color.fromRGBO(140, 153, 186, 1), - "L7": Color.fromRGBO(140, 179, 186, 1), - "L8": Color.fromRGBO(140, 204, 186, 1), - "L9": Color.fromRGBO(140, 230, 186, 1), - "M0": Color.fromRGBO(153, 0, 186, 1), - "M1": Color.fromRGBO(153, 26, 186, 1), - "M2": Color.fromRGBO(153, 51, 186, 1), - "M3": Color.fromRGBO(153, 77, 186, 1), - "M4": Color.fromRGBO(153, 102, 186, 1), - "M5": Color.fromRGBO(153, 128, 186, 1), - "M6": Color.fromRGBO(153, 153, 186, 1), - "M7": Color.fromRGBO(153, 179, 186, 1), - "M8": Color.fromRGBO(153, 204, 186, 1), - "M9": Color.fromRGBO(153, 230, 186, 1), - "N0": Color.fromRGBO(166, 0, 186, 1), - "N1": Color.fromRGBO(166, 26, 186, 1), - "N2": Color.fromRGBO(166, 51, 186, 1), - "N3": Color.fromRGBO(166, 77, 186, 1), - "N4": Color.fromRGBO(166, 102, 186, 1), - "N5": Color.fromRGBO(166, 128, 186, 1), - "N6": Color.fromRGBO(166, 153, 186, 1), - "N7": Color.fromRGBO(166, 179, 186, 1), - "N8": Color.fromRGBO(166, 204, 186, 1), - "N9": Color.fromRGBO(166, 230, 186, 1), - "O0": Color.fromRGBO(179, 0, 186, 1), - "O1": Color.fromRGBO(179, 26, 186, 1), - "O2": Color.fromRGBO(179, 51, 186, 1), - "O3": Color.fromRGBO(179, 77, 186, 1), - "O4": Color.fromRGBO(179, 102, 186, 1), - "O5": Color.fromRGBO(179, 128, 186, 1), - "O6": Color.fromRGBO(179, 153, 186, 1), - "O7": Color.fromRGBO(179, 179, 186, 1), - "O8": Color.fromRGBO(179, 204, 186, 1), - "O9": Color.fromRGBO(179, 230, 186, 1), - "P0": Color.fromRGBO(191, 0, 186, 1), - "P1": Color.fromRGBO(191, 26, 186, 1), - "P2": Color.fromRGBO(191, 51, 186, 1), - "P3": Color.fromRGBO(191, 77, 186, 1), - "P4": Color.fromRGBO(191, 102, 186, 1), - "P5": Color.fromRGBO(191, 128, 186, 1), - "P6": Color.fromRGBO(191, 153, 186, 1), - "P7": Color.fromRGBO(191, 179, 186, 1), - "P8": Color.fromRGBO(191, 204, 186, 1), - "P9": Color.fromRGBO(191, 230, 186, 1), - "Q0": Color.fromRGBO(204, 0, 186, 1), - "Q1": Color.fromRGBO(204, 26, 186, 1), - "Q2": Color.fromRGBO(204, 51, 186, 1), - "Q3": Color.fromRGBO(204, 77, 186, 1), - "Q4": Color.fromRGBO(204, 102, 186, 1), - "Q5": Color.fromRGBO(204, 128, 186, 1), - "Q6": Color.fromRGBO(204, 153, 186, 1), - "Q7": Color.fromRGBO(204, 179, 186, 1), - "Q8": Color.fromRGBO(204, 204, 186, 1), - "Q9": Color.fromRGBO(204, 230, 186, 1), - "R0": Color.fromRGBO(217, 0, 186, 1), - "R1": Color.fromRGBO(217, 26, 186, 1), - "R2": Color.fromRGBO(217, 51, 186, 1), - "R3": Color.fromRGBO(217, 77, 186, 1), - "R4": Color.fromRGBO(217, 102, 186, 1), - "R5": Color.fromRGBO(217, 128, 186, 1), - "R6": Color.fromRGBO(217, 153, 186, 1), - "R7": Color.fromRGBO(217, 179, 186, 1), - "R8": Color.fromRGBO(217, 204, 186, 1), - "R9": Color.fromRGBO(217, 230, 186, 1), - "S0": Color.fromRGBO(230, 0, 186, 1), - "S1": Color.fromRGBO(230, 26, 186, 1), - "S2": Color.fromRGBO(230, 51, 186, 1), - "S3": Color.fromRGBO(230, 77, 186, 1), - "S4": Color.fromRGBO(230, 102, 186, 1), - "S5": Color.fromRGBO(230, 128, 186, 1), - "S6": Color.fromRGBO(230, 153, 186, 1), - "S7": Color.fromRGBO(230, 179, 186, 1), - "S8": Color.fromRGBO(230, 204, 186, 1), - "S9": Color.fromRGBO(230, 230, 186, 1), - "T0": Color.fromRGBO(242, 0, 186, 1), - "T1": Color.fromRGBO(242, 26, 186, 1), - "T2": Color.fromRGBO(242, 51, 186, 1), - "T3": Color.fromRGBO(242, 77, 186, 1), - "T4": Color.fromRGBO(242, 102, 186, 1), - "T5": Color.fromRGBO(242, 128, 186, 1), - "T6": Color.fromRGBO(242, 153, 186, 1), - "T7": Color.fromRGBO(242, 179, 186, 1), - "T8": Color.fromRGBO(242, 204, 186, 1), - "T9": Color.fromRGBO(242, 230, 186, 1) + "A1": Color.fromRGBO(107, 38, 5, 1), + "A2": Color.fromRGBO(117, 33, 5, 1), + "A3": Color.fromRGBO(128, 26, 12, 1), + "A4": Color.fromRGBO(148, 13, 17, 1), + "A5": Color.fromRGBO(162, 3, 21, 1), + "A6": Color.fromRGBO(174, 0, 25, 1), + "A7": Color.fromRGBO(190, 0, 26, 1), + "A8": Color.fromRGBO(217, 1, 25, 1), + "A9": Color.fromRGBO(246, 1, 18, 1), + "A10": Color.fromRGBO(255, 0, 13, 1), + "A11": Color.fromRGBO(255, 0, 6, 1), + "A12": Color.fromRGBO(255, 0, 8, 1), + "A13": Color.fromRGBO(255, 0, 30, 1), + "A14": Color.fromRGBO(255, 0, 48, 1), + "A15": Color.fromRGBO(255, 1, 65, 1), + "A16": Color.fromRGBO(255, 0, 80, 1), + "A17": Color.fromRGBO(250, 0, 98, 1), + "A18": Color.fromRGBO(247, 0, 117, 1), + "A19": Color.fromRGBO(236, 0, 136, 1), + "A20": Color.fromRGBO(230, 1, 146, 1), + "A21": Color.fromRGBO(218, 0, 146, 1), + "A22": Color.fromRGBO(203, 19, 149, 1), + "A23": Color.fromRGBO(198, 35, 152, 1), + "A24": Color.fromRGBO(183, 39, 153, 1), + "A25": Color.fromRGBO(173, 46, 153, 1), + "A26": Color.fromRGBO(158, 49, 154, 1), + "A27": Color.fromRGBO(151, 56, 156, 1), + "A28": Color.fromRGBO(142, 57, 158, 1), + "A29": Color.fromRGBO(135, 59, 159, 1), + "A30": Color.fromRGBO(124, 62, 161, 1), + "B1": Color.fromRGBO(146, 71, 14, 1), + "B2": Color.fromRGBO(161, 63, 16, 1), + "B3": Color.fromRGBO(171, 55, 16, 1), + "B4": Color.fromRGBO(185, 52, 21, 1), + "B5": Color.fromRGBO(199, 43, 21, 1), + "B6": Color.fromRGBO(216, 12, 24, 1), + "B7": Color.fromRGBO(237, 2, 19, 1), + "B8": Color.fromRGBO(250, 0, 14, 1), + "B9": Color.fromRGBO(255, 0, 8, 1), + "B10": Color.fromRGBO(255, 0, 24, 1), + "B11": Color.fromRGBO(255, 0, 34, 1), + "B12": Color.fromRGBO(254, 0, 52, 1), + "B13": Color.fromRGBO(255, 1, 55, 1), + "B14": Color.fromRGBO(255, 0, 76, 1), + "B15": Color.fromRGBO(255, 0, 94, 1), + "B16": Color.fromRGBO(255, 0, 110, 1), + "B17": Color.fromRGBO(255, 1, 126, 1), + "B18": Color.fromRGBO(255, 0, 144, 1), + "B19": Color.fromRGBO(240, 1, 147, 1), + "B20": Color.fromRGBO(226, 35, 151, 1), + "B21": Color.fromRGBO(207, 49, 159, 1), + "B22": Color.fromRGBO(198, 48, 158, 1), + "B23": Color.fromRGBO(180, 48, 157, 1), + "B24": Color.fromRGBO(170, 54, 155, 1), + "B25": Color.fromRGBO(165, 54, 156, 1), + "B26": Color.fromRGBO(152, 55, 152, 1), + "B27": Color.fromRGBO(140, 58, 158, 1), + "B28": Color.fromRGBO(137, 59, 160, 1), + "B29": Color.fromRGBO(120, 58, 157, 1), + "B30": Color.fromRGBO(113, 57, 158, 1), + "C1": Color.fromRGBO(176, 94, 21, 1), + "C2": Color.fromRGBO(184, 85, 18, 1), + "C3": Color.fromRGBO(200, 84, 11, 1), + "C4": Color.fromRGBO(208, 69, 14, 1), + "C5": Color.fromRGBO(223, 57, 17, 1), + "C6": Color.fromRGBO(235, 45, 19, 1), + "C7": Color.fromRGBO(249, 25, 13, 1), + "C8": Color.fromRGBO(254, 0, 3, 1), + "C9": Color.fromRGBO(255, 7, 23, 1), + "C10": Color.fromRGBO(255, 26, 55, 1), + "C11": Color.fromRGBO(255, 35, 70, 1), + "C12": Color.fromRGBO(255, 25, 74, 1), + "C13": Color.fromRGBO(255, 21, 90, 1), + "C14": Color.fromRGBO(255, 0, 104, 1), + "C15": Color.fromRGBO(255, 0, 120, 1), + "C16": Color.fromRGBO(255, 1, 136, 1), + "C17": Color.fromRGBO(255, 0, 154, 1), + "C18": Color.fromRGBO(239, 47, 156, 1), + "C19": Color.fromRGBO(220, 60, 158, 1), + "C20": Color.fromRGBO(200, 66, 161, 1), + "C21": Color.fromRGBO(195, 64, 160, 1), + "C22": Color.fromRGBO(179, 64, 157, 1), + "C23": Color.fromRGBO(172, 62, 157, 1), + "C24": Color.fromRGBO(161, 60, 156, 1), + "C25": Color.fromRGBO(152, 62, 158, 1), + "C26": Color.fromRGBO(142, 57, 160, 1), + "C27": Color.fromRGBO(132, 57, 158, 1), + "C28": Color.fromRGBO(124, 56, 157, 1), + "C29": Color.fromRGBO(110, 55, 156, 1), + "C30": Color.fromRGBO(97, 46, 149, 1), + "D1": Color.fromRGBO(213, 128, 1, 1), + "D2": Color.fromRGBO(230, 125, 0, 1), + "D3": Color.fromRGBO(238, 112, 1, 1), + "D4": Color.fromRGBO(248, 114, 3, 1), + "D5": Color.fromRGBO(249, 94, 1, 1), + "D6": Color.fromRGBO(253, 81, 0, 1), + "D7": Color.fromRGBO(255, 83, 0, 1), + "D8": Color.fromRGBO(255, 70, 29, 1), + "D9": Color.fromRGBO(254, 61, 44, 1), + "D10": Color.fromRGBO(255, 71, 73, 1), + "D11": Color.fromRGBO(255, 79, 95, 1), + "D12": Color.fromRGBO(255, 81, 104, 1), + "D13": Color.fromRGBO(255, 73, 111, 1), + "D14": Color.fromRGBO(255, 66, 124, 1), + "D15": Color.fromRGBO(255, 60, 142, 1), + "D16": Color.fromRGBO(255, 59, 157, 1), + "D17": Color.fromRGBO(241, 73, 161, 1), + "D18": Color.fromRGBO(223, 76, 165, 1), + "D19": Color.fromRGBO(205, 88, 169, 1), + "D20": Color.fromRGBO(195, 81, 168, 1), + "D21": Color.fromRGBO(177, 79, 166, 1), + "D22": Color.fromRGBO(167, 72, 162, 1), + "D23": Color.fromRGBO(160, 71, 165, 1), + "D24": Color.fromRGBO(153, 69, 163, 1), + "D25": Color.fromRGBO(140, 65, 160, 1), + "D26": Color.fromRGBO(132, 62, 160, 1), + "D27": Color.fromRGBO(119, 59, 159, 1), + "D28": Color.fromRGBO(110, 54, 155, 1), + "D29": Color.fromRGBO(95, 50, 153, 1), + "D30": Color.fromRGBO(73, 46, 143, 1), + "E1": Color.fromRGBO(247, 152, 0, 1), + "E2": Color.fromRGBO(254, 148, 0, 1), + "E3": Color.fromRGBO(255, 139, 0, 1), + "E4": Color.fromRGBO(255, 133, 3, 1), + "E5": Color.fromRGBO(255, 125, 1, 1), + "E6": Color.fromRGBO(255, 110, 1, 1), + "E7": Color.fromRGBO(254, 110, 39, 1), + "E8": Color.fromRGBO(255, 100, 52, 1), + "E9": Color.fromRGBO(255, 100, 69, 1), + "E10": Color.fromRGBO(254, 111, 97, 1), + "E11": Color.fromRGBO(255, 109, 112, 1), + "E12": Color.fromRGBO(255, 110, 125, 1), + "E13": Color.fromRGBO(254, 109, 138, 1), + "E14": Color.fromRGBO(254, 102, 153, 1), + "E15": Color.fromRGBO(255, 93, 168, 1), + "E16": Color.fromRGBO(249, 103, 176, 1), + "E17": Color.fromRGBO(226, 107, 175, 1), + "E18": Color.fromRGBO(211, 108, 177, 1), + "E19": Color.fromRGBO(200, 109, 178, 1), + "E20": Color.fromRGBO(183, 99, 174, 1), + "E21": Color.fromRGBO(168, 91, 171, 1), + "E22": Color.fromRGBO(157, 85, 171, 1), + "E23": Color.fromRGBO(148, 82, 169, 1), + "E24": Color.fromRGBO(141, 79, 165, 1), + "E25": Color.fromRGBO(130, 69, 162, 1), + "E26": Color.fromRGBO(118, 68, 163, 1), + "E27": Color.fromRGBO(105, 61, 158, 1), + "E28": Color.fromRGBO(95, 50, 151, 1), + "E29": Color.fromRGBO(79, 42, 156, 1), + "E30": Color.fromRGBO(54, 43, 135, 1), + "F1": Color.fromRGBO(254, 177, 1, 1), + "F2": Color.fromRGBO(255, 173, 1, 1), + "F3": Color.fromRGBO(255, 166, 0, 1), + "F4": Color.fromRGBO(251, 171, 0, 1), + "F5": Color.fromRGBO(254, 160, 24, 1), + "F6": Color.fromRGBO(255, 159, 49, 1), + "F7": Color.fromRGBO(254, 146, 71, 1), + "F8": Color.fromRGBO(255, 136, 80, 1), + "F9": Color.fromRGBO(255, 130, 90, 1), + "F10": Color.fromRGBO(255, 129, 110, 1), + "F11": Color.fromRGBO(254, 136, 122, 1), + "F12": Color.fromRGBO(254, 138, 139, 1), + "F13": Color.fromRGBO(254, 135, 154, 1), + "F14": Color.fromRGBO(255, 134, 165, 1), + "F15": Color.fromRGBO(255, 129, 182, 1), + "F16": Color.fromRGBO(239, 136, 189, 1), + "F17": Color.fromRGBO(221, 136, 193, 1), + "F18": Color.fromRGBO(208, 137, 193, 1), + "F19": Color.fromRGBO(196, 128, 189, 1), + "F20": Color.fromRGBO(180, 119, 186, 1), + "F21": Color.fromRGBO(165, 115, 186, 1), + "F22": Color.fromRGBO(152, 101, 178, 1), + "F23": Color.fromRGBO(138, 93, 174, 1), + "F24": Color.fromRGBO(130, 88, 172, 1), + "F25": Color.fromRGBO(119, 79, 168, 1), + "F26": Color.fromRGBO(105, 75, 165, 1), + "F27": Color.fromRGBO(95, 66, 158, 1), + "F28": Color.fromRGBO(79, 51, 154, 1), + "F29": Color.fromRGBO(61, 46, 149, 1), + "F30": Color.fromRGBO(46, 41, 125, 1), + "G1": Color.fromRGBO(254, 189, 0, 1), + "G2": Color.fromRGBO(254, 189, 1, 1), + "G3": Color.fromRGBO(255, 180, 0, 1), + "G4": Color.fromRGBO(250, 180, 0, 1), + "G5": Color.fromRGBO(255, 183, 75, 1), + "G6": Color.fromRGBO(255, 168, 63, 1), + "G7": Color.fromRGBO(254, 167, 87, 1), + "G8": Color.fromRGBO(254, 158, 98, 1), + "G9": Color.fromRGBO(255, 157, 110, 1), + "G10": Color.fromRGBO(255, 156, 127, 1), + "G11": Color.fromRGBO(255, 154, 146, 1), + "G12": Color.fromRGBO(255, 153, 151, 1), + "G13": Color.fromRGBO(255, 153, 166, 1), + "G14": Color.fromRGBO(255, 150, 170, 1), + "G15": Color.fromRGBO(255, 152, 199, 1), + "G16": Color.fromRGBO(237, 162, 203, 1), + "G17": Color.fromRGBO(218, 165, 207, 1), + "G18": Color.fromRGBO(211, 172, 216, 1), + "G19": Color.fromRGBO(190, 149, 205, 1), + "G20": Color.fromRGBO(174, 138, 199, 1), + "G21": Color.fromRGBO(159, 130, 194, 1), + "G22": Color.fromRGBO(141, 118, 186, 1), + "G23": Color.fromRGBO(129, 109, 180, 1), + "G24": Color.fromRGBO(118, 101, 179, 1), + "G25": Color.fromRGBO(105, 94, 173, 1), + "G26": Color.fromRGBO(89, 85, 170, 1), + "G27": Color.fromRGBO(81, 75, 163, 1), + "G28": Color.fromRGBO(70, 66, 163, 1), + "G29": Color.fromRGBO(50, 55, 155, 1), + "G30": Color.fromRGBO(42, 47, 139, 1), + "H1": Color.fromRGBO(255, 205, 2, 1), + "H2": Color.fromRGBO(255, 204, 0, 1), + "H3": Color.fromRGBO(255, 197, 1, 1), + "H4": Color.fromRGBO(255, 196, 4, 1), + "H5": Color.fromRGBO(255, 196, 32, 1), + "H6": Color.fromRGBO(255, 188, 63, 1), + "H7": Color.fromRGBO(253, 186, 73, 1), + "H8": Color.fromRGBO(255, 182, 93, 1), + "H9": Color.fromRGBO(255, 175, 112, 1), + "H10": Color.fromRGBO(255, 171, 122, 1), + "H11": Color.fromRGBO(255, 171, 137, 1), + "H12": Color.fromRGBO(255, 176, 157, 1), + "H13": Color.fromRGBO(254, 180, 171, 1), + "H14": Color.fromRGBO(252, 181, 179, 1), + "H15": Color.fromRGBO(247, 179, 200, 1), + "H16": Color.fromRGBO(223, 181, 217, 1), + "H17": Color.fromRGBO(210, 183, 218, 1), + "H18": Color.fromRGBO(206, 189, 221, 1), + "H19": Color.fromRGBO(183, 170, 214, 1), + "H20": Color.fromRGBO(165, 162, 207, 1), + "H21": Color.fromRGBO(154, 149, 205, 1), + "H22": Color.fromRGBO(131, 137, 199, 1), + "H23": Color.fromRGBO(116, 126, 195, 1), + "H24": Color.fromRGBO(104, 118, 191, 1), + "H25": Color.fromRGBO(90, 108, 180, 1), + "H26": Color.fromRGBO(77, 100, 180, 1), + "H27": Color.fromRGBO(68, 90, 175, 1), + "H28": Color.fromRGBO(59, 80, 169, 1), + "H29": Color.fromRGBO(40, 70, 160, 1), + "H30": Color.fromRGBO(30, 60, 158, 1), + "I1": Color.fromRGBO(254, 225, 1, 1), + "I2": Color.fromRGBO(254, 220, 0, 1), + "I3": Color.fromRGBO(255, 216, 1, 1), + "I4": Color.fromRGBO(252, 216, 0, 1), + "I5": Color.fromRGBO(255, 222, 5, 1), + "I6": Color.fromRGBO(254, 214, 54, 1), + "I7": Color.fromRGBO(254, 216, 69, 1), + "I8": Color.fromRGBO(255, 212, 82, 1), + "I9": Color.fromRGBO(251, 219, 108, 1), + "I10": Color.fromRGBO(241, 226, 133, 1), + "I11": Color.fromRGBO(239, 221, 149, 1), + "I12": Color.fromRGBO(233, 226, 174, 1), + "I13": Color.fromRGBO(227, 224, 193, 1), + "I14": Color.fromRGBO(220, 225, 202, 1), + "I15": Color.fromRGBO(208, 226, 210, 1), + "I16": Color.fromRGBO(192, 223, 228, 1), + "I17": Color.fromRGBO(188, 218, 244, 1), + "I18": Color.fromRGBO(187, 217, 243, 1), + "I19": Color.fromRGBO(158, 203, 236, 1), + "I20": Color.fromRGBO(144, 187, 229, 1), + "I21": Color.fromRGBO(130, 172, 222, 1), + "I22": Color.fromRGBO(112, 162, 221, 1), + "I23": Color.fromRGBO(105, 146, 210, 1), + "I24": Color.fromRGBO(94, 135, 201, 1), + "I25": Color.fromRGBO(76, 123, 191, 1), + "I26": Color.fromRGBO(68, 110, 186, 1), + "I27": Color.fromRGBO(57, 99, 181, 1), + "I28": Color.fromRGBO(48, 93, 178, 1), + "I29": Color.fromRGBO(43, 80, 169, 1), + "I30": Color.fromRGBO(31, 72, 164, 1), + "J1": Color.fromRGBO(252, 236, 1, 1), + "J2": Color.fromRGBO(253, 235, 1, 1), + "J3": Color.fromRGBO(254, 234, 0, 1), + "J4": Color.fromRGBO(255, 236, 0, 1), + "J5": Color.fromRGBO(252, 239, 0, 1), + "J6": Color.fromRGBO(251, 243, 48, 1), + "J7": Color.fromRGBO(250, 240, 80, 1), + "J8": Color.fromRGBO(240, 239, 112, 1), + "J9": Color.fromRGBO(230, 236, 126, 1), + "J10": Color.fromRGBO(221, 233, 147, 1), + "J11": Color.fromRGBO(213, 232, 166, 1), + "J12": Color.fromRGBO(207, 233, 186, 1), + "J13": Color.fromRGBO(206, 233, 202, 1), + "J14": Color.fromRGBO(199, 235, 209, 1), + "J15": Color.fromRGBO(193, 232, 214, 1), + "J16": Color.fromRGBO(176, 232, 231, 1), + "J17": Color.fromRGBO(164, 230, 244, 1), + "J18": Color.fromRGBO(164, 229, 249, 1), + "J19": Color.fromRGBO(139, 223, 249, 1), + "J20": Color.fromRGBO(107, 216, 255, 1), + "J21": Color.fromRGBO(98, 201, 242, 1), + "J22": Color.fromRGBO(89, 183, 234, 1), + "J23": Color.fromRGBO(76, 172, 222, 1), + "J24": Color.fromRGBO(72, 154, 214, 1), + "J25": Color.fromRGBO(58, 141, 207, 1), + "J26": Color.fromRGBO(59, 126, 197, 1), + "J27": Color.fromRGBO(44, 113, 191, 1), + "J28": Color.fromRGBO(35, 104, 182, 1), + "J29": Color.fromRGBO(42, 92, 177, 1), + "J30": Color.fromRGBO(36, 82, 168, 1), + "K1": Color.fromRGBO(249, 240, 0, 1), + "K2": Color.fromRGBO(249, 240, 1, 1), + "K3": Color.fromRGBO(248, 239, 0, 1), + "K4": Color.fromRGBO(249, 237, 3, 1), + "K5": Color.fromRGBO(244, 236, 47, 1), + "K6": Color.fromRGBO(236, 237, 74, 1), + "K7": Color.fromRGBO(231, 234, 105, 1), + "K8": Color.fromRGBO(222, 230, 118, 1), + "K9": Color.fromRGBO(212, 229, 117, 1), + "K10": Color.fromRGBO(198, 223, 132, 1), + "K11": Color.fromRGBO(182, 223, 144, 1), + "K12": Color.fromRGBO(171, 219, 157, 1), + "K13": Color.fromRGBO(170, 220, 169, 1), + "K14": Color.fromRGBO(167, 220, 178, 1), + "K15": Color.fromRGBO(162, 221, 191, 1), + "K16": Color.fromRGBO(165, 222, 215, 1), + "K17": Color.fromRGBO(158, 222, 222, 1), + "K18": Color.fromRGBO(153, 224, 228, 1), + "K19": Color.fromRGBO(131, 219, 233, 1), + "K20": Color.fromRGBO(109, 217, 243, 1), + "K21": Color.fromRGBO(71, 213, 249, 1), + "K22": Color.fromRGBO(40, 205, 250, 1), + "K23": Color.fromRGBO(45, 192, 236, 1), + "K24": Color.fromRGBO(52, 173, 226, 1), + "K25": Color.fromRGBO(47, 160, 220, 1), + "K26": Color.fromRGBO(45, 140, 208, 1), + "K27": Color.fromRGBO(33, 127, 199, 1), + "K28": Color.fromRGBO(36, 116, 187, 1), + "K29": Color.fromRGBO(34, 103, 181, 1), + "K30": Color.fromRGBO(34, 95, 178, 1), + "L1": Color.fromRGBO(244, 237, 1, 1), + "L2": Color.fromRGBO(242, 235, 0, 1), + "L3": Color.fromRGBO(235, 233, 0, 1), + "L4": Color.fromRGBO(234, 233, 1, 1), + "L5": Color.fromRGBO(229, 231, 0, 1), + "L6": Color.fromRGBO(219, 229, 36, 1), + "L7": Color.fromRGBO(209, 224, 71, 1), + "L8": Color.fromRGBO(186, 219, 86, 1), + "L9": Color.fromRGBO(168, 217, 89, 1), + "L10": Color.fromRGBO(157, 214, 107, 1), + "L11": Color.fromRGBO(146, 212, 115, 1), + "L12": Color.fromRGBO(136, 211, 129, 1), + "L13": Color.fromRGBO(126, 210, 148, 1), + "L14": Color.fromRGBO(122, 207, 152, 1), + "L15": Color.fromRGBO(121, 210, 166, 1), + "L16": Color.fromRGBO(120, 209, 177, 1), + "L17": Color.fromRGBO(122, 211, 191, 1), + "L18": Color.fromRGBO(116, 212, 200, 1), + "L19": Color.fromRGBO(101, 212, 205, 1), + "L20": Color.fromRGBO(91, 209, 213, 1), + "L21": Color.fromRGBO(58, 206, 220, 1), + "L22": Color.fromRGBO(0, 205, 226, 1), + "L23": Color.fromRGBO(3, 201, 246, 1), + "L24": Color.fromRGBO(0, 190, 242, 1), + "L25": Color.fromRGBO(0, 172, 232, 1), + "L26": Color.fromRGBO(2, 156, 218, 1), + "L27": Color.fromRGBO(25, 138, 208, 1), + "L28": Color.fromRGBO(21, 121, 196, 1), + "L29": Color.fromRGBO(37, 115, 190, 1), + "L30": Color.fromRGBO(30, 102, 184, 1), + "M1": Color.fromRGBO(226, 227, 1, 1), + "M2": Color.fromRGBO(218, 226, 1, 1), + "M3": Color.fromRGBO(211, 226, 1, 1), + "M4": Color.fromRGBO(203, 223, 1, 1), + "M5": Color.fromRGBO(198, 219, 0, 1), + "M6": Color.fromRGBO(180, 215, 11, 1), + "M7": Color.fromRGBO(168, 212, 41, 1), + "M8": Color.fromRGBO(148, 208, 52, 1), + "M9": Color.fromRGBO(126, 202, 67, 1), + "M10": Color.fromRGBO(112, 200, 78, 1), + "M11": Color.fromRGBO(96, 199, 92, 1), + "M12": Color.fromRGBO(81, 199, 103, 1), + "M13": Color.fromRGBO(78, 197, 117, 1), + "M14": Color.fromRGBO(77, 197, 126, 1), + "M15": Color.fromRGBO(76, 199, 136, 1), + "M16": Color.fromRGBO(78, 200, 143, 1), + "M17": Color.fromRGBO(78, 199, 156, 1), + "M18": Color.fromRGBO(81, 203, 164, 1), + "M19": Color.fromRGBO(85, 203, 169, 1), + "M20": Color.fromRGBO(63, 202, 181, 1), + "M21": Color.fromRGBO(35, 200, 186, 1), + "M22": Color.fromRGBO(0, 198, 197, 1), + "M23": Color.fromRGBO(3, 196, 211, 1), + "M24": Color.fromRGBO(0, 197, 224, 1), + "M25": Color.fromRGBO(0, 190, 234, 1), + "M26": Color.fromRGBO(0, 174, 234, 1), + "M27": Color.fromRGBO(0, 160, 222, 1), + "M28": Color.fromRGBO(0, 142, 210, 1), + "M29": Color.fromRGBO(1, 129, 200, 1), + "M30": Color.fromRGBO(0, 116, 189, 1), + "N1": Color.fromRGBO(191, 218, 1, 1), + "N2": Color.fromRGBO(182, 215, 0, 1), + "N3": Color.fromRGBO(172, 212, 1, 1), + "N4": Color.fromRGBO(159, 207, 1, 1), + "N5": Color.fromRGBO(147, 206, 0, 1), + "N6": Color.fromRGBO(133, 205, 1, 1), + "N7": Color.fromRGBO(109, 197, 27, 1), + "N8": Color.fromRGBO(93, 196, 29, 1), + "N9": Color.fromRGBO(77, 191, 41, 1), + "N10": Color.fromRGBO(47, 185, 46, 1), + "N11": Color.fromRGBO(23, 184, 55, 1), + "N12": Color.fromRGBO(0, 181, 71, 1), + "N13": Color.fromRGBO(0, 186, 75, 1), + "N14": Color.fromRGBO(0, 187, 98, 1), + "N15": Color.fromRGBO(0, 191, 108, 1), + "N16": Color.fromRGBO(12, 193, 112, 1), + "N17": Color.fromRGBO(27, 191, 120, 1), + "N18": Color.fromRGBO(29, 195, 133, 1), + "N19": Color.fromRGBO(40, 196, 135, 1), + "N20": Color.fromRGBO(47, 194, 140, 1), + "N21": Color.fromRGBO(25, 195, 156, 1), + "N22": Color.fromRGBO(0, 198, 171, 1), + "N23": Color.fromRGBO(3, 196, 177, 1), + "N24": Color.fromRGBO(0, 195, 197, 1), + "N25": Color.fromRGBO(0, 195, 209, 1), + "N26": Color.fromRGBO(0, 189, 221, 1), + "N27": Color.fromRGBO(0, 177, 227, 1), + "N28": Color.fromRGBO(1, 170, 227, 1), + "N29": Color.fromRGBO(0, 154, 216, 1), + "N30": Color.fromRGBO(1, 135, 206, 1), + "O1": Color.fromRGBO(149, 197, 1, 1), + "O2": Color.fromRGBO(142, 198, 1, 1), + "O3": Color.fromRGBO(134, 197, 4, 1), + "O4": Color.fromRGBO(121, 194, 29, 1), + "O5": Color.fromRGBO(107, 191, 33, 1), + "O6": Color.fromRGBO(81, 182, 42, 1), + "O7": Color.fromRGBO(69, 179, 44, 1), + "O8": Color.fromRGBO(40, 172, 53, 1), + "O9": Color.fromRGBO(28, 170, 52, 1), + "O10": Color.fromRGBO(3, 160, 53, 1), + "O11": Color.fromRGBO(0, 161, 58, 1), + "O12": Color.fromRGBO(3, 167, 55, 1), + "O13": Color.fromRGBO(1, 172, 58, 1), + "O14": Color.fromRGBO(2, 180, 56, 1), + "O15": Color.fromRGBO(2, 183, 68, 1), + "O16": Color.fromRGBO(3, 186, 82, 1), + "O17": Color.fromRGBO(2, 188, 89, 1), + "O18": Color.fromRGBO(0, 190, 104, 1), + "O19": Color.fromRGBO(2, 189, 110, 1), + "O20": Color.fromRGBO(2, 190, 113, 1), + "O21": Color.fromRGBO(0, 193, 128, 1), + "O22": Color.fromRGBO(3, 191, 141, 1), + "O23": Color.fromRGBO(3, 193, 157, 1), + "O24": Color.fromRGBO(3, 191, 167, 1), + "O25": Color.fromRGBO(1, 192, 185, 1), + "O26": Color.fromRGBO(3, 195, 200, 1), + "O27": Color.fromRGBO(1, 193, 214, 1), + "O28": Color.fromRGBO(3, 182, 215, 1), + "O29": Color.fromRGBO(1, 173, 221, 1), + "O30": Color.fromRGBO(4, 162, 227, 1), + "P1": Color.fromRGBO(112, 167, 40, 1), + "P2": Color.fromRGBO(100, 172, 36, 1), + "P3": Color.fromRGBO(92, 170, 50, 1), + "P4": Color.fromRGBO(80, 165, 46, 1), + "P5": Color.fromRGBO(57, 167, 52, 1), + "P6": Color.fromRGBO(29, 162, 55, 1), + "P7": Color.fromRGBO(0, 154, 56, 1), + "P8": Color.fromRGBO(0, 153, 57, 1), + "P9": Color.fromRGBO(0, 149, 59, 1), + "P10": Color.fromRGBO(1, 139, 61, 1), + "P11": Color.fromRGBO(0, 144, 59, 1), + "P12": Color.fromRGBO(0, 148, 56, 1), + "P13": Color.fromRGBO(0, 158, 58, 1), + "P14": Color.fromRGBO(0, 165, 61, 1), + "P15": Color.fromRGBO(0, 174, 61, 1), + "P16": Color.fromRGBO(0, 181, 60, 1), + "P17": Color.fromRGBO(0, 183, 59, 1), + "P18": Color.fromRGBO(0, 184, 72, 1), + "P19": Color.fromRGBO(0, 185, 84, 1), + "P20": Color.fromRGBO(3, 186, 93, 1), + "P21": Color.fromRGBO(0, 188, 104, 1), + "P22": Color.fromRGBO(0, 190, 120, 1), + "P23": Color.fromRGBO(2, 189, 136, 1), + "P24": Color.fromRGBO(0, 187, 152, 1), + "P25": Color.fromRGBO(0, 191, 160, 1), + "P26": Color.fromRGBO(0, 191, 175, 1), + "P27": Color.fromRGBO(0, 191, 192, 1), + "P28": Color.fromRGBO(1, 192, 202, 1), + "P29": Color.fromRGBO(0, 187, 218, 1), + "P30": Color.fromRGBO(0, 182, 232, 1), }; + +final labelColorForComputedLightness = pallete.map( + (key, value) => MapEntry( + key, + ThemeData.estimateBrightnessForColor(pallete[key]!) == Brightness.light + ? Colors.black + : Colors.white, + ), +); + +const palletteAlphabet = "ABCDEFGHIJKLMNOP"; +const palletteWidth = 30; + +const avatarColors = [ + Color(0xffA3A948), + Color(0xffEDB92E), + Color(0xffF85931), + Color(0xffCE1836), + Color(0xff009989) +]; diff --git a/lib/models/auth_data.dart b/lib/models/auth_data.dart index ae96cdb..bfd236f 100644 --- a/lib/models/auth_data.dart +++ b/lib/models/auth_data.dart @@ -1,6 +1,7 @@ class AuthData { + final String id; final String login; final String password; - const AuthData(this.login, this.password); + const AuthData(this.id, this.login, this.password); } diff --git a/lib/models/settings_item_model.dart b/lib/models/settings_item_model.dart new file mode 100644 index 0000000..8b6d6db --- /dev/null +++ b/lib/models/settings_item_model.dart @@ -0,0 +1,17 @@ +import 'package:flutter/material.dart'; + +class SettingsItemModel { + final IconData icon; + final Color color; + final String title; + final String description; + final VoidCallback? onTap; + + const SettingsItemModel({ + required this.color, + required this.description, + required this.icon, + required this.title, + this.onTap, + }); +} diff --git a/lib/models/user_data.dart b/lib/models/user_data.dart new file mode 100644 index 0000000..00ba629 --- /dev/null +++ b/lib/models/user_data.dart @@ -0,0 +1,6 @@ +class UserData { + final int gamesWon; + final int gamesLost; + + const UserData(this.gamesWon, this.gamesLost); +} diff --git a/lib/ui/pages/auth_page.dart b/lib/ui/pages/auth_page.dart index ad9a643..f4fba09 100644 --- a/lib/ui/pages/auth_page.dart +++ b/lib/ui/pages/auth_page.dart @@ -13,7 +13,11 @@ class AuthPage extends StatefulWidget { } class _AuthPageState extends State { - late io.Socket socket; + static const serverUrl = + kDebugMode ? "http://localhost:9800" : "https://huacu.nuark.xyz"; + io.Socket socket = io.io(serverUrl, { + "transports": ["websocket"], + }); TextEditingController loginController = TextEditingController(); TextEditingController passwordController = TextEditingController(); @@ -22,11 +26,9 @@ class _AuthPageState extends State { void initState() { super.initState(); - const serverUrl = - kDebugMode ? "http://localhost:9800" : "https://huacu.nuark.xyz"; - socket = io.io(serverUrl, { - "transports": ["websocket"], - }); + if (!socket.connected) { + socket.connect(); + } } @override @@ -76,6 +78,7 @@ class _AuthPageState extends State { border: OutlineInputBorder(), labelText: "Password", ), + obscureText: true, ), const SizedBox(height: 16), Row( @@ -110,7 +113,9 @@ class _AuthPageState extends State { message, ); if (ok) { - Get.put(AuthData(loginController.text, passwordController.text)); + Get.put( + AuthData(data[2], loginController.text, passwordController.text), + ); Get.put(socket); Get.offNamed("/home"); } diff --git a/lib/ui/pages/game_page.dart b/lib/ui/pages/game_page.dart index b083893..b08ebf5 100644 --- a/lib/ui/pages/game_page.dart +++ b/lib/ui/pages/game_page.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import 'package:huacu_mobile/game_pallete.dart'; import 'package:huacu_mobile/models/auth_data.dart'; import 'package:huacu_mobile/models/chat_entry.dart'; import 'package:huacu_mobile/models/game.dart'; @@ -31,16 +32,46 @@ class _GamePageState extends State { void initState() { super.initState(); - socket.on("hello", (idky) { - socket.dispose(); - Get.offAllNamed("/auth"); - }); + socket.on("hello", _onHelloEvent); + socket.on("gameStatus", _onGameStatusEvent); + socket.on("leaveGameResponse", _onLeaveGameResponseEvent); + socket.on("chatResponse", _onChatResponseEvent); + if (isGuesser) { + socket.on("guessResponse", _onGuessResponseEvent); + } else { + socket.on("guess", _onGuessEvent); + } - socket.on("gameStatus", (data) { - bool won = data[0]; + chat.listen((data) { + _scrollToEnd(); + _showMessageNotification(data.last); + }); + } + + void _onHelloEvent(dynamic idky) { + socket.dispose(); + Get.offAllNamed("/auth"); + } + + void _onGameStatusEvent(dynamic data) { + bool won = data[0]; + Get.defaultDialog( + title: "Game ended", + middleText: won ? "You won!" : "You lost!", + barrierDismissible: false, + onConfirm: () { + Get.put(authData); + Get.put(socket); + Get.offAllNamed("/home"); + }, + ); + } + + void _onLeaveGameResponseEvent(dynamic data) { + if (data[0] == true && data[1] == 410) { Get.defaultDialog( title: "Game ended", - middleText: won ? "You won!" : "You lost!", + middleText: "Your opponent left the game", barrierDismissible: false, onConfirm: () { Get.put(authData); @@ -48,50 +79,46 @@ class _GamePageState extends State { Get.offAllNamed("/home"); }, ); - }); - - socket.on("leaveGameResponse", (data) { - if (data[0] == true && data[1] == 410) { - Get.defaultDialog( - title: "Game ended", - middleText: "Your opponent left the game", - barrierDismissible: false, - onConfirm: () { - Get.put(authData); - Get.put(socket); - Get.offAllNamed("/home"); - }, - ); - } else { - Get.put(authData); - Get.put(socket); - Get.offAllNamed("/home"); - } - }); - - socket.on("chatResponse", (data) { - bool ok = data[0]; - if (ok) { - chat.add(ChatEntry(data[1]["from"], data[1]["message"])); - } - }); - - if (isGuesser) { - socket.on("guessResponse", _onGuessResponse); } else { - socket.on("guess", (data) { - setState(() { - guessedColors.add(data); - }); - }); + Get.put(authData); + Get.put(socket); + Get.offAllNamed("/home"); } + } - chat.listen((data) { - _scrollToEnd(); - _showMessageNotification(data.last); + void _onChatResponseEvent(dynamic data) { + bool ok = data[0]; + if (ok) { + chat.add(ChatEntry(data[1]["from"], data[1]["message"])); + } + } + + void _onGuessEvent(dynamic data) { + setState(() { + guessedColors.add(data); }); } + void _onGuessResponseEvent(dynamic data) { + bool ok = data[0]; + if (ok) { + Get.snackbar("Success", "Guess sent successfully"); + } else { + Get.snackbar("Error", "Guess failed to send"); + } + } + + @override + void dispose() { + socket.off("hello", _onHelloEvent); + socket.off("gameStatus", _onGameStatusEvent); + socket.off("leaveGameResponse", _onLeaveGameResponseEvent); + socket.off("chatResponse", _onChatResponseEvent); + socket.off("guessResponse", _onGuessResponseEvent); + socket.off("guess", _onGuessEvent); + super.dispose(); + } + @override Widget build(BuildContext context) { final size = MediaQuery.of(context).size; @@ -107,7 +134,7 @@ class _GamePageState extends State { constrained: false, boundaryMargin: const EdgeInsets.all(800), maxScale: 0.8, - minScale: 0.4, + minScale: 0.3, child: isGuesser ? _generateGameField() : _generateStaticField(), ), @@ -196,67 +223,68 @@ class _GamePageState extends State { } Widget _generateGameField() { - const alphabet = "ABCDEFGHIJKLMNOPQRST"; return Container( - width: (alphabet.length + 3) * 100, - height: 1300, + width: (palletteWidth + 2) * 100, + height: (palletteAlphabet.length + 2) * 100, padding: const EdgeInsets.all(10), child: Stack( children: [ - for (int i = 0; i < alphabet.length; i++) - for (int j = 0; j < 10; j++) + for (int i = 0; i < palletteAlphabet.length; i++) + for (int j = 0; j < palletteWidth; j++) Positioned( - left: (i + 1) * 100.0, - top: (j + 1) * 100.0, + left: (j + 1) * 100.0, + top: (i + 1) * 100.0, child: ColorPlate( - plateName: "${alphabet[i]}$j", + plateName: "${palletteAlphabet[i]}${j + 1}", size: 90, onSelected: _onPlateSelected, ), ), // Now I need to generate letters and numbers around field - for (int i = 0; i < alphabet.length; i++) + for (int i = 1; i <= palletteWidth; i++) Positioned( - left: (i + 1) * 100.0, + left: i * 100.0, top: 0, child: Container( width: 90, height: 90, alignment: Alignment.center, - child: Text(alphabet[i], style: const TextStyle(fontSize: 40)), + child: Text("$i", style: const TextStyle(fontSize: 40)), ), ), - for (int i = 0; i < alphabet.length; i++) + for (int i = 1; i <= palletteWidth; i++) Positioned( - left: (i + 1) * 100.0, - top: 1100, + left: i * 100.0, + top: (palletteAlphabet.length + 1) * 100, child: Container( width: 90, height: 90, alignment: Alignment.center, - child: Text(alphabet[i], style: const TextStyle(fontSize: 40)), + child: Text("$i", style: const TextStyle(fontSize: 40)), ), ), - for (int j = 0; j < 10; j++) + for (int i = 0; i < palletteAlphabet.length; i++) Positioned( left: 0, - top: (j + 1) * 100.0, + top: (i + 1) * 100, child: Container( width: 90, height: 90, alignment: Alignment.center, - child: Text("$j", style: const TextStyle(fontSize: 40)), + child: Text(palletteAlphabet[i], + style: const TextStyle(fontSize: 40)), ), ), - for (int j = 0; j < 10; j++) + for (int i = 0; i < palletteAlphabet.length; i++) Positioned( - left: (alphabet.length + 1) * 100, - top: (j + 1) * 100.0, + left: (palletteWidth + 1) * 100, + top: (i + 1) * 100, child: Container( width: 90, height: 90, alignment: Alignment.center, - child: Text("$j", style: const TextStyle(fontSize: 40)), + child: Text(palletteAlphabet[i], + style: const TextStyle(fontSize: 40)), ), ), ], @@ -265,67 +293,68 @@ class _GamePageState extends State { } Widget _generateStaticField() { - const alphabet = "ABCDEFGHIJKLMNOPQRST"; return Container( - width: (alphabet.length + 3) * 100, - height: 1300, + width: (palletteWidth + 2) * 100, + height: (palletteAlphabet.length + 2) * 100, padding: const EdgeInsets.all(10), child: Stack( children: [ - for (int i = 0; i < alphabet.length; i++) - for (int j = 0; j < 10; j++) + for (int i = 0; i < palletteAlphabet.length; i++) + for (int j = 0; j < palletteWidth; j++) Positioned( - left: (i + 1) * 100.0, - top: (j + 1) * 100.0, + left: (j + 1) * 100.0, + top: (i + 1) * 100.0, child: StaticColorPlate( - plateName: "${alphabet[i]}$j", + plateName: "${palletteAlphabet[i]}${j + 1}", size: 90, - marked: guessedColors.contains("${alphabet[i]}$j"), + marked: + guessedColors.contains("${palletteAlphabet[i]}${j + 1}"), ), ), - // Now I need to generate letters and numbers around field - for (int i = 0; i < alphabet.length; i++) + for (int i = 1; i <= palletteWidth; i++) Positioned( - left: (i + 1) * 100.0, + left: i * 100.0, top: 0, child: Container( width: 90, height: 90, alignment: Alignment.center, - child: Text(alphabet[i], style: const TextStyle(fontSize: 40)), + child: Text("$i", style: const TextStyle(fontSize: 40)), ), ), - for (int i = 0; i < alphabet.length; i++) + for (int i = 1; i <= palletteWidth; i++) Positioned( - left: (i + 1) * 100.0, - top: 1100, + left: i * 100.0, + top: (palletteAlphabet.length + 1) * 100, child: Container( width: 90, height: 90, alignment: Alignment.center, - child: Text(alphabet[i], style: const TextStyle(fontSize: 40)), + child: Text("$i", style: const TextStyle(fontSize: 40)), ), ), - for (int j = 0; j < 10; j++) + for (int i = 0; i < palletteAlphabet.length; i++) Positioned( left: 0, - top: (j + 1) * 100.0, + top: (i + 1) * 100, child: Container( width: 90, height: 90, alignment: Alignment.center, - child: Text("$j", style: const TextStyle(fontSize: 40)), + child: Text(palletteAlphabet[i], + style: const TextStyle(fontSize: 40)), ), ), - for (int j = 0; j < 10; j++) + for (int i = 0; i < palletteAlphabet.length; i++) Positioned( - left: (alphabet.length + 1) * 100, - top: (j + 1) * 100.0, + left: (palletteWidth + 1) * 100, + top: (i + 1) * 100, child: Container( width: 90, height: 90, alignment: Alignment.center, - child: Text("$j", style: const TextStyle(fontSize: 40)), + child: Text(palletteAlphabet[i], + style: const TextStyle(fontSize: 40)), ), ), ], @@ -338,15 +367,6 @@ class _GamePageState extends State { socket.emit("guess", [gameInfo.id, name]); } - void _onGuessResponse(dynamic data) { - bool ok = data[0]; - if (ok) { - Get.snackbar("Success", "Guess sent successfully"); - } else { - Get.snackbar("Error", "Guess failed to send"); - } - } - void _openChat() { Get.bottomSheet(BottomSheet( onClosing: () {}, diff --git a/lib/ui/pages/home_page.dart b/lib/ui/pages/home_page.dart index 6d15251..e108aea 100644 --- a/lib/ui/pages/home_page.dart +++ b/lib/ui/pages/home_page.dart @@ -1,10 +1,18 @@ import 'package:flutter/material.dart'; +import 'package:flutter_boring_avatars/flutter_boring_avatars.dart'; import 'package:get/get.dart'; +import 'package:huacu_mobile/game_pallete.dart'; +import 'dart:math'; import 'package:huacu_mobile/models/auth_data.dart'; import 'package:huacu_mobile/models/available_game.dart'; import 'package:huacu_mobile/models/game.dart'; +import 'package:huacu_mobile/models/settings_item_model.dart'; +import 'package:huacu_mobile/models/user_data.dart'; +import 'package:huacu_mobile/ui/widgets/settings.dart'; import 'package:huacu_mobile/ui/widgets/socket_connection_indicator.dart'; +import 'package:huacu_mobile/ui/widgets/user_card.dart'; import 'package:socket_io_client/socket_io_client.dart' as io; +import 'package:styled_widget/styled_widget.dart'; class HomePage extends StatefulWidget { const HomePage({super.key}); @@ -16,6 +24,7 @@ class HomePage extends StatefulWidget { class _HomePageState extends State { final io.Socket socket = Get.find(); final AuthData authData = Get.find(); + UserData userData = const UserData(0, 0); final availableGames = [].obs; @@ -23,67 +32,126 @@ class _HomePageState extends State { void initState() { super.initState(); - socket.on("hello", (idky) { - socket.dispose(); - Get.offAllNamed("/auth"); - }); - - socket.on("update", (update) { - bool ok = update[0]; - if (ok) { - var data = update[1]; - availableGames.value = (data["availableGames"] as List? ?? []) - .map((e) => AvailableGame( - id: e["id"], - opponentName: e["player"], - tries: e["tries"], - neededRole: e["neededRole"], - )) - .toList(growable: false); - } else { - Get.snackbar("Error", "Update failed with message: ${update[1]}"); - } - }); - - socket.on("updateNeeded", (data) { - socket.emit("getUpdate"); - }); - - socket.on("removeGameResponse", (data) => null); - socket.on("createGameResponse", (data) => null); - - socket.on("joinGameResponse", (data) { - bool ok = data[0]; - if (ok) { - socket.off("hello"); - socket.off("update"); - socket.off("updateNeeded"); - socket.off("someoneJoinedGame"); - Get.put(authData); - Get.put(socket); - Get.put(Game( - data[1]["id"], - data[1]["guesser"], - data[1]["suggester"], - data[1]["tries"], - (data[2] as List).map((e) => e.toString()).toSet(), - )); - Get.offNamed("/game"); - } else { - Get.snackbar("Request response", data[1]); - } - }); + socket.on("hello", _onHelloEvent); + socket.on("update", _onUpdateEvent); + socket.on("updateNeeded", _onUpdateNeededEvent); + socket.on("removeGameResponse", _onRemoveGameResponseEvent); + socket.on("createGameResponse", _onCreateGameResponseEvent); + socket.on("getUserDataResponse", _onGetUserDataResponseEvent); + socket.on("joinGameResponse", onJoinGameResponseEvent); + socket.emit("getUserData"); socket.emit("getUpdate"); } + void _onHelloEvent(dynamic idky) { + socket.dispose(); + Get.offAllNamed("/auth"); + } + + void _onUpdateEvent(dynamic update) { + bool ok = update[0]; + if (ok) { + var data = update[1]; + availableGames.value = (data["availableGames"] as List? ?? []) + .map((e) => AvailableGame( + id: e["id"], + opponentName: e["player"], + tries: e["tries"], + neededRole: e["neededRole"], + )) + .toList(growable: false); + } else { + Get.snackbar("Error", "Update failed with message: ${update[1]}"); + } + } + + void _onUpdateNeededEvent(dynamic data) { + socket.emit("getUpdate"); + } + + void _onRemoveGameResponseEvent(dynamic data) {} + + void _onCreateGameResponseEvent(dynamic data) {} + + void _onGetUserDataResponseEvent(dynamic data) { + bool ok = data[0]; + if (ok) { + userData = UserData( + data[1]["client"]["wins"], + data[1]["client"]["losses"], + ); + } else { + Get.snackbar("Error", "Failed to get user data:\n ${data[1]}"); + } + } + + void onJoinGameResponseEvent(dynamic data) { + bool ok = data[0]; + if (ok) { + Get.put(authData); + Get.put(socket); + Get.put(Game( + data[1]["id"], + data[1]["guesser"], + data[1]["suggester"], + data[1]["tries"], + (data[2] as List).map((e) => e.toString()).toSet(), + )); + Get.offNamed("/game"); + } else { + Get.snackbar("Request response", data[1]); + } + } + + @override + void dispose() { + socket.off("hello", _onHelloEvent); + socket.off("update", _onUpdateEvent); + socket.off("updateNeeded", _onUpdateNeededEvent); + socket.off("removeGameResponse", _onRemoveGameResponseEvent); + socket.off("createGameResponse", _onCreateGameResponseEvent); + socket.off("getUserDataResponse", _onGetUserDataResponseEvent); + socket.off("joinGameResponse", onJoinGameResponseEvent); + super.dispose(); + } + @override Widget build(BuildContext context) { final size = MediaQuery.of(context).size; return Scaffold( appBar: AppBar( - title: Obx(() => Text("Available ${availableGames.length} game(s)")), + title: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + const Text("HUACU"), + SocketConnectionIndicator(socket: socket, size: 8), + ], + ), + Obx( + () => Text( + "Available ${availableGames.length} game(s)", + style: const TextStyle(fontSize: 12), + ), + ), + ], + ), + actions: [ + InkResponse( + onTap: _openProfile, + child: BoringAvatars( + name: authData.id, + colors: avatarColors, + type: BoringAvatarsType.beam, + ).paddingAll(8), + ), + ], ), body: SizedBox( width: size.width, @@ -133,26 +201,29 @@ class _HomePageState extends State { availableGames, ), ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: ObxValue( - (data) { - return ElevatedButton( - onPressed: data.firstWhereOrNull( - (g) => g.opponentName == authData.login) == - null - ? _createGame - : null, - child: const Text("Create"), - ); - }, - availableGames, + Padding( + padding: const EdgeInsets.all(16), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: ObxValue( + (data) { + return ElevatedButton( + onPressed: data.firstWhereOrNull((g) => + g.opponentName == authData.login) == + null + ? _createGame + : null, + child: const Text("Create"), + ); + }, + availableGames, + ), ), - ), - ], + ], + ), ), ], ), @@ -163,6 +234,8 @@ class _HomePageState extends State { void _createGame() async { var tries = 20; var role = "guesser"; + var controller = TextEditingController(text: tries.toString()); + final data = await Get.dialog?>( StatefulBuilder(builder: (buildContext, setState) { return AlertDialog( @@ -171,19 +244,57 @@ class _HomePageState extends State { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("Tries: $tries"), - Slider( - value: tries.toDouble(), - label: tries.toString(), - onChanged: (value) { - setState(() { - tries = value.round(); - }); - }, - min: 10, - max: 50, - divisions: 40, - ), + const Text("Tries:"), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: 32, + child: IconButton.outlined( + iconSize: 8, + onPressed: tries <= 10 + ? null + : () { + setState(() { + tries = max(tries - 1, 10); + controller.text = tries.toString(); + }); + }, + icon: const Icon(Icons.remove), + ), + ), + const SizedBox(width: 8), + Expanded( + child: TextField( + controller: controller, + keyboardType: TextInputType.number, + onChanged: (value) { + setState(() { + tries = clamp(int.tryParse(value) ?? 20, 10, 50); + controller.text = tries.toString(); + }); + }, + ), + ), + const SizedBox(width: 8), + SizedBox( + width: 32, + child: IconButton.outlined( + iconSize: 8, + onPressed: tries >= 50 + ? null + : () { + setState(() { + tries = min(tries + 1, 50); + controller.text = tries.toString(); + }); + }, + icon: const Icon(Icons.add), + ), + ), + ], + ).paddingOnly(bottom: 16), const Text("Needed role:"), Row( children: [ @@ -232,14 +343,20 @@ class _HomePageState extends State { })); if (data == null) return; - tries = data["tries"]; - role = data["role"]; + final triesSelected = data["tries"] as int; + final roleSelected = data["role"] as String; - socket.emit("createGame", [tries, role]); + socket.emit("createGame", [triesSelected, roleSelected]); Get.snackbar("Game created", "Game created"); } + int clamp(int value, int min, int max) { + if (value <= min) return min; + if (value >= max) return max; + return value; + } + void _joinGame(String gameId) { socket.emit("joinGame", gameId); } @@ -250,8 +367,8 @@ class _HomePageState extends State { content: const Text("Are you sure you want to delete this game?"), textConfirm: "Delete", onConfirm: () { - socket.emit("removeGame", gameId); Get.back(); + socket.emit("removeGame", gameId); }, textCancel: "Cancel", onCancel: () { @@ -259,4 +376,89 @@ class _HomePageState extends State { }, ); } + + void _onLogoutTap() { + socket.emit("logout"); + } + + void _onAccountDeletedHandler(dynamic data) { + if (data[0]) { + Get.back(); + Get.offAllNamed("/auth"); + } else { + Get.snackbar("Error", "Failed to delete account:\n${data[1]}"); + } + socket.off("deleteAccountResponse", _onAccountDeletedHandler); + } + + void _onDeleteAccountTap() async { + final textEditingController = TextEditingController(); + bool ok = await Get.defaultDialog( + title: "Delete game", + content: [ + const Text( + "Are you sure you want to delete your account? This action is irreversible.", + ), + const Text("Enter your password to confirm:"), + TextField( + controller: textEditingController, + obscureText: true, + ), + ].toColumn( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + ), + textConfirm: "Delete", + onConfirm: () { + Get.back(result: true); + }, + textCancel: "Cancel", + onCancel: () { + Get.back(result: false); + }, + ); + final password = textEditingController.text; + if (!ok || password.isEmpty) return; + + socket.on("deleteAccountResponse", _onAccountDeletedHandler); + socket.emit("deleteAccount", password); + } + + void _openProfile() { + Get.bottomSheet(BottomSheet( + onClosing: () {}, + clipBehavior: Clip.antiAliasWithSaveLayer, + builder: (context) => _buildBottomSheetProfileContent(), + )); + } + + Widget _buildBottomSheetProfileContent() { + page({required Widget child}) => Styled.widget(child: child) + .padding(vertical: 30, horizontal: 20) + .scrollable(); + + return [ + const Text( + 'Your account', + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 32), + ).alignment(Alignment.center).padding(bottom: 20), + UserCard(authData: authData, userData: userData), + Settings(settingsItems: [ + SettingsItemModel( + icon: Icons.logout, + color: Colors.purpleAccent.shade200, + title: "Logout", + description: "We will miss you", + onTap: _onLogoutTap, + ), + SettingsItemModel( + icon: Icons.dangerous, + color: Colors.redAccent, + title: "Delete my account", + description: "Beware - this action is irreversible", + onTap: _onDeleteAccountTap, + ), + ]), + ].toColumn(mainAxisSize: MainAxisSize.min).parent(page); + } } diff --git a/lib/ui/pages/testing_grounds_page.dart b/lib/ui/pages/testing_grounds_page.dart index 89e1930..3f8fd04 100644 --- a/lib/ui/pages/testing_grounds_page.dart +++ b/lib/ui/pages/testing_grounds_page.dart @@ -12,7 +12,7 @@ class TestingGroundsPage extends StatefulWidget { class _TestingGroundsPageState extends State { final availableGames = [].obs; - final AuthData authData = const AuthData("nuark", "123"); //Get.find(); + final AuthData authData = const AuthData("123", "nuark", "123"); @override void initState() { diff --git a/lib/ui/widgets/settings.dart b/lib/ui/widgets/settings.dart new file mode 100644 index 0000000..275fe47 --- /dev/null +++ b/lib/ui/widgets/settings.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; +import 'package:huacu_mobile/models/settings_item_model.dart'; +import 'package:huacu_mobile/ui/widgets/settings_item.dart'; +import 'package:styled_widget/styled_widget.dart'; + +class Settings extends StatelessWidget { + final List settingsItems; + + const Settings({super.key, required this.settingsItems}); + + @override + Widget build(BuildContext context) => settingsItems + .map((settingsItem) => SettingsItem( + icon: settingsItem.icon, + iconBgColor: settingsItem.color, + title: settingsItem.title, + description: settingsItem.description, + onTap: settingsItem.onTap, + )) + .toList() + .toColumn(); +} diff --git a/lib/ui/widgets/settings_item.dart b/lib/ui/widgets/settings_item.dart new file mode 100644 index 0000000..dd6a0b3 --- /dev/null +++ b/lib/ui/widgets/settings_item.dart @@ -0,0 +1,88 @@ +import 'package:flutter/material.dart'; +import 'package:styled_widget/styled_widget.dart'; + +class SettingsItem extends StatefulWidget { + final IconData icon; + final Color iconBgColor; + final String title; + final String description; + final VoidCallback? onTap; + + const SettingsItem({ + super.key, + required this.icon, + required this.iconBgColor, + required this.title, + required this.description, + this.onTap, + }); + + @override + State createState() => _SettingsItemState(); +} + +class _SettingsItemState extends State { + bool pressed = false; + + @override + Widget build(BuildContext context) { + final Widget icon = Icon(widget.icon, size: 20, color: Colors.white) + .padding(all: 12) + .decorated( + color: widget.iconBgColor, + borderRadius: BorderRadius.circular(30), + ) + .padding(left: 15, right: 10); + + final Widget title = Text( + widget.title, + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ).padding(bottom: 5); + + final Widget description = Text( + widget.description, + style: const TextStyle( + color: Colors.white60, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + ); + + return settingsItem( + child: [ + icon, + [ + title, + description, + ].toColumn( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + ), + ].toRow(), + ); + } + + Widget settingsItem({required Widget child}) => Styled.widget(child: child) + .alignment(Alignment.center) + .borderRadius(all: 15) + .ripple() + .backgroundColor(Colors.grey.shade900, animate: true) + .clipRRect(all: 25) // clip ripple + .borderRadius(all: 25, animate: true) + .elevation( + pressed ? 0 : 20, + borderRadius: BorderRadius.circular(25), + shadowColor: const Color(0x30000000), + ) // shadow borderRadius + .constrained(height: 80) + .padding(vertical: 12) // margin + .gestures( + onTapChange: (tapStatus) => setState(() => pressed = tapStatus), + onTap: widget.onTap, + ) + .scale(all: pressed ? 0.95 : 1.0, animate: true) + .animate(const Duration(milliseconds: 150), Curves.easeOut); +} diff --git a/lib/ui/widgets/static_color_plate.dart b/lib/ui/widgets/static_color_plate.dart index c674e5f..27f3c0e 100644 --- a/lib/ui/widgets/static_color_plate.dart +++ b/lib/ui/widgets/static_color_plate.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:huacu_mobile/game_pallete.dart'; +import 'package:styled_widget/styled_widget.dart'; class StaticColorPlate extends StatelessWidget { final String plateName; @@ -26,6 +27,15 @@ class StaticColorPlate extends StatelessWidget { ), borderRadius: BorderRadius.circular(10), ), + alignment: Alignment.center, + child: Text(plateName) + // .textColor( // NOTE: This is much simpler + // pallete[plateName]!.computeLuminance() > 0.5 + // ? Colors.black + // : Colors.white, + // ) + .textColor(labelColorForComputedLightness[plateName]) + .fontSize(24), ); } } diff --git a/lib/ui/widgets/user_card.dart b/lib/ui/widgets/user_card.dart new file mode 100644 index 0000000..7a798fd --- /dev/null +++ b/lib/ui/widgets/user_card.dart @@ -0,0 +1,72 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_boring_avatars/flutter_boring_avatars.dart'; +import 'package:huacu_mobile/game_pallete.dart'; +import 'package:huacu_mobile/models/auth_data.dart'; +import 'package:huacu_mobile/models/user_data.dart'; +import 'package:styled_widget/styled_widget.dart'; + +class UserCard extends StatelessWidget { + final AuthData authData; + final UserData userData; + + const UserCard({Key? key, required this.authData, required this.userData}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return [_buildUserRow(), _buildUserStats()] + .toColumn(mainAxisAlignment: MainAxisAlignment.spaceAround) + .padding(horizontal: 20) + .decorated( + color: Colors.blueAccent.shade400, + borderRadius: BorderRadius.circular(20)) + .elevation( + 5, + shadowColor: Colors.blueAccent.shade400, + borderRadius: BorderRadius.circular(20), + ) + .height(175) + .alignment(Alignment.topCenter); + } + + Widget _buildUserRow() { + return [ + BoringAvatars( + name: authData.id, + colors: avatarColors, + type: BoringAvatarsType.beam, + ).constrained(height: 50, width: 50).padding(right: 10), + [ + Text( + authData.login, + style: const TextStyle( + color: Colors.white, + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ).padding(bottom: 5), + Text( + "Our one of the best player", + style: TextStyle( + color: Colors.white.withOpacity(0.6), + fontSize: 12, + ), + ), + ].toColumn(crossAxisAlignment: CrossAxisAlignment.start), + ].toRow(); + } + + Widget _buildUserStatsItem(String value, String text) => [ + Text(value).fontSize(20).textColor(Colors.white).padding(bottom: 5), + Text(text).textColor(Colors.white.withOpacity(0.6)).fontSize(12), + ].toColumn(); + + Widget _buildUserStats() { + return [ + _buildUserStatsItem(userData.gamesWon.toString(), 'Wins'), + _buildUserStatsItem(userData.gamesLost.toString(), 'Losses'), + ] + .toRow(mainAxisAlignment: MainAxisAlignment.spaceAround) + .padding(vertical: 10); + } +} diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index a2ec33f..7b4d860 100644 --- a/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,68 +1,68 @@ { - "images" : [ + "images": [ { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_16.png", - "scale" : "1x" + "filename": "app_icon_16.png", + "idiom": "mac", + "scale": "1x", + "size": "16x16" }, { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "2x" + "filename": "app_icon_32.png", + "idiom": "mac", + "scale": "2x", + "size": "16x16" }, { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "1x" + "filename": "app_icon_32.png", + "idiom": "mac", + "scale": "1x", + "size": "32x32" }, { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_64.png", - "scale" : "2x" + "filename": "app_icon_64.png", + "idiom": "mac", + "scale": "2x", + "size": "32x32" }, { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_128.png", - "scale" : "1x" + "filename": "app_icon_128.png", + "idiom": "mac", + "scale": "1x", + "size": "128x128" }, { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "2x" + "filename": "app_icon_256.png", + "idiom": "mac", + "scale": "2x", + "size": "128x128" }, { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "1x" + "filename": "app_icon_256.png", + "idiom": "mac", + "scale": "1x", + "size": "256x256" }, { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "2x" + "filename": "app_icon_512.png", + "idiom": "mac", + "scale": "2x", + "size": "256x256" }, { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "1x" + "filename": "app_icon_512.png", + "idiom": "mac", + "scale": "1x", + "size": "512x512" }, { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_1024.png", - "scale" : "2x" + "filename": "app_icon_1024.png", + "idiom": "mac", + "scale": "2x", + "size": "512x512" } ], - "info" : { - "version" : 1, - "author" : "xcode" + "info": { + "author": "icons_launcher", + "version": 1 } -} +} \ No newline at end of file diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png index 82b6f9d..9616f25 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png index 13b35eb..2f70165 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png index 0a3f5fa..52dcd56 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png index bdb5722..c92c2f2 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png index f083318..ded3433 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png index 326c0e7..abea2dd 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png index 2f1632c..473b879 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/pubspec.lock b/pubspec.lock index d24324f..4fb0601 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,22 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + archive: + dependency: transitive + description: + name: archive + sha256: d6347d54a2d8028e0437e3c099f66fdb8ae02c4720c1e7534c9f24c10351f85d + url: "https://pub.dev" + source: hosted + version: "3.3.6" + args: + dependency: transitive + description: + name: args + sha256: "4cab82a83ffef80b262ddedf47a0a8e56ee6fbf7fe21e6e768b02792034dd440" + url: "https://pub.dev" + source: hosted + version: "2.4.0" async: dependency: transitive description: @@ -41,14 +57,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.17.1" - cupertino_icons: - dependency: "direct main" + convert: + dependency: transitive description: - name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "3.1.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + url: "https://pub.dev" + source: hosted + version: "3.0.2" fake_async: dependency: transitive description: @@ -62,6 +86,14 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_boring_avatars: + dependency: "direct main" + description: + name: flutter_boring_avatars + sha256: "6b4a5e913b7b580ef372761c4134167a832c4054b1f409ddd6812b477d4183d7" + url: "https://pub.dev" + source: hosted + version: "1.0.1" flutter_lints: dependency: "direct dev" description: @@ -83,6 +115,22 @@ packages: url: "https://pub.dev" source: hosted version: "4.6.5" + icons_launcher: + dependency: "direct dev" + description: + name: icons_launcher + sha256: f8ccfb80b56856b6eac586980bdd9c14f5ec24fb87127514055445ceb9424f4c + url: "https://pub.dev" + source: hosted + version: "2.1.0" + image: + dependency: transitive + description: + name: image + sha256: "483a389d6ccb292b570c31b3a193779b1b0178e7eb571986d9a49904b6861227" + url: "https://pub.dev" + source: hosted + version: "4.0.15" js: dependency: transitive description: @@ -91,6 +139,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" + lint: + dependency: transitive + description: + name: lint + sha256: "4a539aa34ec5721a2c7574ae2ca0336738ea4adc2a34887d54b7596310b33c85" + url: "https://pub.dev" + source: hosted + version: "1.10.0" lints: dependency: transitive description: @@ -139,6 +195,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.8.3" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: a9346a3fbba7546a28374bdbcd7f54ea48bb47772bf3a7ab4bfaadc40bc8b8c6 + url: "https://pub.dev" + source: hosted + version: "5.3.0" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: db7306cf0249f838d1a24af52b5a5887c5bf7f31d8bb4e827d071dc0939ad346 + url: "https://pub.dev" + source: hosted + version: "3.6.2" sky_engine: dependency: transitive description: flutter @@ -192,6 +264,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + styled_widget: + dependency: "direct main" + description: + name: styled_widget + sha256: "4d439802919b6ccf10d1488798656da8804633b03012682dd1c8ca70a084aa84" + url: "https://pub.dev" + source: hosted + version: "0.4.1" + svg_path_parser: + dependency: transitive + description: + name: svg_path_parser + sha256: c0864f85efd1024e9f667ddcda10601b1199e3980fb07d63701f9b9a047bdab3 + url: "https://pub.dev" + source: hosted + version: "1.1.1" term_glyph: dependency: transitive description: @@ -208,6 +296,22 @@ packages: url: "https://pub.dev" source: hosted version: "0.4.18" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + universal_io: + dependency: transitive + description: + name: universal_io + sha256: "06866290206d196064fd61df4c7aea1ffe9a4e7c4ccaa8fcded42dd41948005d" + url: "https://pub.dev" + source: hosted + version: "2.2.0" vector_math: dependency: transitive description: @@ -216,5 +320,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + xml: + dependency: transitive + description: + name: xml + sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5" + url: "https://pub.dev" + source: hosted + version: "6.2.2" + yaml: + dependency: transitive + description: + name: yaml + sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + url: "https://pub.dev" + source: hosted + version: "3.1.1" sdks: dart: ">=2.19.0 <4.0.0" + flutter: ">=1.17.0" diff --git a/pubspec.yaml b/pubspec.yaml index 20bfac4..beeb423 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,91 +1,59 @@ name: huacu_mobile -description: A new Flutter project. +description: HUACU Game -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: "none" # Remove this line if you wish to publish to pub.dev +publish_to: "none" -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -# In Windows, build-name is used as the major, minor, and patch parts -# of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+1 +version: 1.0.1+2 environment: - sdk: ">=2.18.5 <3.0.0" + sdk: ">=2.18.5 <3.0.0" -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. dependencies: - flutter: - sdk: flutter + flutter: + sdk: flutter - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 - socket_io_client: ^2.0.1 - get: ^4.6.5 + socket_io_client: ^2.0.1 + get: ^4.6.5 + styled_widget: ^0.4.1 + flutter_boring_avatars: ^1.0.1 dev_dependencies: - flutter_test: - sdk: flutter + flutter_test: + sdk: flutter - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. - flutter_lints: ^2.0.0 + flutter_lints: ^2.0.0 + # flutter_app_name: ^0.1.1 + icons_launcher: ^2.1.0 -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec +flutter_app_name: + name: "HUACU" + +icons_launcher: + image_path: "assets/ic_logo_border.png" + platforms: + android: + enable: true + image_path: "assets/ic_logo_border.png" + adaptive_background_image: "assets/ic_background.png" + adaptive_foreground_image: "assets/ic_foreground.png" + adaptive_round_image: "assets/ic_logo_round.png" + adaptive_monochrome_image: "assets/ic_logo_monochrome.png" + ios: + enable: true + image_path: "assets/ic_logo_rectangle.png" + web: + enable: true + image_path: "assets/ic_logo_border.png" + favicon_path: "assets/ic_logo_round.png" + macos: + enable: true + image_path: "assets/ic_logo_border.png" + windows: + enable: true + image_path: "assets/ic_logo_border.png" + linux: + enable: true + image_path: "assets/ic_logo_border.png" -# The following section is specific to Flutter packages. flutter: - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. - uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages + uses-material-design: true diff --git a/snap/gui/app_icon.desktop b/snap/gui/app_icon.desktop new file mode 100644 index 0000000..92a01f6 --- /dev/null +++ b/snap/gui/app_icon.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Flutter Linux App +Comment=Flutter Linux launcher icon +Exec=app_icon +Icon=app_icon.png +Terminal=false +Type=Application +Categories=Entertainment; diff --git a/snap/gui/app_icon.png b/snap/gui/app_icon.png new file mode 100644 index 0000000..c92c2f2 Binary files /dev/null and b/snap/gui/app_icon.png differ diff --git a/web/favicon.png b/web/favicon.png index 8aaa46a..dead63c 100644 Binary files a/web/favicon.png and b/web/favicon.png differ diff --git a/web/icons/Icon-192.png b/web/icons/Icon-192.png index b749bfe..41ac82e 100644 Binary files a/web/icons/Icon-192.png and b/web/icons/Icon-192.png differ diff --git a/web/icons/Icon-512.png b/web/icons/Icon-512.png index 88cfd48..abea2dd 100644 Binary files a/web/icons/Icon-512.png and b/web/icons/Icon-512.png differ diff --git a/web/icons/Icon-maskable-192.png b/web/icons/Icon-maskable-192.png index eb9b4d7..41ac82e 100644 Binary files a/web/icons/Icon-maskable-192.png and b/web/icons/Icon-maskable-192.png differ diff --git a/web/icons/Icon-maskable-512.png b/web/icons/Icon-maskable-512.png index d69c566..abea2dd 100644 Binary files a/web/icons/Icon-maskable-512.png and b/web/icons/Icon-maskable-512.png differ diff --git a/web/index.html b/web/index.html deleted file mode 100644 index 6fe5750..0000000 --- a/web/index.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - huacu_mobile - - - - - - - - - - diff --git a/web/manifest.json b/web/manifest.json deleted file mode 100644 index 080116f..0000000 --- a/web/manifest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "huacu_mobile", - "short_name": "huacu_mobile", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "A new Flutter project.", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "icons/Icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "icons/Icon-512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "icons/Icon-maskable-192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "icons/Icon-maskable-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] -} diff --git a/windows/runner/resources/app_icon.ico b/windows/runner/resources/app_icon.ico index c04e20c..c4e2996 100644 Binary files a/windows/runner/resources/app_icon.ico and b/windows/runner/resources/app_icon.ico differ