├── .gitignore
├── .metadata
├── README.md
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── simplegridlottery
│ │ │ │ └── MainActivity.java
│ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── images
├── gift1.jpg
├── gift2.jpg
└── gift3.jpg
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ └── contents.xcworkspacedata
└── Runner
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── main.m
├── lib
├── main.dart
└── widget
│ ├── simple_lottery_controller.dart
│ └── simple_lottery_widget.dart
├── preview_image
└── simple_grid_lottery.gif
├── pubspec.lock
├── pubspec.yaml
├── test
└── widget_test.dart
└── web
└── index.html
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Web related
34 | lib/generated_plugin_registrant.dart
35 |
36 | # Exceptions to above rules.
37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
38 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 0b8abb4724aa590dd0f429683339b1e045a1594d
8 | channel: unknown
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # simplegridlottery
2 |
3 | 
4 |
5 |
6 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26 |
27 | android {
28 | compileSdkVersion 28
29 |
30 | lintOptions {
31 | disable 'InvalidPackage'
32 | }
33 |
34 | defaultConfig {
35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
36 | applicationId "com.example.simplegridlottery"
37 | minSdkVersion 16
38 | targetSdkVersion 28
39 | versionCode flutterVersionCode.toInteger()
40 | versionName flutterVersionName
41 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
42 | }
43 |
44 | buildTypes {
45 | release {
46 | // TODO: Add your own signing config for the release build.
47 | // Signing with the debug keys for now, so `flutter run --release` works.
48 | signingConfig signingConfigs.debug
49 | }
50 | }
51 | }
52 |
53 | flutter {
54 | source '../..'
55 | }
56 |
57 | dependencies {
58 | testImplementation 'junit:junit:4.12'
59 | androidTestImplementation 'androidx.test:runner:1.1.1'
60 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
61 | }
62 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
12 |
19 |
20 |
21 |
22 |
23 |
24 |
26 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/example/simplegridlottery/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.simplegridlottery;
2 |
3 | import androidx.annotation.NonNull;
4 | import io.flutter.embedding.android.FlutterActivity;
5 | import io.flutter.embedding.engine.FlutterEngine;
6 | import io.flutter.plugins.GeneratedPluginRegistrant;
7 |
8 | public class MainActivity extends FlutterActivity {
9 | @Override
10 | public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
11 | GeneratedPluginRegistrant.registerWith(flutterEngine);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | jcenter()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.5.0'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | google()
15 | jcenter()
16 | }
17 | }
18 |
19 | rootProject.buildDir = '../build'
20 | subprojects {
21 | project.buildDir = "${rootProject.buildDir}/${project.name}"
22 | }
23 | subprojects {
24 | project.evaluationDependsOn(':app')
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/images/gift1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/images/gift1.jpg
--------------------------------------------------------------------------------
/images/gift2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/images/gift2.jpg
--------------------------------------------------------------------------------
/images/gift3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/images/gift3.jpg
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
14 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
15 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
16 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
17 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
18 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
19 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
20 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
21 | /* End PBXBuildFile section */
22 |
23 | /* Begin PBXCopyFilesBuildPhase section */
24 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
25 | isa = PBXCopyFilesBuildPhase;
26 | buildActionMask = 2147483647;
27 | dstPath = "";
28 | dstSubfolderSpec = 10;
29 | files = (
30 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
31 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
32 | );
33 | name = "Embed Frameworks";
34 | runOnlyForDeploymentPostprocessing = 0;
35 | };
36 | /* End PBXCopyFilesBuildPhase section */
37 |
38 | /* Begin PBXFileReference section */
39 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
40 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
41 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
42 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
43 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
44 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
45 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
46 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
47 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
48 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
49 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
50 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
51 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
52 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
53 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
54 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
55 | /* End PBXFileReference section */
56 |
57 | /* Begin PBXFrameworksBuildPhase section */
58 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
59 | isa = PBXFrameworksBuildPhase;
60 | buildActionMask = 2147483647;
61 | files = (
62 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
63 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
64 | );
65 | runOnlyForDeploymentPostprocessing = 0;
66 | };
67 | /* End PBXFrameworksBuildPhase section */
68 |
69 | /* Begin PBXGroup section */
70 | 9740EEB11CF90186004384FC /* Flutter */ = {
71 | isa = PBXGroup;
72 | children = (
73 | 3B80C3931E831B6300D905FE /* App.framework */,
74 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
75 | 9740EEBA1CF902C7004384FC /* Flutter.framework */,
76 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
77 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
78 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
79 | );
80 | name = Flutter;
81 | sourceTree = "";
82 | };
83 | 97C146E51CF9000F007C117D = {
84 | isa = PBXGroup;
85 | children = (
86 | 9740EEB11CF90186004384FC /* Flutter */,
87 | 97C146F01CF9000F007C117D /* Runner */,
88 | 97C146EF1CF9000F007C117D /* Products */,
89 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
90 | );
91 | sourceTree = "";
92 | };
93 | 97C146EF1CF9000F007C117D /* Products */ = {
94 | isa = PBXGroup;
95 | children = (
96 | 97C146EE1CF9000F007C117D /* Runner.app */,
97 | );
98 | name = Products;
99 | sourceTree = "";
100 | };
101 | 97C146F01CF9000F007C117D /* Runner */ = {
102 | isa = PBXGroup;
103 | children = (
104 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
105 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
106 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
107 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
108 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
109 | 97C147021CF9000F007C117D /* Info.plist */,
110 | 97C146F11CF9000F007C117D /* Supporting Files */,
111 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
112 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
113 | );
114 | path = Runner;
115 | sourceTree = "";
116 | };
117 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
118 | isa = PBXGroup;
119 | children = (
120 | 97C146F21CF9000F007C117D /* main.m */,
121 | );
122 | name = "Supporting Files";
123 | sourceTree = "";
124 | };
125 | /* End PBXGroup section */
126 |
127 | /* Begin PBXNativeTarget section */
128 | 97C146ED1CF9000F007C117D /* Runner */ = {
129 | isa = PBXNativeTarget;
130 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
131 | buildPhases = (
132 | 9740EEB61CF901F6004384FC /* Run Script */,
133 | 97C146EA1CF9000F007C117D /* Sources */,
134 | 97C146EB1CF9000F007C117D /* Frameworks */,
135 | 97C146EC1CF9000F007C117D /* Resources */,
136 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
137 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
138 | );
139 | buildRules = (
140 | );
141 | dependencies = (
142 | );
143 | name = Runner;
144 | productName = Runner;
145 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
146 | productType = "com.apple.product-type.application";
147 | };
148 | /* End PBXNativeTarget section */
149 |
150 | /* Begin PBXProject section */
151 | 97C146E61CF9000F007C117D /* Project object */ = {
152 | isa = PBXProject;
153 | attributes = {
154 | LastUpgradeCheck = 1020;
155 | ORGANIZATIONNAME = "The Chromium Authors";
156 | TargetAttributes = {
157 | 97C146ED1CF9000F007C117D = {
158 | CreatedOnToolsVersion = 7.3.1;
159 | };
160 | };
161 | };
162 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
163 | compatibilityVersion = "Xcode 3.2";
164 | developmentRegion = en;
165 | hasScannedForEncodings = 0;
166 | knownRegions = (
167 | en,
168 | Base,
169 | );
170 | mainGroup = 97C146E51CF9000F007C117D;
171 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
172 | projectDirPath = "";
173 | projectRoot = "";
174 | targets = (
175 | 97C146ED1CF9000F007C117D /* Runner */,
176 | );
177 | };
178 | /* End PBXProject section */
179 |
180 | /* Begin PBXResourcesBuildPhase section */
181 | 97C146EC1CF9000F007C117D /* Resources */ = {
182 | isa = PBXResourcesBuildPhase;
183 | buildActionMask = 2147483647;
184 | files = (
185 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
186 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
187 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
188 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
189 | );
190 | runOnlyForDeploymentPostprocessing = 0;
191 | };
192 | /* End PBXResourcesBuildPhase section */
193 |
194 | /* Begin PBXShellScriptBuildPhase section */
195 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
196 | isa = PBXShellScriptBuildPhase;
197 | buildActionMask = 2147483647;
198 | files = (
199 | );
200 | inputPaths = (
201 | );
202 | name = "Thin Binary";
203 | outputPaths = (
204 | );
205 | runOnlyForDeploymentPostprocessing = 0;
206 | shellPath = /bin/sh;
207 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
208 | };
209 | 9740EEB61CF901F6004384FC /* Run Script */ = {
210 | isa = PBXShellScriptBuildPhase;
211 | buildActionMask = 2147483647;
212 | files = (
213 | );
214 | inputPaths = (
215 | );
216 | name = "Run Script";
217 | outputPaths = (
218 | );
219 | runOnlyForDeploymentPostprocessing = 0;
220 | shellPath = /bin/sh;
221 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
222 | };
223 | /* End PBXShellScriptBuildPhase section */
224 |
225 | /* Begin PBXSourcesBuildPhase section */
226 | 97C146EA1CF9000F007C117D /* Sources */ = {
227 | isa = PBXSourcesBuildPhase;
228 | buildActionMask = 2147483647;
229 | files = (
230 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
231 | 97C146F31CF9000F007C117D /* main.m in Sources */,
232 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
233 | );
234 | runOnlyForDeploymentPostprocessing = 0;
235 | };
236 | /* End PBXSourcesBuildPhase section */
237 |
238 | /* Begin PBXVariantGroup section */
239 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
240 | isa = PBXVariantGroup;
241 | children = (
242 | 97C146FB1CF9000F007C117D /* Base */,
243 | );
244 | name = Main.storyboard;
245 | sourceTree = "";
246 | };
247 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
248 | isa = PBXVariantGroup;
249 | children = (
250 | 97C147001CF9000F007C117D /* Base */,
251 | );
252 | name = LaunchScreen.storyboard;
253 | sourceTree = "";
254 | };
255 | /* End PBXVariantGroup section */
256 |
257 | /* Begin XCBuildConfiguration section */
258 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
259 | isa = XCBuildConfiguration;
260 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
261 | buildSettings = {
262 | ALWAYS_SEARCH_USER_PATHS = NO;
263 | CLANG_ANALYZER_NONNULL = YES;
264 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
265 | CLANG_CXX_LIBRARY = "libc++";
266 | CLANG_ENABLE_MODULES = YES;
267 | CLANG_ENABLE_OBJC_ARC = YES;
268 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
269 | CLANG_WARN_BOOL_CONVERSION = YES;
270 | CLANG_WARN_COMMA = YES;
271 | CLANG_WARN_CONSTANT_CONVERSION = YES;
272 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
273 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
274 | CLANG_WARN_EMPTY_BODY = YES;
275 | CLANG_WARN_ENUM_CONVERSION = YES;
276 | CLANG_WARN_INFINITE_RECURSION = YES;
277 | CLANG_WARN_INT_CONVERSION = YES;
278 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
279 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
280 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
282 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
283 | CLANG_WARN_STRICT_PROTOTYPES = YES;
284 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
285 | CLANG_WARN_UNREACHABLE_CODE = YES;
286 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
288 | COPY_PHASE_STRIP = NO;
289 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
290 | ENABLE_NS_ASSERTIONS = NO;
291 | ENABLE_STRICT_OBJC_MSGSEND = YES;
292 | GCC_C_LANGUAGE_STANDARD = gnu99;
293 | GCC_NO_COMMON_BLOCKS = YES;
294 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
295 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
296 | GCC_WARN_UNDECLARED_SELECTOR = YES;
297 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
298 | GCC_WARN_UNUSED_FUNCTION = YES;
299 | GCC_WARN_UNUSED_VARIABLE = YES;
300 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
301 | MTL_ENABLE_DEBUG_INFO = NO;
302 | SDKROOT = iphoneos;
303 | SUPPORTED_PLATFORMS = iphoneos;
304 | TARGETED_DEVICE_FAMILY = "1,2";
305 | VALIDATE_PRODUCT = YES;
306 | };
307 | name = Profile;
308 | };
309 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
310 | isa = XCBuildConfiguration;
311 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
312 | buildSettings = {
313 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
314 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
315 | ENABLE_BITCODE = NO;
316 | FRAMEWORK_SEARCH_PATHS = (
317 | "$(inherited)",
318 | "$(PROJECT_DIR)/Flutter",
319 | );
320 | INFOPLIST_FILE = Runner/Info.plist;
321 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
322 | LIBRARY_SEARCH_PATHS = (
323 | "$(inherited)",
324 | "$(PROJECT_DIR)/Flutter",
325 | );
326 | PRODUCT_BUNDLE_IDENTIFIER = com.example.simplegridlottery;
327 | PRODUCT_NAME = "$(TARGET_NAME)";
328 | VERSIONING_SYSTEM = "apple-generic";
329 | };
330 | name = Profile;
331 | };
332 | 97C147031CF9000F007C117D /* Debug */ = {
333 | isa = XCBuildConfiguration;
334 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
335 | buildSettings = {
336 | ALWAYS_SEARCH_USER_PATHS = NO;
337 | CLANG_ANALYZER_NONNULL = YES;
338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
339 | CLANG_CXX_LIBRARY = "libc++";
340 | CLANG_ENABLE_MODULES = YES;
341 | CLANG_ENABLE_OBJC_ARC = YES;
342 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
343 | CLANG_WARN_BOOL_CONVERSION = YES;
344 | CLANG_WARN_COMMA = YES;
345 | CLANG_WARN_CONSTANT_CONVERSION = YES;
346 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
347 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
348 | CLANG_WARN_EMPTY_BODY = YES;
349 | CLANG_WARN_ENUM_CONVERSION = YES;
350 | CLANG_WARN_INFINITE_RECURSION = YES;
351 | CLANG_WARN_INT_CONVERSION = YES;
352 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
353 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
354 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
355 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
356 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
357 | CLANG_WARN_STRICT_PROTOTYPES = YES;
358 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
359 | CLANG_WARN_UNREACHABLE_CODE = YES;
360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
361 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
362 | COPY_PHASE_STRIP = NO;
363 | DEBUG_INFORMATION_FORMAT = dwarf;
364 | ENABLE_STRICT_OBJC_MSGSEND = YES;
365 | ENABLE_TESTABILITY = YES;
366 | GCC_C_LANGUAGE_STANDARD = gnu99;
367 | GCC_DYNAMIC_NO_PIC = NO;
368 | GCC_NO_COMMON_BLOCKS = YES;
369 | GCC_OPTIMIZATION_LEVEL = 0;
370 | GCC_PREPROCESSOR_DEFINITIONS = (
371 | "DEBUG=1",
372 | "$(inherited)",
373 | );
374 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
375 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
376 | GCC_WARN_UNDECLARED_SELECTOR = YES;
377 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
378 | GCC_WARN_UNUSED_FUNCTION = YES;
379 | GCC_WARN_UNUSED_VARIABLE = YES;
380 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
381 | MTL_ENABLE_DEBUG_INFO = YES;
382 | ONLY_ACTIVE_ARCH = YES;
383 | SDKROOT = iphoneos;
384 | TARGETED_DEVICE_FAMILY = "1,2";
385 | };
386 | name = Debug;
387 | };
388 | 97C147041CF9000F007C117D /* Release */ = {
389 | isa = XCBuildConfiguration;
390 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
391 | buildSettings = {
392 | ALWAYS_SEARCH_USER_PATHS = NO;
393 | CLANG_ANALYZER_NONNULL = YES;
394 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
395 | CLANG_CXX_LIBRARY = "libc++";
396 | CLANG_ENABLE_MODULES = YES;
397 | CLANG_ENABLE_OBJC_ARC = YES;
398 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
399 | CLANG_WARN_BOOL_CONVERSION = YES;
400 | CLANG_WARN_COMMA = YES;
401 | CLANG_WARN_CONSTANT_CONVERSION = YES;
402 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
404 | CLANG_WARN_EMPTY_BODY = YES;
405 | CLANG_WARN_ENUM_CONVERSION = YES;
406 | CLANG_WARN_INFINITE_RECURSION = YES;
407 | CLANG_WARN_INT_CONVERSION = YES;
408 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
409 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
410 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
411 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
412 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
413 | CLANG_WARN_STRICT_PROTOTYPES = YES;
414 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
415 | CLANG_WARN_UNREACHABLE_CODE = YES;
416 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
417 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
418 | COPY_PHASE_STRIP = NO;
419 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
420 | ENABLE_NS_ASSERTIONS = NO;
421 | ENABLE_STRICT_OBJC_MSGSEND = YES;
422 | GCC_C_LANGUAGE_STANDARD = gnu99;
423 | GCC_NO_COMMON_BLOCKS = YES;
424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
426 | GCC_WARN_UNDECLARED_SELECTOR = YES;
427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
428 | GCC_WARN_UNUSED_FUNCTION = YES;
429 | GCC_WARN_UNUSED_VARIABLE = YES;
430 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
431 | MTL_ENABLE_DEBUG_INFO = NO;
432 | SDKROOT = iphoneos;
433 | SUPPORTED_PLATFORMS = iphoneos;
434 | TARGETED_DEVICE_FAMILY = "1,2";
435 | VALIDATE_PRODUCT = YES;
436 | };
437 | name = Release;
438 | };
439 | 97C147061CF9000F007C117D /* Debug */ = {
440 | isa = XCBuildConfiguration;
441 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
442 | buildSettings = {
443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
444 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
445 | ENABLE_BITCODE = NO;
446 | FRAMEWORK_SEARCH_PATHS = (
447 | "$(inherited)",
448 | "$(PROJECT_DIR)/Flutter",
449 | );
450 | INFOPLIST_FILE = Runner/Info.plist;
451 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
452 | LIBRARY_SEARCH_PATHS = (
453 | "$(inherited)",
454 | "$(PROJECT_DIR)/Flutter",
455 | );
456 | PRODUCT_BUNDLE_IDENTIFIER = com.example.simplegridlottery;
457 | PRODUCT_NAME = "$(TARGET_NAME)";
458 | VERSIONING_SYSTEM = "apple-generic";
459 | };
460 | name = Debug;
461 | };
462 | 97C147071CF9000F007C117D /* Release */ = {
463 | isa = XCBuildConfiguration;
464 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
465 | buildSettings = {
466 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
467 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
468 | ENABLE_BITCODE = NO;
469 | FRAMEWORK_SEARCH_PATHS = (
470 | "$(inherited)",
471 | "$(PROJECT_DIR)/Flutter",
472 | );
473 | INFOPLIST_FILE = Runner/Info.plist;
474 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
475 | LIBRARY_SEARCH_PATHS = (
476 | "$(inherited)",
477 | "$(PROJECT_DIR)/Flutter",
478 | );
479 | PRODUCT_BUNDLE_IDENTIFIER = com.example.simplegridlottery;
480 | PRODUCT_NAME = "$(TARGET_NAME)";
481 | VERSIONING_SYSTEM = "apple-generic";
482 | };
483 | name = Release;
484 | };
485 | /* End XCBuildConfiguration section */
486 |
487 | /* Begin XCConfigurationList section */
488 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
489 | isa = XCConfigurationList;
490 | buildConfigurations = (
491 | 97C147031CF9000F007C117D /* Debug */,
492 | 97C147041CF9000F007C117D /* Release */,
493 | 249021D3217E4FDB00AE95B9 /* Profile */,
494 | );
495 | defaultConfigurationIsVisible = 0;
496 | defaultConfigurationName = Release;
497 | };
498 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
499 | isa = XCConfigurationList;
500 | buildConfigurations = (
501 | 97C147061CF9000F007C117D /* Debug */,
502 | 97C147071CF9000F007C117D /* Release */,
503 | 249021D4217E4FDB00AE95B9 /* Profile */,
504 | );
505 | defaultConfigurationIsVisible = 0;
506 | defaultConfigurationName = Release;
507 | };
508 | /* End XCConfigurationList section */
509 | };
510 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
511 | }
512 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 | #import "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application
7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8 | [GeneratedPluginRegistrant registerWithRegistry:self];
9 | // Override point for customization after application launch.
10 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
11 | }
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | simplegridlottery
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/ios/Runner/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char* argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:simplegridlottery/widget/simple_lottery_controller.dart';
3 | import 'package:simplegridlottery/widget/simple_lottery_widget.dart';
4 |
5 | void main() => runApp(MyApp());
6 |
7 | class MyApp extends StatelessWidget {
8 | @override
9 | Widget build(BuildContext context) {
10 | return MaterialApp(
11 | title: 'Flutter Demo',
12 | theme: ThemeData(
13 | primarySwatch: Colors.blue,
14 | ),
15 | home: MyHomePage(title: 'Simple Grid Lottery'),
16 | );
17 | }
18 | }
19 |
20 | class MyHomePage extends StatefulWidget {
21 | MyHomePage({Key? key, required this.title}) : super(key: key);
22 | final String title;
23 |
24 | @override
25 | _MyHomePageState createState() => _MyHomePageState();
26 | }
27 |
28 | class _MyHomePageState extends State {
29 | late SimpleLotteryController simpleLotteryController;
30 | List rewardsList = [];
31 |
32 | @override
33 | void initState() {
34 | rewardsList
35 | ..add("images/gift1.jpg")
36 | ..add("images/gift2.jpg")
37 | ..add("images/gift1.jpg")
38 | ..add("images/gift2.jpg")
39 | ..add("images/gift1.jpg")
40 | ..add("images/gift2.jpg")
41 | ..add("images/gift1.jpg")
42 | ..add("images/gift2.jpg");
43 | simpleLotteryController = SimpleLotteryController(rewardsList: rewardsList);
44 | simpleLotteryController.addListener(() {
45 | if (simpleLotteryController.value.isPlaying) {
46 | } else if (simpleLotteryController.value.isFinish) {}
47 | print(simpleLotteryController.value.toString());
48 | });
49 | super.initState();
50 | }
51 |
52 | @override
53 | Widget build(BuildContext context) {
54 | return Scaffold(
55 | appBar: AppBar(
56 | title: Text(widget.title),
57 | ),
58 | body: Column(
59 | children: [
60 | TextButton(
61 | child: Text("模拟在假抽奖动画过程中加入最后结果"),
62 | onPressed: () {
63 | simpleLotteryController.startFake(
64 | singleRoundFakeDuration: Duration(milliseconds: 1000));
65 | Future.delayed(Duration(seconds: 2)).then((_) {
66 | simpleLotteryController.start(
67 | target: 4,
68 | duration: Duration(milliseconds: 2500),
69 | repeatRound: 2);
70 | });
71 | }),
72 | Center(
73 | child: SimpleLotteryWidget(
74 | controller: simpleLotteryController,
75 | onPress: () {
76 | simpleLotteryController.start(
77 | target: 4,
78 | duration: Duration(milliseconds: 2500),
79 | repeatRound: 2);
80 | },
81 | ),
82 | ),
83 | TextButton(
84 | onPressed: () {
85 | _resetRewardList();
86 | },
87 | child: Text('Reset'))
88 | ],
89 | ),
90 | );
91 | }
92 |
93 | /// 当抽奖结束后,变更抽奖列表
94 | void _resetRewardList() {
95 | setState(() {
96 | rewardsList
97 | ..clear()
98 | ..add("images/gift3.jpg")
99 | ..add("images/gift2.jpg")
100 | ..add("images/gift3.jpg")
101 | ..add("images/gift2.jpg")
102 | ..add("images/gift3.jpg")
103 | ..add("images/gift2.jpg")
104 | ..add("images/gift3.jpg")
105 | ..add("images/gift2.jpg");
106 | simpleLotteryController =
107 | SimpleLotteryController(rewardsList: rewardsList);
108 | });
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/lib/widget/simple_lottery_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 |
3 | class SimpleLotteryValue {
4 | SimpleLotteryValue(
5 | {this.target = 0,
6 | this.isFinish = false,
7 | this.isPlaying = false,
8 | this.isFake = false,
9 | this.isSetTargetDuringFake = false,
10 | this.singleRoundFakeDuration = const Duration(),
11 | this.duration = const Duration(),
12 | this.repeatRound = 1,
13 | required this.rewardsList});
14 |
15 | /// 中奖目标
16 | final int target;
17 |
18 | final bool isPlaying;
19 | final bool isFinish;
20 |
21 | /// 只是进行动画,无抽奖结果
22 | final bool isFake;
23 | final bool isSetTargetDuringFake;
24 |
25 | /// 转动的圈数
26 | final int repeatRound;
27 |
28 | /// 实际抽奖总耗时
29 | final Duration duration;
30 |
31 | /// 奖品列表
32 | final List rewardsList;
33 |
34 | /// 假抽奖单圈耗时
35 | final Duration singleRoundFakeDuration;
36 |
37 | SimpleLotteryValue copyWith(
38 | {int? target,
39 | bool? isPlaying,
40 | bool? isFinish,
41 | bool? isFake,
42 | bool? isSetTargetDuringFake,
43 | int? repeatRound,
44 | Duration? duration,
45 | List? rewardsList,
46 | Duration? singleRoundFakeDuration}) {
47 | return SimpleLotteryValue(
48 | target: target ?? this.target,
49 | isFinish: isFinish ?? this.isFinish,
50 | isPlaying: isPlaying ?? this.isPlaying,
51 | isFake: isFake ?? this.isFake,
52 | isSetTargetDuringFake:
53 | isSetTargetDuringFake ?? this.isSetTargetDuringFake,
54 | repeatRound: repeatRound ?? this.repeatRound,
55 | duration: duration ?? this.duration,
56 | singleRoundFakeDuration:
57 | singleRoundFakeDuration ?? this.singleRoundFakeDuration,
58 | rewardsList: rewardsList ?? this.rewardsList);
59 | }
60 |
61 | @override
62 | String toString() {
63 | return "$runtimeType(target : $target , "
64 | "isPlaying : $isPlaying , "
65 | "isFinish : $isFinish , "
66 | "isFake : $isFake , "
67 | "isSetTargetDuringFake : $isSetTargetDuringFake , "
68 | "repeatRound : $repeatRound)";
69 | }
70 | }
71 |
72 | abstract class IController {
73 | void start({int target, Duration duration, int repeatRound});
74 |
75 | void startFake({Duration singleRoundFakeDuration});
76 |
77 | void finish();
78 | }
79 |
80 | class SimpleLotteryController extends ValueNotifier
81 | implements IController {
82 | SimpleLotteryController({required List rewardsList})
83 | : super(SimpleLotteryValue(rewardsList: rewardsList));
84 |
85 | /// 开启抽奖
86 | ///
87 | /// [target] 中奖目标
88 | @override
89 | void start({int target = 0, Duration? duration, int? repeatRound}) {
90 | // 九宫格抽奖里范围为0~8
91 | assert(target >= 0 && target <= 8);
92 | // 如果是在实际抽奖过程中,则不能多次start
93 | if (value.isPlaying && !value.isFake) {
94 | return;
95 | }
96 | value = value.copyWith(
97 | target: target,
98 | isPlaying: true,
99 | isFake: false,
100 | isSetTargetDuringFake: value.isFake,
101 | duration: duration,
102 | repeatRound: repeatRound);
103 | }
104 |
105 | /// 开启假的抽奖动画
106 | @override
107 | void startFake({Duration? singleRoundFakeDuration}) {
108 | if (value.isPlaying) {
109 | return;
110 | }
111 | value = value.copyWith(
112 | isPlaying: true,
113 | isFake: true,
114 | singleRoundFakeDuration: singleRoundFakeDuration);
115 | }
116 |
117 | @override
118 | void finish() {
119 | value = value.copyWith(
120 | isFinish: true,
121 | isPlaying: false,
122 | isSetTargetDuringFake: false,
123 | isFake: false);
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/lib/widget/simple_lottery_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:simplegridlottery/widget/simple_lottery_controller.dart';
4 |
5 | class SimpleLotteryWidget extends StatefulWidget {
6 | final SimpleLotteryController controller;
7 | final Function? onPress;
8 |
9 | SimpleLotteryWidget({Key? key, required this.controller, this.onPress});
10 |
11 | @override
12 | _SimpleLotteryWidgetState createState() => _SimpleLotteryWidgetState();
13 | }
14 |
15 | class _SimpleLotteryWidgetState extends State
16 | with TickerProviderStateMixin {
17 | late Animation _selectedIndexTween;
18 | late AnimationController _startAnimateController;
19 | int _currentSelect = -1;
20 | final int _totalIndex = 8;
21 |
22 | late VoidCallback _listener;
23 | bool _continueToTarget = false;
24 | late List _rewardsList;
25 |
26 | /// 选中下标的映射
27 | final Map _selectIndexMap = const {
28 | 0: 0,
29 | 1: 3,
30 | 2: 6,
31 | 3: 7,
32 | 4: 8,
33 | 5: 5,
34 | 6: 2,
35 | 7: 1
36 | };
37 |
38 | /// 反向map
39 | final Map _reverseSelectMap = const {
40 | 0: 0,
41 | 3: 1,
42 | 6: 2,
43 | 7: 3,
44 | 8: 4,
45 | 5: 5,
46 | 2: 6,
47 | 1: 7
48 | };
49 |
50 | _SimpleLotteryWidgetState() {
51 | _listener = () {
52 | _continueToTarget = false;
53 | // 开启抽奖动画
54 | if (widget.controller.value.isPlaying) {
55 | // 如果是假的,则只是循环抽奖过程
56 | if (widget.controller.value.isFake) {
57 | _startFakeAnimation();
58 | } // 如果在假装抽奖的过程中,设置了target
59 | else if (widget.controller.value.isSetTargetDuringFake) {
60 | setState(() {
61 | _continueToTarget = true;
62 | });
63 | } // 常规的直接抽奖
64 | else {
65 | _startActualAnimation();
66 | }
67 | }
68 | };
69 | }
70 |
71 | /// 初始化tween
72 | ///
73 | /// [target] 中奖的目标
74 | Animation _initSelectIndexTween(
75 | {int begin = 0, int end = 0, Curve curve = Curves.linear}) =>
76 | StepTween(begin: begin, end: end).animate(
77 | CurvedAnimation(parent: _startAnimateController, curve: curve));
78 |
79 | _startFakeAnimation() {
80 | _selectedIndexTween = _initSelectIndexTween(end: _totalIndex);
81 | _startAnimateController
82 | ..reset()
83 | ..duration = widget.controller.value.singleRoundFakeDuration
84 | ..repeat();
85 | }
86 |
87 | _startActualAnimation() {
88 | _selectedIndexTween = _initSelectIndexTween(
89 | end: widget.controller.value.repeatRound * _totalIndex +
90 | widget.controller.value.target,
91 | curve: Curves.easeOutCubic);
92 | _startAnimateController
93 | ..reset()
94 | ..duration = widget.controller.value.duration
95 | ..forward();
96 | }
97 |
98 | @override
99 | void didUpdateWidget(covariant SimpleLotteryWidget oldWidget) {
100 | if (oldWidget.controller != widget.controller) {
101 | _reset(oldWidget);
102 | }
103 | super.didUpdateWidget(oldWidget);
104 | }
105 |
106 | _reset(SimpleLotteryWidget oldWidget) {
107 | oldWidget.controller.removeListener(_listener);
108 | widget.controller.addListener(_listener);
109 | _rewardsList = widget.controller.value.rewardsList;
110 | _currentSelect = -1;
111 | }
112 |
113 | @override
114 | void initState() {
115 | _startAnimateController = AnimationController(
116 | vsync: this, duration: widget.controller.value.duration);
117 | _selectedIndexTween = _initSelectIndexTween(end: _totalIndex);
118 |
119 | // 动画监听
120 | _startAnimateController.addListener(() {
121 | // 更新选中的下标
122 | _currentSelect =
123 | _selectIndexMap[_selectedIndexTween.value % _totalIndex]!;
124 |
125 | // 在假的抽奖过程到0位置时, 开启真的抽奖, 主要是起到无缝衔接
126 | if (_continueToTarget && _currentSelect == 0) {
127 | _continueToTarget = false;
128 | _startActualAnimation();
129 | }
130 | if (_startAnimateController.isCompleted) {
131 | widget.controller.finish();
132 | }
133 | setState(() {});
134 | });
135 |
136 | // 控制监听
137 | widget.controller.addListener(_listener);
138 | _rewardsList = widget.controller.value.rewardsList;
139 | super.initState();
140 | }
141 |
142 | @override
143 | void deactivate() {
144 | widget.controller.removeListener(_listener);
145 | super.deactivate();
146 | }
147 |
148 | @override
149 | void dispose() {
150 | _startAnimateController.dispose();
151 | super.dispose();
152 | }
153 |
154 | @override
155 | Widget build(BuildContext context) {
156 | return Container(
157 | width: 220,
158 | height: 220,
159 | child: GridView.builder(
160 | itemCount: 9,
161 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
162 | crossAxisCount: 3, crossAxisSpacing: 4, mainAxisSpacing: 4),
163 | itemBuilder: (context, index) {
164 | if (index != 4) {
165 | return Container(
166 | child: Stack(
167 | alignment: Alignment.center,
168 | children: [
169 | Image.asset(_rewardsList[_reverseSelectMap[index]!]),
170 | Container(
171 | width: 50,
172 | height: 50,
173 | color: index == _currentSelect
174 | ? Colors.blue.withOpacity(0.5)
175 | : Colors.amber.withOpacity(0.5),
176 | ),
177 | ],
178 | ),
179 | );
180 | }
181 | return GestureDetector(
182 | onTap: () {
183 | widget.onPress?.call();
184 | },
185 | child: Container(
186 | color: Colors.red,
187 | ),
188 | );
189 | }));
190 | }
191 | }
192 |
--------------------------------------------------------------------------------
/preview_image/simple_grid_lottery.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JDChi/Flutter-Grid-Lottery/f5d432cd81101dbcb762d5251015fcd76acc5e7a/preview_image/simple_grid_lottery.gif
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | url: "https://pub.flutter-io.cn"
9 | source: hosted
10 | version: "2.8.2"
11 | boolean_selector:
12 | dependency: transitive
13 | description:
14 | name: boolean_selector
15 | url: "https://pub.flutter-io.cn"
16 | source: hosted
17 | version: "2.1.0"
18 | characters:
19 | dependency: transitive
20 | description:
21 | name: characters
22 | url: "https://pub.flutter-io.cn"
23 | source: hosted
24 | version: "1.2.0"
25 | charcode:
26 | dependency: transitive
27 | description:
28 | name: charcode
29 | url: "https://pub.flutter-io.cn"
30 | source: hosted
31 | version: "1.3.1"
32 | clock:
33 | dependency: transitive
34 | description:
35 | name: clock
36 | url: "https://pub.flutter-io.cn"
37 | source: hosted
38 | version: "1.1.0"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.flutter-io.cn"
44 | source: hosted
45 | version: "1.15.0"
46 | cupertino_icons:
47 | dependency: "direct main"
48 | description:
49 | name: cupertino_icons
50 | url: "https://pub.flutter-io.cn"
51 | source: hosted
52 | version: "0.1.3"
53 | fake_async:
54 | dependency: transitive
55 | description:
56 | name: fake_async
57 | url: "https://pub.flutter-io.cn"
58 | source: hosted
59 | version: "1.2.0"
60 | flutter:
61 | dependency: "direct main"
62 | description: flutter
63 | source: sdk
64 | version: "0.0.0"
65 | flutter_test:
66 | dependency: "direct dev"
67 | description: flutter
68 | source: sdk
69 | version: "0.0.0"
70 | matcher:
71 | dependency: transitive
72 | description:
73 | name: matcher
74 | url: "https://pub.flutter-io.cn"
75 | source: hosted
76 | version: "0.12.11"
77 | meta:
78 | dependency: transitive
79 | description:
80 | name: meta
81 | url: "https://pub.flutter-io.cn"
82 | source: hosted
83 | version: "1.7.0"
84 | path:
85 | dependency: transitive
86 | description:
87 | name: path
88 | url: "https://pub.flutter-io.cn"
89 | source: hosted
90 | version: "1.8.0"
91 | sky_engine:
92 | dependency: transitive
93 | description: flutter
94 | source: sdk
95 | version: "0.0.99"
96 | source_span:
97 | dependency: transitive
98 | description:
99 | name: source_span
100 | url: "https://pub.flutter-io.cn"
101 | source: hosted
102 | version: "1.8.1"
103 | stack_trace:
104 | dependency: transitive
105 | description:
106 | name: stack_trace
107 | url: "https://pub.flutter-io.cn"
108 | source: hosted
109 | version: "1.10.0"
110 | stream_channel:
111 | dependency: transitive
112 | description:
113 | name: stream_channel
114 | url: "https://pub.flutter-io.cn"
115 | source: hosted
116 | version: "2.1.0"
117 | string_scanner:
118 | dependency: transitive
119 | description:
120 | name: string_scanner
121 | url: "https://pub.flutter-io.cn"
122 | source: hosted
123 | version: "1.1.0"
124 | term_glyph:
125 | dependency: transitive
126 | description:
127 | name: term_glyph
128 | url: "https://pub.flutter-io.cn"
129 | source: hosted
130 | version: "1.2.0"
131 | test_api:
132 | dependency: transitive
133 | description:
134 | name: test_api
135 | url: "https://pub.flutter-io.cn"
136 | source: hosted
137 | version: "0.4.3"
138 | typed_data:
139 | dependency: transitive
140 | description:
141 | name: typed_data
142 | url: "https://pub.flutter-io.cn"
143 | source: hosted
144 | version: "1.3.0"
145 | vector_math:
146 | dependency: transitive
147 | description:
148 | name: vector_math
149 | url: "https://pub.flutter-io.cn"
150 | source: hosted
151 | version: "2.1.1"
152 | sdks:
153 | dart: ">=2.14.0 <3.0.0"
154 | flutter: ">=1.22.0"
155 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: simplegridlottery
2 | description: A new Flutter application.
3 |
4 | # The following defines the version and build number for your application.
5 | # A version number is three numbers separated by dots, like 1.2.43
6 | # followed by an optional build number separated by a +.
7 | # Both the version and the builder number may be overridden in flutter
8 | # build by specifying --build-name and --build-number, respectively.
9 | # In Android, build-name is used as versionName while build-number used as versionCode.
10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
12 | # Read more about iOS versioning at
13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
14 | version: 1.0.0+1
15 |
16 | environment:
17 | sdk: ">=2.12.0 <3.0.0"
18 | flutter: ">=1.22.0"
19 |
20 | dependencies:
21 | flutter:
22 | sdk: flutter
23 |
24 | # The following adds the Cupertino Icons font to your application.
25 | # Use with the CupertinoIcons class for iOS style icons.
26 | cupertino_icons: ^0.1.2
27 |
28 | dev_dependencies:
29 | flutter_test:
30 | sdk: flutter
31 |
32 |
33 | # For information on the generic Dart part of this file, see the
34 | # following page: https://dart.dev/tools/pub/pubspec
35 |
36 | # The following section is specific to Flutter.
37 | flutter:
38 |
39 | # The following line ensures that the Material Icons font is
40 | # included with your application, so that you can use the icons in
41 | # the material Icons class.
42 | uses-material-design: true
43 |
44 | # To add assets to your application, add an assets section, like this:
45 | assets:
46 | - images/gift1.jpg
47 | - images/gift2.jpg
48 | - images/gift3.jpg
49 |
50 | # An image asset can refer to one or more resolution-specific "variants", see
51 | # https://flutter.dev/assets-and-images/#resolution-aware.
52 |
53 | # For details regarding adding assets from package dependencies, see
54 | # https://flutter.dev/assets-and-images/#from-packages
55 |
56 | # To add custom fonts to your application, add a fonts section here,
57 | # in this "flutter" section. Each entry in this list should have a
58 | # "family" key with the font family name, and a "fonts" key with a
59 | # list giving the asset and other descriptors for the font. For
60 | # example:
61 | # fonts:
62 | # - family: Schyler
63 | # fonts:
64 | # - asset: fonts/Schyler-Regular.ttf
65 | # - asset: fonts/Schyler-Italic.ttf
66 | # style: italic
67 | # - family: Trajan Pro
68 | # fonts:
69 | # - asset: fonts/TrajanPro.ttf
70 | # - asset: fonts/TrajanPro_Bold.ttf
71 | # weight: 700
72 | #
73 | # For details regarding fonts from package dependencies,
74 | # see https://flutter.dev/custom-fonts/#from-packages
75 |
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | import 'package:simplegridlottery/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(MyApp());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | simplegridlottery
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------