Showing
84 changed files
with
2354 additions
and
188 deletions
example/android/app/build.gradle
0 → 100644
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 plugin: 'kotlin-android' | ||
26 | +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" | ||
27 | + | ||
28 | +android { | ||
29 | + compileSdkVersion 28 | ||
30 | + | ||
31 | + sourceSets { | ||
32 | + main.java.srcDirs += 'src/main/kotlin' | ||
33 | + } | ||
34 | + | ||
35 | + lintOptions { | ||
36 | + disable 'InvalidPackage' | ||
37 | + } | ||
38 | + | ||
39 | + defaultConfig { | ||
40 | + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). | ||
41 | + applicationId "com.example.get_state" | ||
42 | + minSdkVersion 16 | ||
43 | + targetSdkVersion 28 | ||
44 | + versionCode flutterVersionCode.toInteger() | ||
45 | + versionName flutterVersionName | ||
46 | + } | ||
47 | + | ||
48 | + buildTypes { | ||
49 | + release { | ||
50 | + // TODO: Add your own signing config for the release build. | ||
51 | + // Signing with the debug keys for now, so `flutter run --release` works. | ||
52 | + signingConfig signingConfigs.debug | ||
53 | + } | ||
54 | + } | ||
55 | +} | ||
56 | + | ||
57 | +flutter { | ||
58 | + source '../..' | ||
59 | +} | ||
60 | + | ||
61 | +dependencies { | ||
62 | + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
63 | +} |
1 | +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
2 | + package="com.example.get_state"> | ||
3 | + <!-- Flutter needs it to communicate with the running application | ||
4 | + to allow setting breakpoints, to provide hot reload, etc. | ||
5 | + --> | ||
6 | + <uses-permission android:name="android.permission.INTERNET"/> | ||
7 | +</manifest> |
1 | +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
2 | + package="com.example.get_state"> | ||
3 | + <!-- io.flutter.app.FlutterApplication is an android.app.Application that | ||
4 | + calls FlutterMain.startInitialization(this); in its onCreate method. | ||
5 | + In most cases you can leave this as-is, but you if you want to provide | ||
6 | + additional functionality it is fine to subclass or reimplement | ||
7 | + FlutterApplication and put your custom class here. --> | ||
8 | + <application | ||
9 | + android:name="io.flutter.app.FlutterApplication" | ||
10 | + android:label="get_state" | ||
11 | + android:icon="@mipmap/ic_launcher"> | ||
12 | + <activity | ||
13 | + android:name=".MainActivity" | ||
14 | + android:launchMode="singleTop" | ||
15 | + android:theme="@style/LaunchTheme" | ||
16 | + android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" | ||
17 | + android:hardwareAccelerated="true" | ||
18 | + android:windowSoftInputMode="adjustResize"> | ||
19 | + <!-- Specifies an Android theme to apply to this Activity as soon as | ||
20 | + the Android process has started. This theme is visible to the user | ||
21 | + while the Flutter UI initializes. After that, this theme continues | ||
22 | + to determine the Window background behind the Flutter UI. --> | ||
23 | + <meta-data | ||
24 | + android:name="io.flutter.embedding.android.NormalTheme" | ||
25 | + android:resource="@style/NormalTheme" | ||
26 | + /> | ||
27 | + <!-- Displays an Android View that continues showing the launch screen | ||
28 | + Drawable until Flutter paints its first frame, then this splash | ||
29 | + screen fades out. A splash screen is useful to avoid any visual | ||
30 | + gap between the end of Android's launch screen and the painting of | ||
31 | + Flutter's first frame. --> | ||
32 | + <meta-data | ||
33 | + android:name="io.flutter.embedding.android.SplashScreenDrawable" | ||
34 | + android:resource="@drawable/launch_background" | ||
35 | + /> | ||
36 | + <intent-filter> | ||
37 | + <action android:name="android.intent.action.MAIN"/> | ||
38 | + <category android:name="android.intent.category.LAUNCHER"/> | ||
39 | + </intent-filter> | ||
40 | + </activity> | ||
41 | + <!-- Don't delete the meta-data below. | ||
42 | + This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> | ||
43 | + <meta-data | ||
44 | + android:name="flutterEmbedding" | ||
45 | + android:value="2" /> | ||
46 | + </application> | ||
47 | +</manifest> |
1 | +package io.flutter.plugins; | ||
2 | + | ||
3 | +import androidx.annotation.Keep; | ||
4 | +import androidx.annotation.NonNull; | ||
5 | + | ||
6 | +import io.flutter.embedding.engine.FlutterEngine; | ||
7 | + | ||
8 | +/** | ||
9 | + * Generated file. Do not edit. | ||
10 | + * This file is generated by the Flutter tool based on the | ||
11 | + * plugins that support the Android platform. | ||
12 | + */ | ||
13 | +@Keep | ||
14 | +public final class GeneratedPluginRegistrant { | ||
15 | + public static void registerWith(@NonNull FlutterEngine flutterEngine) { | ||
16 | + } | ||
17 | +} |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<!-- Modify this file to customize your launch splash screen --> | ||
3 | +<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
4 | + <item android:drawable="@android:color/white" /> | ||
5 | + | ||
6 | + <!-- You can insert your own image assets here --> | ||
7 | + <!-- <item> | ||
8 | + <bitmap | ||
9 | + android:gravity="center" | ||
10 | + android:src="@mipmap/launch_image" /> | ||
11 | + </item> --> | ||
12 | +</layer-list> |

544 Bytes

442 Bytes

721 Bytes

1.01 KB

1.41 KB
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<resources> | ||
3 | + <!-- Theme applied to the Android Window while the process is starting --> | ||
4 | + <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> | ||
5 | + <!-- Show a splash screen on the activity. Automatically removed when | ||
6 | + Flutter draws its first frame --> | ||
7 | + <item name="android:windowBackground">@drawable/launch_background</item> | ||
8 | + </style> | ||
9 | + <!-- Theme applied to the Android Window as soon as the process has started. | ||
10 | + This theme determines the color of the Android Window while your | ||
11 | + Flutter UI initializes, as well as behind your Flutter UI while its | ||
12 | + running. | ||
13 | + | ||
14 | + This Theme is only used starting with V2 of Flutter's Android embedding. --> | ||
15 | + <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar"> | ||
16 | + <item name="android:windowBackground">@android:color/white</item> | ||
17 | + </style> | ||
18 | +</resources> |
1 | +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
2 | + package="com.example.get_state"> | ||
3 | + <!-- Flutter needs it to communicate with the running application | ||
4 | + to allow setting breakpoints, to provide hot reload, etc. | ||
5 | + --> | ||
6 | + <uses-permission android:name="android.permission.INTERNET"/> | ||
7 | +</manifest> |
example/android/build.gradle
0 → 100644
1 | +buildscript { | ||
2 | + ext.kotlin_version = '1.3.50' | ||
3 | + repositories { | ||
4 | + google() | ||
5 | + jcenter() | ||
6 | + } | ||
7 | + | ||
8 | + dependencies { | ||
9 | + classpath 'com.android.tools.build:gradle:3.5.0' | ||
10 | + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
11 | + } | ||
12 | +} | ||
13 | + | ||
14 | +allprojects { | ||
15 | + repositories { | ||
16 | + google() | ||
17 | + jcenter() | ||
18 | + } | ||
19 | +} | ||
20 | + | ||
21 | +rootProject.buildDir = '../build' | ||
22 | +subprojects { | ||
23 | + project.buildDir = "${rootProject.buildDir}/${project.name}" | ||
24 | +} | ||
25 | +subprojects { | ||
26 | + project.evaluationDependsOn(':app') | ||
27 | +} | ||
28 | + | ||
29 | +task clean(type: Delete) { | ||
30 | + delete rootProject.buildDir | ||
31 | +} |
example/android/get_state_android.iml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<module type="JAVA_MODULE" version="4"> | ||
3 | + <component name="FacetManager"> | ||
4 | + <facet type="android" name="Android"> | ||
5 | + <configuration> | ||
6 | + <option name="ALLOW_USER_CONFIGURATION" value="false" /> | ||
7 | + <option name="GEN_FOLDER_RELATIVE_PATH_APT" value="/gen" /> | ||
8 | + <option name="GEN_FOLDER_RELATIVE_PATH_AIDL" value="/gen" /> | ||
9 | + <option name="MANIFEST_FILE_RELATIVE_PATH" value="/app/src/main/AndroidManifest.xml" /> | ||
10 | + <option name="RES_FOLDER_RELATIVE_PATH" value="/app/src/main/res" /> | ||
11 | + <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/app/src/main/assets" /> | ||
12 | + <option name="LIBS_FOLDER_RELATIVE_PATH" value="/app/src/main/libs" /> | ||
13 | + <option name="PROGUARD_LOGS_FOLDER_RELATIVE_PATH" value="/app/src/main/proguard_logs" /> | ||
14 | + </configuration> | ||
15 | + </facet> | ||
16 | + </component> | ||
17 | + <component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
18 | + <exclude-output /> | ||
19 | + <content url="file://$MODULE_DIR$"> | ||
20 | + <sourceFolder url="file://$MODULE_DIR$/app/src/main/java" isTestSource="false" /> | ||
21 | + <sourceFolder url="file://$MODULE_DIR$/app/src/main/kotlin" isTestSource="false" /> | ||
22 | + <sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" /> | ||
23 | + </content> | ||
24 | + <orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" /> | ||
25 | + <orderEntry type="sourceFolder" forTests="false" /> | ||
26 | + <orderEntry type="library" name="Flutter for Android" level="project" /> | ||
27 | + <orderEntry type="library" name="KotlinJavaRuntime" level="project" /> | ||
28 | + </component> | ||
29 | +</module> |
example/android/gradle.properties
0 → 100644
No preview for this file type
example/android/gradlew
0 → 100644
1 | +#!/usr/bin/env bash | ||
2 | + | ||
3 | +############################################################################## | ||
4 | +## | ||
5 | +## Gradle start up script for UN*X | ||
6 | +## | ||
7 | +############################################################################## | ||
8 | + | ||
9 | +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
10 | +DEFAULT_JVM_OPTS="" | ||
11 | + | ||
12 | +APP_NAME="Gradle" | ||
13 | +APP_BASE_NAME=`basename "$0"` | ||
14 | + | ||
15 | +# Use the maximum available, or set MAX_FD != -1 to use that value. | ||
16 | +MAX_FD="maximum" | ||
17 | + | ||
18 | +warn ( ) { | ||
19 | + echo "$*" | ||
20 | +} | ||
21 | + | ||
22 | +die ( ) { | ||
23 | + echo | ||
24 | + echo "$*" | ||
25 | + echo | ||
26 | + exit 1 | ||
27 | +} | ||
28 | + | ||
29 | +# OS specific support (must be 'true' or 'false'). | ||
30 | +cygwin=false | ||
31 | +msys=false | ||
32 | +darwin=false | ||
33 | +case "`uname`" in | ||
34 | + CYGWIN* ) | ||
35 | + cygwin=true | ||
36 | + ;; | ||
37 | + Darwin* ) | ||
38 | + darwin=true | ||
39 | + ;; | ||
40 | + MINGW* ) | ||
41 | + msys=true | ||
42 | + ;; | ||
43 | +esac | ||
44 | + | ||
45 | +# Attempt to set APP_HOME | ||
46 | +# Resolve links: $0 may be a link | ||
47 | +PRG="$0" | ||
48 | +# Need this for relative symlinks. | ||
49 | +while [ -h "$PRG" ] ; do | ||
50 | + ls=`ls -ld "$PRG"` | ||
51 | + link=`expr "$ls" : '.*-> \(.*\)$'` | ||
52 | + if expr "$link" : '/.*' > /dev/null; then | ||
53 | + PRG="$link" | ||
54 | + else | ||
55 | + PRG=`dirname "$PRG"`"/$link" | ||
56 | + fi | ||
57 | +done | ||
58 | +SAVED="`pwd`" | ||
59 | +cd "`dirname \"$PRG\"`/" >/dev/null | ||
60 | +APP_HOME="`pwd -P`" | ||
61 | +cd "$SAVED" >/dev/null | ||
62 | + | ||
63 | +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | ||
64 | + | ||
65 | +# Determine the Java command to use to start the JVM. | ||
66 | +if [ -n "$JAVA_HOME" ] ; then | ||
67 | + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | ||
68 | + # IBM's JDK on AIX uses strange locations for the executables | ||
69 | + JAVACMD="$JAVA_HOME/jre/sh/java" | ||
70 | + else | ||
71 | + JAVACMD="$JAVA_HOME/bin/java" | ||
72 | + fi | ||
73 | + if [ ! -x "$JAVACMD" ] ; then | ||
74 | + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | ||
75 | + | ||
76 | +Please set the JAVA_HOME variable in your environment to match the | ||
77 | +location of your Java installation." | ||
78 | + fi | ||
79 | +else | ||
80 | + JAVACMD="java" | ||
81 | + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
82 | + | ||
83 | +Please set the JAVA_HOME variable in your environment to match the | ||
84 | +location of your Java installation." | ||
85 | +fi | ||
86 | + | ||
87 | +# Increase the maximum file descriptors if we can. | ||
88 | +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then | ||
89 | + MAX_FD_LIMIT=`ulimit -H -n` | ||
90 | + if [ $? -eq 0 ] ; then | ||
91 | + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | ||
92 | + MAX_FD="$MAX_FD_LIMIT" | ||
93 | + fi | ||
94 | + ulimit -n $MAX_FD | ||
95 | + if [ $? -ne 0 ] ; then | ||
96 | + warn "Could not set maximum file descriptor limit: $MAX_FD" | ||
97 | + fi | ||
98 | + else | ||
99 | + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | ||
100 | + fi | ||
101 | +fi | ||
102 | + | ||
103 | +# For Darwin, add options to specify how the application appears in the dock | ||
104 | +if $darwin; then | ||
105 | + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | ||
106 | +fi | ||
107 | + | ||
108 | +# For Cygwin, switch paths to Windows format before running java | ||
109 | +if $cygwin ; then | ||
110 | + APP_HOME=`cygpath --path --mixed "$APP_HOME"` | ||
111 | + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | ||
112 | + JAVACMD=`cygpath --unix "$JAVACMD"` | ||
113 | + | ||
114 | + # We build the pattern for arguments to be converted via cygpath | ||
115 | + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | ||
116 | + SEP="" | ||
117 | + for dir in $ROOTDIRSRAW ; do | ||
118 | + ROOTDIRS="$ROOTDIRS$SEP$dir" | ||
119 | + SEP="|" | ||
120 | + done | ||
121 | + OURCYGPATTERN="(^($ROOTDIRS))" | ||
122 | + # Add a user-defined pattern to the cygpath arguments | ||
123 | + if [ "$GRADLE_CYGPATTERN" != "" ] ; then | ||
124 | + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | ||
125 | + fi | ||
126 | + # Now convert the arguments - kludge to limit ourselves to /bin/sh | ||
127 | + i=0 | ||
128 | + for arg in "$@" ; do | ||
129 | + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | ||
130 | + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option | ||
131 | + | ||
132 | + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition | ||
133 | + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | ||
134 | + else | ||
135 | + eval `echo args$i`="\"$arg\"" | ||
136 | + fi | ||
137 | + i=$((i+1)) | ||
138 | + done | ||
139 | + case $i in | ||
140 | + (0) set -- ;; | ||
141 | + (1) set -- "$args0" ;; | ||
142 | + (2) set -- "$args0" "$args1" ;; | ||
143 | + (3) set -- "$args0" "$args1" "$args2" ;; | ||
144 | + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; | ||
145 | + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | ||
146 | + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | ||
147 | + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | ||
148 | + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | ||
149 | + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | ||
150 | + esac | ||
151 | +fi | ||
152 | + | ||
153 | +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules | ||
154 | +function splitJvmOpts() { | ||
155 | + JVM_OPTS=("$@") | ||
156 | +} | ||
157 | +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS | ||
158 | +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" | ||
159 | + | ||
160 | +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" |
example/android/gradlew.bat
0 → 100644
1 | +@if "%DEBUG%" == "" @echo off | ||
2 | +@rem ########################################################################## | ||
3 | +@rem | ||
4 | +@rem Gradle startup script for Windows | ||
5 | +@rem | ||
6 | +@rem ########################################################################## | ||
7 | + | ||
8 | +@rem Set local scope for the variables with windows NT shell | ||
9 | +if "%OS%"=="Windows_NT" setlocal | ||
10 | + | ||
11 | +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
12 | +set DEFAULT_JVM_OPTS= | ||
13 | + | ||
14 | +set DIRNAME=%~dp0 | ||
15 | +if "%DIRNAME%" == "" set DIRNAME=. | ||
16 | +set APP_BASE_NAME=%~n0 | ||
17 | +set APP_HOME=%DIRNAME% | ||
18 | + | ||
19 | +@rem Find java.exe | ||
20 | +if defined JAVA_HOME goto findJavaFromJavaHome | ||
21 | + | ||
22 | +set JAVA_EXE=java.exe | ||
23 | +%JAVA_EXE% -version >NUL 2>&1 | ||
24 | +if "%ERRORLEVEL%" == "0" goto init | ||
25 | + | ||
26 | +echo. | ||
27 | +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
28 | +echo. | ||
29 | +echo Please set the JAVA_HOME variable in your environment to match the | ||
30 | +echo location of your Java installation. | ||
31 | + | ||
32 | +goto fail | ||
33 | + | ||
34 | +:findJavaFromJavaHome | ||
35 | +set JAVA_HOME=%JAVA_HOME:"=% | ||
36 | +set JAVA_EXE=%JAVA_HOME%/bin/java.exe | ||
37 | + | ||
38 | +if exist "%JAVA_EXE%" goto init | ||
39 | + | ||
40 | +echo. | ||
41 | +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% | ||
42 | +echo. | ||
43 | +echo Please set the JAVA_HOME variable in your environment to match the | ||
44 | +echo location of your Java installation. | ||
45 | + | ||
46 | +goto fail | ||
47 | + | ||
48 | +:init | ||
49 | +@rem Get command-line arguments, handling Windowz variants | ||
50 | + | ||
51 | +if not "%OS%" == "Windows_NT" goto win9xME_args | ||
52 | +if "%@eval[2+2]" == "4" goto 4NT_args | ||
53 | + | ||
54 | +:win9xME_args | ||
55 | +@rem Slurp the command line arguments. | ||
56 | +set CMD_LINE_ARGS= | ||
57 | +set _SKIP=2 | ||
58 | + | ||
59 | +:win9xME_args_slurp | ||
60 | +if "x%~1" == "x" goto execute | ||
61 | + | ||
62 | +set CMD_LINE_ARGS=%* | ||
63 | +goto execute | ||
64 | + | ||
65 | +:4NT_args | ||
66 | +@rem Get arguments from the 4NT Shell from JP Software | ||
67 | +set CMD_LINE_ARGS=%$ | ||
68 | + | ||
69 | +:execute | ||
70 | +@rem Setup the command line | ||
71 | + | ||
72 | +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar | ||
73 | + | ||
74 | +@rem Execute Gradle | ||
75 | +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% | ||
76 | + | ||
77 | +:end | ||
78 | +@rem End local scope for the variables with windows NT shell | ||
79 | +if "%ERRORLEVEL%"=="0" goto mainEnd | ||
80 | + | ||
81 | +:fail | ||
82 | +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of | ||
83 | +rem the _cmd.exe /c_ return code! | ||
84 | +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 | ||
85 | +exit /b 1 | ||
86 | + | ||
87 | +:mainEnd | ||
88 | +if "%OS%"=="Windows_NT" endlocal | ||
89 | + | ||
90 | +:omega |
example/android/local.properties
0 → 100644
example/android/settings.gradle
0 → 100644
1 | +// Copyright 2014 The Flutter Authors. All rights reserved. | ||
2 | +// Use of this source code is governed by a BSD-style license that can be | ||
3 | +// found in the LICENSE file. | ||
4 | + | ||
5 | +include ':app' | ||
6 | + | ||
7 | +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") | ||
8 | +def properties = new Properties() | ||
9 | + | ||
10 | +assert localPropertiesFile.exists() | ||
11 | +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } | ||
12 | + | ||
13 | +def flutterSdkPath = properties.getProperty("flutter.sdk") | ||
14 | +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" | ||
15 | +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" |
example/ios/Flutter/AppFrameworkInfo.plist
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
3 | +<plist version="1.0"> | ||
4 | +<dict> | ||
5 | + <key>CFBundleDevelopmentRegion</key> | ||
6 | + <string>$(DEVELOPMENT_LANGUAGE)</string> | ||
7 | + <key>CFBundleExecutable</key> | ||
8 | + <string>App</string> | ||
9 | + <key>CFBundleIdentifier</key> | ||
10 | + <string>io.flutter.flutter.app</string> | ||
11 | + <key>CFBundleInfoDictionaryVersion</key> | ||
12 | + <string>6.0</string> | ||
13 | + <key>CFBundleName</key> | ||
14 | + <string>App</string> | ||
15 | + <key>CFBundlePackageType</key> | ||
16 | + <string>FMWK</string> | ||
17 | + <key>CFBundleShortVersionString</key> | ||
18 | + <string>1.0</string> | ||
19 | + <key>CFBundleSignature</key> | ||
20 | + <string>????</string> | ||
21 | + <key>CFBundleVersion</key> | ||
22 | + <string>1.0</string> | ||
23 | + <key>MinimumOSVersion</key> | ||
24 | + <string>8.0</string> | ||
25 | +</dict> | ||
26 | +</plist> |
example/ios/Flutter/Debug.xcconfig
0 → 100644
1 | +#include "Generated.xcconfig" |
example/ios/Flutter/Release.xcconfig
0 → 100644
1 | +#include "Generated.xcconfig" |
example/ios/Runner.xcodeproj/project.pbxproj
0 → 100644
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 | + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; | ||
13 | + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; | ||
14 | + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; | ||
15 | + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; | ||
16 | +/* End PBXBuildFile section */ | ||
17 | + | ||
18 | +/* Begin PBXCopyFilesBuildPhase section */ | ||
19 | + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { | ||
20 | + isa = PBXCopyFilesBuildPhase; | ||
21 | + buildActionMask = 2147483647; | ||
22 | + dstPath = ""; | ||
23 | + dstSubfolderSpec = 10; | ||
24 | + files = ( | ||
25 | + ); | ||
26 | + name = "Embed Frameworks"; | ||
27 | + runOnlyForDeploymentPostprocessing = 0; | ||
28 | + }; | ||
29 | +/* End PBXCopyFilesBuildPhase section */ | ||
30 | + | ||
31 | +/* Begin PBXFileReference section */ | ||
32 | + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; }; | ||
33 | + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; }; | ||
34 | + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; | ||
35 | + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; | ||
36 | + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; | ||
37 | + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; | ||
38 | + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; }; | ||
39 | + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; }; | ||
40 | + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
41 | + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; | ||
42 | + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; | ||
43 | + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; | ||
44 | + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; | ||
45 | +/* End PBXFileReference section */ | ||
46 | + | ||
47 | +/* Begin PBXFrameworksBuildPhase section */ | ||
48 | + 97C146EB1CF9000F007C117D /* Frameworks */ = { | ||
49 | + isa = PBXFrameworksBuildPhase; | ||
50 | + buildActionMask = 2147483647; | ||
51 | + files = ( | ||
52 | + ); | ||
53 | + runOnlyForDeploymentPostprocessing = 0; | ||
54 | + }; | ||
55 | +/* End PBXFrameworksBuildPhase section */ | ||
56 | + | ||
57 | +/* Begin PBXGroup section */ | ||
58 | + 9740EEB11CF90186004384FC /* Flutter */ = { | ||
59 | + isa = PBXGroup; | ||
60 | + children = ( | ||
61 | + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, | ||
62 | + 9740EEB21CF90195004384FC /* Debug.xcconfig */, | ||
63 | + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, | ||
64 | + 9740EEB31CF90195004384FC /* Generated.xcconfig */, | ||
65 | + ); | ||
66 | + name = Flutter; | ||
67 | + sourceTree = "<group>"; | ||
68 | + }; | ||
69 | + 97C146E51CF9000F007C117D = { | ||
70 | + isa = PBXGroup; | ||
71 | + children = ( | ||
72 | + 9740EEB11CF90186004384FC /* Flutter */, | ||
73 | + 97C146F01CF9000F007C117D /* Runner */, | ||
74 | + 97C146EF1CF9000F007C117D /* Products */, | ||
75 | + ); | ||
76 | + sourceTree = "<group>"; | ||
77 | + }; | ||
78 | + 97C146EF1CF9000F007C117D /* Products */ = { | ||
79 | + isa = PBXGroup; | ||
80 | + children = ( | ||
81 | + 97C146EE1CF9000F007C117D /* Runner.app */, | ||
82 | + ); | ||
83 | + name = Products; | ||
84 | + sourceTree = "<group>"; | ||
85 | + }; | ||
86 | + 97C146F01CF9000F007C117D /* Runner */ = { | ||
87 | + isa = PBXGroup; | ||
88 | + children = ( | ||
89 | + 97C146FA1CF9000F007C117D /* Main.storyboard */, | ||
90 | + 97C146FD1CF9000F007C117D /* Assets.xcassets */, | ||
91 | + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, | ||
92 | + 97C147021CF9000F007C117D /* Info.plist */, | ||
93 | + 97C146F11CF9000F007C117D /* Supporting Files */, | ||
94 | + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, | ||
95 | + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, | ||
96 | + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, | ||
97 | + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, | ||
98 | + ); | ||
99 | + path = Runner; | ||
100 | + sourceTree = "<group>"; | ||
101 | + }; | ||
102 | + 97C146F11CF9000F007C117D /* Supporting Files */ = { | ||
103 | + isa = PBXGroup; | ||
104 | + children = ( | ||
105 | + ); | ||
106 | + name = "Supporting Files"; | ||
107 | + sourceTree = "<group>"; | ||
108 | + }; | ||
109 | +/* End PBXGroup section */ | ||
110 | + | ||
111 | +/* Begin PBXNativeTarget section */ | ||
112 | + 97C146ED1CF9000F007C117D /* Runner */ = { | ||
113 | + isa = PBXNativeTarget; | ||
114 | + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; | ||
115 | + buildPhases = ( | ||
116 | + 9740EEB61CF901F6004384FC /* Run Script */, | ||
117 | + 97C146EA1CF9000F007C117D /* Sources */, | ||
118 | + 97C146EB1CF9000F007C117D /* Frameworks */, | ||
119 | + 97C146EC1CF9000F007C117D /* Resources */, | ||
120 | + 9705A1C41CF9048500538489 /* Embed Frameworks */, | ||
121 | + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, | ||
122 | + ); | ||
123 | + buildRules = ( | ||
124 | + ); | ||
125 | + dependencies = ( | ||
126 | + ); | ||
127 | + name = Runner; | ||
128 | + productName = Runner; | ||
129 | + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; | ||
130 | + productType = "com.apple.product-type.application"; | ||
131 | + }; | ||
132 | +/* End PBXNativeTarget section */ | ||
133 | + | ||
134 | +/* Begin PBXProject section */ | ||
135 | + 97C146E61CF9000F007C117D /* Project object */ = { | ||
136 | + isa = PBXProject; | ||
137 | + attributes = { | ||
138 | + LastUpgradeCheck = 1020; | ||
139 | + ORGANIZATIONNAME = ""; | ||
140 | + TargetAttributes = { | ||
141 | + 97C146ED1CF9000F007C117D = { | ||
142 | + CreatedOnToolsVersion = 7.3.1; | ||
143 | + LastSwiftMigration = 1100; | ||
144 | + }; | ||
145 | + }; | ||
146 | + }; | ||
147 | + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; | ||
148 | + compatibilityVersion = "Xcode 9.3"; | ||
149 | + developmentRegion = en; | ||
150 | + hasScannedForEncodings = 0; | ||
151 | + knownRegions = ( | ||
152 | + en, | ||
153 | + Base, | ||
154 | + ); | ||
155 | + mainGroup = 97C146E51CF9000F007C117D; | ||
156 | + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; | ||
157 | + projectDirPath = ""; | ||
158 | + projectRoot = ""; | ||
159 | + targets = ( | ||
160 | + 97C146ED1CF9000F007C117D /* Runner */, | ||
161 | + ); | ||
162 | + }; | ||
163 | +/* End PBXProject section */ | ||
164 | + | ||
165 | +/* Begin PBXResourcesBuildPhase section */ | ||
166 | + 97C146EC1CF9000F007C117D /* Resources */ = { | ||
167 | + isa = PBXResourcesBuildPhase; | ||
168 | + buildActionMask = 2147483647; | ||
169 | + files = ( | ||
170 | + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, | ||
171 | + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, | ||
172 | + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, | ||
173 | + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, | ||
174 | + ); | ||
175 | + runOnlyForDeploymentPostprocessing = 0; | ||
176 | + }; | ||
177 | +/* End PBXResourcesBuildPhase section */ | ||
178 | + | ||
179 | +/* Begin PBXShellScriptBuildPhase section */ | ||
180 | + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { | ||
181 | + isa = PBXShellScriptBuildPhase; | ||
182 | + buildActionMask = 2147483647; | ||
183 | + files = ( | ||
184 | + ); | ||
185 | + inputPaths = ( | ||
186 | + ); | ||
187 | + name = "Thin Binary"; | ||
188 | + outputPaths = ( | ||
189 | + ); | ||
190 | + runOnlyForDeploymentPostprocessing = 0; | ||
191 | + shellPath = /bin/sh; | ||
192 | + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; | ||
193 | + }; | ||
194 | + 9740EEB61CF901F6004384FC /* Run Script */ = { | ||
195 | + isa = PBXShellScriptBuildPhase; | ||
196 | + buildActionMask = 2147483647; | ||
197 | + files = ( | ||
198 | + ); | ||
199 | + inputPaths = ( | ||
200 | + ); | ||
201 | + name = "Run Script"; | ||
202 | + outputPaths = ( | ||
203 | + ); | ||
204 | + runOnlyForDeploymentPostprocessing = 0; | ||
205 | + shellPath = /bin/sh; | ||
206 | + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; | ||
207 | + }; | ||
208 | +/* End PBXShellScriptBuildPhase section */ | ||
209 | + | ||
210 | +/* Begin PBXSourcesBuildPhase section */ | ||
211 | + 97C146EA1CF9000F007C117D /* Sources */ = { | ||
212 | + isa = PBXSourcesBuildPhase; | ||
213 | + buildActionMask = 2147483647; | ||
214 | + files = ( | ||
215 | + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, | ||
216 | + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, | ||
217 | + ); | ||
218 | + runOnlyForDeploymentPostprocessing = 0; | ||
219 | + }; | ||
220 | +/* End PBXSourcesBuildPhase section */ | ||
221 | + | ||
222 | +/* Begin PBXVariantGroup section */ | ||
223 | + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { | ||
224 | + isa = PBXVariantGroup; | ||
225 | + children = ( | ||
226 | + 97C146FB1CF9000F007C117D /* Base */, | ||
227 | + ); | ||
228 | + name = Main.storyboard; | ||
229 | + sourceTree = "<group>"; | ||
230 | + }; | ||
231 | + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { | ||
232 | + isa = PBXVariantGroup; | ||
233 | + children = ( | ||
234 | + 97C147001CF9000F007C117D /* Base */, | ||
235 | + ); | ||
236 | + name = LaunchScreen.storyboard; | ||
237 | + sourceTree = "<group>"; | ||
238 | + }; | ||
239 | +/* End PBXVariantGroup section */ | ||
240 | + | ||
241 | +/* Begin XCBuildConfiguration section */ | ||
242 | + 249021D3217E4FDB00AE95B9 /* Profile */ = { | ||
243 | + isa = XCBuildConfiguration; | ||
244 | + buildSettings = { | ||
245 | + ALWAYS_SEARCH_USER_PATHS = NO; | ||
246 | + CLANG_ANALYZER_NONNULL = YES; | ||
247 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | ||
248 | + CLANG_CXX_LIBRARY = "libc++"; | ||
249 | + CLANG_ENABLE_MODULES = YES; | ||
250 | + CLANG_ENABLE_OBJC_ARC = YES; | ||
251 | + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; | ||
252 | + CLANG_WARN_BOOL_CONVERSION = YES; | ||
253 | + CLANG_WARN_COMMA = YES; | ||
254 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
255 | + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; | ||
256 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
257 | + CLANG_WARN_EMPTY_BODY = YES; | ||
258 | + CLANG_WARN_ENUM_CONVERSION = YES; | ||
259 | + CLANG_WARN_INFINITE_RECURSION = YES; | ||
260 | + CLANG_WARN_INT_CONVERSION = YES; | ||
261 | + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; | ||
262 | + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; | ||
263 | + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; | ||
264 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
265 | + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; | ||
266 | + CLANG_WARN_STRICT_PROTOTYPES = YES; | ||
267 | + CLANG_WARN_SUSPICIOUS_MOVE = YES; | ||
268 | + CLANG_WARN_UNREACHABLE_CODE = YES; | ||
269 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
270 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | ||
271 | + COPY_PHASE_STRIP = NO; | ||
272 | + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; | ||
273 | + ENABLE_NS_ASSERTIONS = NO; | ||
274 | + ENABLE_STRICT_OBJC_MSGSEND = YES; | ||
275 | + GCC_C_LANGUAGE_STANDARD = gnu99; | ||
276 | + GCC_NO_COMMON_BLOCKS = YES; | ||
277 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
278 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
279 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
280 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
281 | + GCC_WARN_UNUSED_FUNCTION = YES; | ||
282 | + GCC_WARN_UNUSED_VARIABLE = YES; | ||
283 | + IPHONEOS_DEPLOYMENT_TARGET = 8.0; | ||
284 | + MTL_ENABLE_DEBUG_INFO = NO; | ||
285 | + SDKROOT = iphoneos; | ||
286 | + SUPPORTED_PLATFORMS = iphoneos; | ||
287 | + TARGETED_DEVICE_FAMILY = "1,2"; | ||
288 | + VALIDATE_PRODUCT = YES; | ||
289 | + }; | ||
290 | + name = Profile; | ||
291 | + }; | ||
292 | + 249021D4217E4FDB00AE95B9 /* Profile */ = { | ||
293 | + isa = XCBuildConfiguration; | ||
294 | + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; | ||
295 | + buildSettings = { | ||
296 | + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
297 | + CLANG_ENABLE_MODULES = YES; | ||
298 | + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | ||
299 | + ENABLE_BITCODE = NO; | ||
300 | + FRAMEWORK_SEARCH_PATHS = ( | ||
301 | + "$(inherited)", | ||
302 | + "$(PROJECT_DIR)/Flutter", | ||
303 | + ); | ||
304 | + INFOPLIST_FILE = Runner/Info.plist; | ||
305 | + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; | ||
306 | + LIBRARY_SEARCH_PATHS = ( | ||
307 | + "$(inherited)", | ||
308 | + "$(PROJECT_DIR)/Flutter", | ||
309 | + ); | ||
310 | + PRODUCT_BUNDLE_IDENTIFIER = com.example.getState; | ||
311 | + PRODUCT_NAME = "$(TARGET_NAME)"; | ||
312 | + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; | ||
313 | + SWIFT_VERSION = 5.0; | ||
314 | + VERSIONING_SYSTEM = "apple-generic"; | ||
315 | + }; | ||
316 | + name = Profile; | ||
317 | + }; | ||
318 | + 97C147031CF9000F007C117D /* Debug */ = { | ||
319 | + isa = XCBuildConfiguration; | ||
320 | + buildSettings = { | ||
321 | + ALWAYS_SEARCH_USER_PATHS = NO; | ||
322 | + CLANG_ANALYZER_NONNULL = YES; | ||
323 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | ||
324 | + CLANG_CXX_LIBRARY = "libc++"; | ||
325 | + CLANG_ENABLE_MODULES = YES; | ||
326 | + CLANG_ENABLE_OBJC_ARC = YES; | ||
327 | + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; | ||
328 | + CLANG_WARN_BOOL_CONVERSION = YES; | ||
329 | + CLANG_WARN_COMMA = YES; | ||
330 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
331 | + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; | ||
332 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
333 | + CLANG_WARN_EMPTY_BODY = YES; | ||
334 | + CLANG_WARN_ENUM_CONVERSION = YES; | ||
335 | + CLANG_WARN_INFINITE_RECURSION = YES; | ||
336 | + CLANG_WARN_INT_CONVERSION = YES; | ||
337 | + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; | ||
338 | + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; | ||
339 | + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; | ||
340 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
341 | + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; | ||
342 | + CLANG_WARN_STRICT_PROTOTYPES = YES; | ||
343 | + CLANG_WARN_SUSPICIOUS_MOVE = YES; | ||
344 | + CLANG_WARN_UNREACHABLE_CODE = YES; | ||
345 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
346 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | ||
347 | + COPY_PHASE_STRIP = NO; | ||
348 | + DEBUG_INFORMATION_FORMAT = dwarf; | ||
349 | + ENABLE_STRICT_OBJC_MSGSEND = YES; | ||
350 | + ENABLE_TESTABILITY = YES; | ||
351 | + GCC_C_LANGUAGE_STANDARD = gnu99; | ||
352 | + GCC_DYNAMIC_NO_PIC = NO; | ||
353 | + GCC_NO_COMMON_BLOCKS = YES; | ||
354 | + GCC_OPTIMIZATION_LEVEL = 0; | ||
355 | + GCC_PREPROCESSOR_DEFINITIONS = ( | ||
356 | + "DEBUG=1", | ||
357 | + "$(inherited)", | ||
358 | + ); | ||
359 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
360 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
361 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
362 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
363 | + GCC_WARN_UNUSED_FUNCTION = YES; | ||
364 | + GCC_WARN_UNUSED_VARIABLE = YES; | ||
365 | + IPHONEOS_DEPLOYMENT_TARGET = 8.0; | ||
366 | + MTL_ENABLE_DEBUG_INFO = YES; | ||
367 | + ONLY_ACTIVE_ARCH = YES; | ||
368 | + SDKROOT = iphoneos; | ||
369 | + TARGETED_DEVICE_FAMILY = "1,2"; | ||
370 | + }; | ||
371 | + name = Debug; | ||
372 | + }; | ||
373 | + 97C147041CF9000F007C117D /* Release */ = { | ||
374 | + isa = XCBuildConfiguration; | ||
375 | + buildSettings = { | ||
376 | + ALWAYS_SEARCH_USER_PATHS = NO; | ||
377 | + CLANG_ANALYZER_NONNULL = YES; | ||
378 | + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | ||
379 | + CLANG_CXX_LIBRARY = "libc++"; | ||
380 | + CLANG_ENABLE_MODULES = YES; | ||
381 | + CLANG_ENABLE_OBJC_ARC = YES; | ||
382 | + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; | ||
383 | + CLANG_WARN_BOOL_CONVERSION = YES; | ||
384 | + CLANG_WARN_COMMA = YES; | ||
385 | + CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
386 | + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; | ||
387 | + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
388 | + CLANG_WARN_EMPTY_BODY = YES; | ||
389 | + CLANG_WARN_ENUM_CONVERSION = YES; | ||
390 | + CLANG_WARN_INFINITE_RECURSION = YES; | ||
391 | + CLANG_WARN_INT_CONVERSION = YES; | ||
392 | + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; | ||
393 | + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; | ||
394 | + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; | ||
395 | + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
396 | + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; | ||
397 | + CLANG_WARN_STRICT_PROTOTYPES = YES; | ||
398 | + CLANG_WARN_SUSPICIOUS_MOVE = YES; | ||
399 | + CLANG_WARN_UNREACHABLE_CODE = YES; | ||
400 | + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
401 | + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | ||
402 | + COPY_PHASE_STRIP = NO; | ||
403 | + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; | ||
404 | + ENABLE_NS_ASSERTIONS = NO; | ||
405 | + ENABLE_STRICT_OBJC_MSGSEND = YES; | ||
406 | + GCC_C_LANGUAGE_STANDARD = gnu99; | ||
407 | + GCC_NO_COMMON_BLOCKS = YES; | ||
408 | + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
409 | + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
410 | + GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
411 | + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
412 | + GCC_WARN_UNUSED_FUNCTION = YES; | ||
413 | + GCC_WARN_UNUSED_VARIABLE = YES; | ||
414 | + IPHONEOS_DEPLOYMENT_TARGET = 8.0; | ||
415 | + MTL_ENABLE_DEBUG_INFO = NO; | ||
416 | + SDKROOT = iphoneos; | ||
417 | + SUPPORTED_PLATFORMS = iphoneos; | ||
418 | + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; | ||
419 | + TARGETED_DEVICE_FAMILY = "1,2"; | ||
420 | + VALIDATE_PRODUCT = YES; | ||
421 | + }; | ||
422 | + name = Release; | ||
423 | + }; | ||
424 | + 97C147061CF9000F007C117D /* Debug */ = { | ||
425 | + isa = XCBuildConfiguration; | ||
426 | + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; | ||
427 | + buildSettings = { | ||
428 | + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
429 | + CLANG_ENABLE_MODULES = YES; | ||
430 | + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | ||
431 | + ENABLE_BITCODE = NO; | ||
432 | + FRAMEWORK_SEARCH_PATHS = ( | ||
433 | + "$(inherited)", | ||
434 | + "$(PROJECT_DIR)/Flutter", | ||
435 | + ); | ||
436 | + INFOPLIST_FILE = Runner/Info.plist; | ||
437 | + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; | ||
438 | + LIBRARY_SEARCH_PATHS = ( | ||
439 | + "$(inherited)", | ||
440 | + "$(PROJECT_DIR)/Flutter", | ||
441 | + ); | ||
442 | + PRODUCT_BUNDLE_IDENTIFIER = com.example.getState; | ||
443 | + PRODUCT_NAME = "$(TARGET_NAME)"; | ||
444 | + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; | ||
445 | + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; | ||
446 | + SWIFT_VERSION = 5.0; | ||
447 | + VERSIONING_SYSTEM = "apple-generic"; | ||
448 | + }; | ||
449 | + name = Debug; | ||
450 | + }; | ||
451 | + 97C147071CF9000F007C117D /* Release */ = { | ||
452 | + isa = XCBuildConfiguration; | ||
453 | + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; | ||
454 | + buildSettings = { | ||
455 | + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
456 | + CLANG_ENABLE_MODULES = YES; | ||
457 | + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | ||
458 | + ENABLE_BITCODE = NO; | ||
459 | + FRAMEWORK_SEARCH_PATHS = ( | ||
460 | + "$(inherited)", | ||
461 | + "$(PROJECT_DIR)/Flutter", | ||
462 | + ); | ||
463 | + INFOPLIST_FILE = Runner/Info.plist; | ||
464 | + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; | ||
465 | + LIBRARY_SEARCH_PATHS = ( | ||
466 | + "$(inherited)", | ||
467 | + "$(PROJECT_DIR)/Flutter", | ||
468 | + ); | ||
469 | + PRODUCT_BUNDLE_IDENTIFIER = com.example.getState; | ||
470 | + PRODUCT_NAME = "$(TARGET_NAME)"; | ||
471 | + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; | ||
472 | + SWIFT_VERSION = 5.0; | ||
473 | + VERSIONING_SYSTEM = "apple-generic"; | ||
474 | + }; | ||
475 | + name = Release; | ||
476 | + }; | ||
477 | +/* End XCBuildConfiguration section */ | ||
478 | + | ||
479 | +/* Begin XCConfigurationList section */ | ||
480 | + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { | ||
481 | + isa = XCConfigurationList; | ||
482 | + buildConfigurations = ( | ||
483 | + 97C147031CF9000F007C117D /* Debug */, | ||
484 | + 97C147041CF9000F007C117D /* Release */, | ||
485 | + 249021D3217E4FDB00AE95B9 /* Profile */, | ||
486 | + ); | ||
487 | + defaultConfigurationIsVisible = 0; | ||
488 | + defaultConfigurationName = Release; | ||
489 | + }; | ||
490 | + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { | ||
491 | + isa = XCConfigurationList; | ||
492 | + buildConfigurations = ( | ||
493 | + 97C147061CF9000F007C117D /* Debug */, | ||
494 | + 97C147071CF9000F007C117D /* Release */, | ||
495 | + 249021D4217E4FDB00AE95B9 /* Profile */, | ||
496 | + ); | ||
497 | + defaultConfigurationIsVisible = 0; | ||
498 | + defaultConfigurationName = Release; | ||
499 | + }; | ||
500 | +/* End XCConfigurationList section */ | ||
501 | + }; | ||
502 | + rootObject = 97C146E61CF9000F007C117D /* Project object */; | ||
503 | +} |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<Scheme | ||
3 | + LastUpgradeVersion = "1020" | ||
4 | + version = "1.3"> | ||
5 | + <BuildAction | ||
6 | + parallelizeBuildables = "YES" | ||
7 | + buildImplicitDependencies = "YES"> | ||
8 | + <BuildActionEntries> | ||
9 | + <BuildActionEntry | ||
10 | + buildForTesting = "YES" | ||
11 | + buildForRunning = "YES" | ||
12 | + buildForProfiling = "YES" | ||
13 | + buildForArchiving = "YES" | ||
14 | + buildForAnalyzing = "YES"> | ||
15 | + <BuildableReference | ||
16 | + BuildableIdentifier = "primary" | ||
17 | + BlueprintIdentifier = "97C146ED1CF9000F007C117D" | ||
18 | + BuildableName = "Runner.app" | ||
19 | + BlueprintName = "Runner" | ||
20 | + ReferencedContainer = "container:Runner.xcodeproj"> | ||
21 | + </BuildableReference> | ||
22 | + </BuildActionEntry> | ||
23 | + </BuildActionEntries> | ||
24 | + </BuildAction> | ||
25 | + <TestAction | ||
26 | + buildConfiguration = "Debug" | ||
27 | + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
28 | + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
29 | + shouldUseLaunchSchemeArgsEnv = "YES"> | ||
30 | + <Testables> | ||
31 | + </Testables> | ||
32 | + <MacroExpansion> | ||
33 | + <BuildableReference | ||
34 | + BuildableIdentifier = "primary" | ||
35 | + BlueprintIdentifier = "97C146ED1CF9000F007C117D" | ||
36 | + BuildableName = "Runner.app" | ||
37 | + BlueprintName = "Runner" | ||
38 | + ReferencedContainer = "container:Runner.xcodeproj"> | ||
39 | + </BuildableReference> | ||
40 | + </MacroExpansion> | ||
41 | + <AdditionalOptions> | ||
42 | + </AdditionalOptions> | ||
43 | + </TestAction> | ||
44 | + <LaunchAction | ||
45 | + buildConfiguration = "Debug" | ||
46 | + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
47 | + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
48 | + launchStyle = "0" | ||
49 | + useCustomWorkingDirectory = "NO" | ||
50 | + ignoresPersistentStateOnLaunch = "NO" | ||
51 | + debugDocumentVersioning = "YES" | ||
52 | + debugServiceExtension = "internal" | ||
53 | + allowLocationSimulation = "YES"> | ||
54 | + <BuildableProductRunnable | ||
55 | + runnableDebuggingMode = "0"> | ||
56 | + <BuildableReference | ||
57 | + BuildableIdentifier = "primary" | ||
58 | + BlueprintIdentifier = "97C146ED1CF9000F007C117D" | ||
59 | + BuildableName = "Runner.app" | ||
60 | + BlueprintName = "Runner" | ||
61 | + ReferencedContainer = "container:Runner.xcodeproj"> | ||
62 | + </BuildableReference> | ||
63 | + </BuildableProductRunnable> | ||
64 | + <AdditionalOptions> | ||
65 | + </AdditionalOptions> | ||
66 | + </LaunchAction> | ||
67 | + <ProfileAction | ||
68 | + buildConfiguration = "Profile" | ||
69 | + shouldUseLaunchSchemeArgsEnv = "YES" | ||
70 | + savedToolIdentifier = "" | ||
71 | + useCustomWorkingDirectory = "NO" | ||
72 | + debugDocumentVersioning = "YES"> | ||
73 | + <BuildableProductRunnable | ||
74 | + runnableDebuggingMode = "0"> | ||
75 | + <BuildableReference | ||
76 | + BuildableIdentifier = "primary" | ||
77 | + BlueprintIdentifier = "97C146ED1CF9000F007C117D" | ||
78 | + BuildableName = "Runner.app" | ||
79 | + BlueprintName = "Runner" | ||
80 | + ReferencedContainer = "container:Runner.xcodeproj"> | ||
81 | + </BuildableReference> | ||
82 | + </BuildableProductRunnable> | ||
83 | + </ProfileAction> | ||
84 | + <AnalyzeAction | ||
85 | + buildConfiguration = "Debug"> | ||
86 | + </AnalyzeAction> | ||
87 | + <ArchiveAction | ||
88 | + buildConfiguration = "Release" | ||
89 | + revealArchiveInOrganizer = "YES"> | ||
90 | + </ArchiveAction> | ||
91 | +</Scheme> |
example/ios/Runner/AppDelegate.swift
0 → 100644
1 | +import UIKit | ||
2 | +import Flutter | ||
3 | + | ||
4 | +@UIApplicationMain | ||
5 | +@objc class AppDelegate: FlutterAppDelegate { | ||
6 | + override func application( | ||
7 | + _ application: UIApplication, | ||
8 | + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? | ||
9 | + ) -> Bool { | ||
10 | + GeneratedPluginRegistrant.register(with: self) | ||
11 | + return super.application(application, didFinishLaunchingWithOptions: launchOptions) | ||
12 | + } | ||
13 | +} |
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 | +} |

564 Bytes

1.25 KB

1.55 KB

1.68 KB

1.88 KB

1.25 KB

1.85 KB

3.74 KB

1.84 KB

3.22 KB
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 | +} |

68 Bytes

68 Bytes

68 Bytes
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. |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> | ||
3 | + <dependencies> | ||
4 | + <deployment identifier="iOS"/> | ||
5 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/> | ||
6 | + </dependencies> | ||
7 | + <scenes> | ||
8 | + <!--View Controller--> | ||
9 | + <scene sceneID="EHf-IW-A2E"> | ||
10 | + <objects> | ||
11 | + <viewController id="01J-lp-oVM" sceneMemberID="viewController"> | ||
12 | + <layoutGuides> | ||
13 | + <viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/> | ||
14 | + <viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/> | ||
15 | + </layoutGuides> | ||
16 | + <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> | ||
17 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
18 | + <subviews> | ||
19 | + <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4"> | ||
20 | + </imageView> | ||
21 | + </subviews> | ||
22 | + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
23 | + <constraints> | ||
24 | + <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/> | ||
25 | + <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/> | ||
26 | + </constraints> | ||
27 | + </view> | ||
28 | + </viewController> | ||
29 | + <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
30 | + </objects> | ||
31 | + <point key="canvasLocation" x="53" y="375"/> | ||
32 | + </scene> | ||
33 | + </scenes> | ||
34 | + <resources> | ||
35 | + <image name="LaunchImage" width="168" height="185"/> | ||
36 | + </resources> | ||
37 | +</document> |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> | ||
3 | + <dependencies> | ||
4 | + <deployment identifier="iOS"/> | ||
5 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> | ||
6 | + </dependencies> | ||
7 | + <scenes> | ||
8 | + <!--Flutter View Controller--> | ||
9 | + <scene sceneID="tne-QT-ifu"> | ||
10 | + <objects> | ||
11 | + <viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController"> | ||
12 | + <layoutGuides> | ||
13 | + <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> | ||
14 | + <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> | ||
15 | + </layoutGuides> | ||
16 | + <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> | ||
17 | + <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> | ||
18 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
19 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> | ||
20 | + </view> | ||
21 | + </viewController> | ||
22 | + <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> | ||
23 | + </objects> | ||
24 | + </scene> | ||
25 | + </scenes> | ||
26 | +</document> |
1 | +// | ||
2 | +// Generated file. Do not edit. | ||
3 | +// | ||
4 | + | ||
5 | +#ifndef GeneratedPluginRegistrant_h | ||
6 | +#define GeneratedPluginRegistrant_h | ||
7 | + | ||
8 | +#import <Flutter/Flutter.h> | ||
9 | + | ||
10 | +NS_ASSUME_NONNULL_BEGIN | ||
11 | + | ||
12 | +@interface GeneratedPluginRegistrant : NSObject | ||
13 | ++ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry; | ||
14 | +@end | ||
15 | + | ||
16 | +NS_ASSUME_NONNULL_END | ||
17 | +#endif /* GeneratedPluginRegistrant_h */ |
example/ios/Runner/Info.plist
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
3 | +<plist version="1.0"> | ||
4 | +<dict> | ||
5 | + <key>CFBundleDevelopmentRegion</key> | ||
6 | + <string>$(DEVELOPMENT_LANGUAGE)</string> | ||
7 | + <key>CFBundleExecutable</key> | ||
8 | + <string>$(EXECUTABLE_NAME)</string> | ||
9 | + <key>CFBundleIdentifier</key> | ||
10 | + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
11 | + <key>CFBundleInfoDictionaryVersion</key> | ||
12 | + <string>6.0</string> | ||
13 | + <key>CFBundleName</key> | ||
14 | + <string>get_state</string> | ||
15 | + <key>CFBundlePackageType</key> | ||
16 | + <string>APPL</string> | ||
17 | + <key>CFBundleShortVersionString</key> | ||
18 | + <string>$(FLUTTER_BUILD_NAME)</string> | ||
19 | + <key>CFBundleSignature</key> | ||
20 | + <string>????</string> | ||
21 | + <key>CFBundleVersion</key> | ||
22 | + <string>$(FLUTTER_BUILD_NUMBER)</string> | ||
23 | + <key>LSRequiresIPhoneOS</key> | ||
24 | + <true/> | ||
25 | + <key>UILaunchStoryboardName</key> | ||
26 | + <string>LaunchScreen</string> | ||
27 | + <key>UIMainStoryboardFile</key> | ||
28 | + <string>Main</string> | ||
29 | + <key>UISupportedInterfaceOrientations</key> | ||
30 | + <array> | ||
31 | + <string>UIInterfaceOrientationPortrait</string> | ||
32 | + <string>UIInterfaceOrientationLandscapeLeft</string> | ||
33 | + <string>UIInterfaceOrientationLandscapeRight</string> | ||
34 | + </array> | ||
35 | + <key>UISupportedInterfaceOrientations~ipad</key> | ||
36 | + <array> | ||
37 | + <string>UIInterfaceOrientationPortrait</string> | ||
38 | + <string>UIInterfaceOrientationPortraitUpsideDown</string> | ||
39 | + <string>UIInterfaceOrientationLandscapeLeft</string> | ||
40 | + <string>UIInterfaceOrientationLandscapeRight</string> | ||
41 | + </array> | ||
42 | + <key>UIViewControllerBasedStatusBarAppearance</key> | ||
43 | + <false/> | ||
44 | +</dict> | ||
45 | +</plist> |
example/ios/Runner/Runner-Bridging-Header.h
0 → 100644
1 | +#import "GeneratedPluginRegistrant.h" |
1 | +import 'package:get/get.dart'; | ||
2 | +import 'package:get_state/home/models/home_model.dart'; | ||
3 | +import 'package:get_state/home/repositorys/home_repository.dart'; | ||
4 | + | ||
5 | +class Controller extends GetController { | ||
6 | + /// You do not need that. I recommend using it just for ease of syntax. | ||
7 | + /// with static method: Controller.to.fetchDataFromApi(); | ||
8 | + /// with no static method: Get.find<Controller>().fetchDataFromApi(); | ||
9 | + /// There is no difference in performance, nor any side effect of using either syntax. Only one does not need the type, and the other does. | ||
10 | + static Controller get to => Get.find(); | ||
11 | + | ||
12 | + ApiModel data; | ||
13 | + | ||
14 | + void fetchDataFromApi() async { | ||
15 | + Api api = Api(); | ||
16 | + final response = await api.fetchData(); | ||
17 | + if (response == null) { | ||
18 | + Get.snackbar("Erro", "Não foi possível conectar ao servidor"); | ||
19 | + } else { | ||
20 | + data = response; | ||
21 | + update(this); | ||
22 | + } | ||
23 | + } | ||
24 | +} | ||
25 | + | ||
26 | +/// The first way works perfectly, but if you want to follow good practices, | ||
27 | +/// you can make the data private and access it through a Get. | ||
28 | +/// | ||
29 | +/// | ||
30 | +// class Controllers extends GetController { | ||
31 | +// /// You do not need that. I recommend using it just for ease of syntax. | ||
32 | +// /// with static method: Controller.to.fetchDataFromApi(); | ||
33 | +// /// with no static method: Get.find<Controller>().fetchDataFromApi(); | ||
34 | +// /// There is no difference in performance, nor any side effect of using either syntax. Only one does not need the type, and the other does. | ||
35 | +// static Controller get to => Get.find(); | ||
36 | + | ||
37 | +// ApiModel _data; | ||
38 | +// ApiModel get data => _data; | ||
39 | + | ||
40 | +// void fetchDataFromApi() async { | ||
41 | +// Api api = Api(); | ||
42 | +// final response = await api.fetchData(); | ||
43 | +// if (response == null) { | ||
44 | +// Get.snackbar("Erro", "Não foi possível conectar ao servidor"); | ||
45 | +// } else { | ||
46 | +// _data = response; | ||
47 | +// update(this); | ||
48 | +// } | ||
49 | +// } | ||
50 | +// } |
example/lib/home/models/home_model.dart
0 → 100644
1 | +// To parse this JSON data, do | ||
2 | +// | ||
3 | +// final apiModel = apiModelFromJson(jsonString); | ||
4 | + | ||
5 | +import 'dart:convert'; | ||
6 | + | ||
7 | +class ApiModel { | ||
8 | + final Global global; | ||
9 | + final List<Country> countries; | ||
10 | + final String date; | ||
11 | + | ||
12 | + ApiModel({ | ||
13 | + this.global, | ||
14 | + this.countries, | ||
15 | + this.date, | ||
16 | + }); | ||
17 | + | ||
18 | + factory ApiModel.fromRawJson(String str) => | ||
19 | + ApiModel.fromJson(json.decode(str)); | ||
20 | + | ||
21 | + String toRawJson() => json.encode(toJson()); | ||
22 | + | ||
23 | + factory ApiModel.fromJson(Map<String, dynamic> json) => ApiModel( | ||
24 | + global: json["Global"] == null ? null : Global.fromJson(json["Global"]), | ||
25 | + countries: json["Countries"] == null | ||
26 | + ? null | ||
27 | + : List<Country>.from( | ||
28 | + json["Countries"].map((x) => Country.fromJson(x))), | ||
29 | + date: json["Date"] == null ? null : json["Date"], | ||
30 | + ); | ||
31 | + | ||
32 | + Map<String, dynamic> toJson() => { | ||
33 | + "Global": global == null ? null : global.toJson(), | ||
34 | + "Countries": countries == null | ||
35 | + ? null | ||
36 | + : List<dynamic>.from(countries.map((x) => x.toJson())), | ||
37 | + "Date": date == null ? null : date, | ||
38 | + }; | ||
39 | +} | ||
40 | + | ||
41 | +class Country { | ||
42 | + final String country; | ||
43 | + final String countryCode; | ||
44 | + final String slug; | ||
45 | + final int newConfirmed; | ||
46 | + final int totalConfirmed; | ||
47 | + final int newDeaths; | ||
48 | + final int totalDeaths; | ||
49 | + final int newRecovered; | ||
50 | + final int totalRecovered; | ||
51 | + final String date; | ||
52 | + | ||
53 | + Country({ | ||
54 | + this.country, | ||
55 | + this.countryCode, | ||
56 | + this.slug, | ||
57 | + this.newConfirmed, | ||
58 | + this.totalConfirmed, | ||
59 | + this.newDeaths, | ||
60 | + this.totalDeaths, | ||
61 | + this.newRecovered, | ||
62 | + this.totalRecovered, | ||
63 | + this.date, | ||
64 | + }); | ||
65 | + | ||
66 | + factory Country.fromRawJson(String str) => Country.fromJson(json.decode(str)); | ||
67 | + | ||
68 | + String toRawJson() => json.encode(toJson()); | ||
69 | + | ||
70 | + factory Country.fromJson(Map<String, dynamic> json) => Country( | ||
71 | + country: json["Country"] == null ? null : json["Country"], | ||
72 | + countryCode: json["CountryCode"] == null ? null : json["CountryCode"], | ||
73 | + slug: json["Slug"] == null ? null : json["Slug"], | ||
74 | + newConfirmed: | ||
75 | + json["NewConfirmed"] == null ? null : json["NewConfirmed"], | ||
76 | + totalConfirmed: | ||
77 | + json["TotalConfirmed"] == null ? null : json["TotalConfirmed"], | ||
78 | + newDeaths: json["NewDeaths"] == null ? null : json["NewDeaths"], | ||
79 | + totalDeaths: json["TotalDeaths"] == null ? null : json["TotalDeaths"], | ||
80 | + newRecovered: | ||
81 | + json["NewRecovered"] == null ? null : json["NewRecovered"], | ||
82 | + totalRecovered: | ||
83 | + json["TotalRecovered"] == null ? null : json["TotalRecovered"], | ||
84 | + date: json["Date"] == null ? null : json["Date"], | ||
85 | + ); | ||
86 | + | ||
87 | + Map<String, dynamic> toJson() => { | ||
88 | + "Country": country == null ? null : country, | ||
89 | + "CountryCode": countryCode == null ? null : countryCode, | ||
90 | + "Slug": slug == null ? null : slug, | ||
91 | + "NewConfirmed": newConfirmed == null ? null : newConfirmed, | ||
92 | + "TotalConfirmed": totalConfirmed == null ? null : totalConfirmed, | ||
93 | + "NewDeaths": newDeaths == null ? null : newDeaths, | ||
94 | + "TotalDeaths": totalDeaths == null ? null : totalDeaths, | ||
95 | + "NewRecovered": newRecovered == null ? null : newRecovered, | ||
96 | + "TotalRecovered": totalRecovered == null ? null : totalRecovered, | ||
97 | + "Date": date == null ? null : date, | ||
98 | + }; | ||
99 | +} | ||
100 | + | ||
101 | +class Global { | ||
102 | + final int newConfirmed; | ||
103 | + final int totalConfirmed; | ||
104 | + final int newDeaths; | ||
105 | + final int totalDeaths; | ||
106 | + final int newRecovered; | ||
107 | + final int totalRecovered; | ||
108 | + | ||
109 | + Global({ | ||
110 | + this.newConfirmed, | ||
111 | + this.totalConfirmed, | ||
112 | + this.newDeaths, | ||
113 | + this.totalDeaths, | ||
114 | + this.newRecovered, | ||
115 | + this.totalRecovered, | ||
116 | + }); | ||
117 | + | ||
118 | + factory Global.fromRawJson(String str) => Global.fromJson(json.decode(str)); | ||
119 | + | ||
120 | + String toRawJson() => json.encode(toJson()); | ||
121 | + | ||
122 | + factory Global.fromJson(Map<String, dynamic> json) => Global( | ||
123 | + newConfirmed: | ||
124 | + json["NewConfirmed"] == null ? null : json["NewConfirmed"], | ||
125 | + totalConfirmed: | ||
126 | + json["TotalConfirmed"] == null ? null : json["TotalConfirmed"], | ||
127 | + newDeaths: json["NewDeaths"] == null ? null : json["NewDeaths"], | ||
128 | + totalDeaths: json["TotalDeaths"] == null ? null : json["TotalDeaths"], | ||
129 | + newRecovered: | ||
130 | + json["NewRecovered"] == null ? null : json["NewRecovered"], | ||
131 | + totalRecovered: | ||
132 | + json["TotalRecovered"] == null ? null : json["TotalRecovered"], | ||
133 | + ); | ||
134 | + | ||
135 | + Map<String, dynamic> toJson() => { | ||
136 | + "NewConfirmed": newConfirmed == null ? null : newConfirmed, | ||
137 | + "TotalConfirmed": totalConfirmed == null ? null : totalConfirmed, | ||
138 | + "NewDeaths": newDeaths == null ? null : newDeaths, | ||
139 | + "TotalDeaths": totalDeaths == null ? null : totalDeaths, | ||
140 | + "NewRecovered": newRecovered == null ? null : newRecovered, | ||
141 | + "TotalRecovered": totalRecovered == null ? null : totalRecovered, | ||
142 | + }; | ||
143 | +} |
1 | +import 'package:dio/dio.dart'; | ||
2 | +import 'package:get_state/home/models/home_model.dart'; | ||
3 | + | ||
4 | +class Api { | ||
5 | + /// To make your repository Global, you can use this: | ||
6 | + /// | ||
7 | + /// static Api get to => Get.put(Api()); | ||
8 | + /// | ||
9 | + /// So you can access it with: Get.find<Api>().fetchData; | ||
10 | + /// You can dispose it with Get.delete<Api>(Api()); | ||
11 | + /// Only make the repository global if necessary, if you are going to use it on a single controller, there is no reason to make it global. | ||
12 | + Future<ApiModel> fetchData() async { | ||
13 | + try { | ||
14 | + final response = await Dio().get("https://api.covid19api.com/summary"); | ||
15 | + return ApiModel.fromJson(response.data); | ||
16 | + } catch (e) { | ||
17 | + print(e.toString()); | ||
18 | + return null; | ||
19 | + } | ||
20 | + } | ||
21 | +} |
example/lib/home/views/country_view.dart
0 → 100644
1 | +import 'dart:ui'; | ||
2 | +import 'package:flutter/material.dart'; | ||
3 | +import 'package:get_state/home/controllers/home_controller.dart'; | ||
4 | +import 'package:get_state/home/models/home_model.dart'; | ||
5 | +import 'package:get/get.dart'; | ||
6 | + | ||
7 | +class CountryPage extends StatelessWidget { | ||
8 | + @override | ||
9 | + Widget build(BuildContext context) { | ||
10 | + return Container( | ||
11 | + decoration: BoxDecoration( | ||
12 | + image: DecorationImage( | ||
13 | + fit: BoxFit.cover, | ||
14 | + colorFilter: ColorFilter.linearToSrgbGamma(), | ||
15 | + image: NetworkImage( | ||
16 | + "https://images.pexels.com/photos/3902882/pexels-photo-3902882.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940"))), | ||
17 | + child: BackdropFilter( | ||
18 | + filter: ImageFilter.blur(sigmaX: 15.0, sigmaY: 15.0), | ||
19 | + child: Container( | ||
20 | + decoration: BoxDecoration(color: Colors.white.withOpacity(0.0)), | ||
21 | + child: Scaffold( | ||
22 | + backgroundColor: Colors.transparent, | ||
23 | + appBar: AppBar( | ||
24 | + title: Text("Corona By Country"), | ||
25 | + backgroundColor: Colors.transparent, | ||
26 | + elevation: 0, | ||
27 | + centerTitle: true, | ||
28 | + ), | ||
29 | + body: Center( | ||
30 | + child: ListView.builder( | ||
31 | + itemCount: null, | ||
32 | + itemBuilder: (context, index) { | ||
33 | + Country country = Controller.to.data.countries[index]; | ||
34 | + return ListTile( | ||
35 | + onTap: () { | ||
36 | + Get.toNamed('/details', arguments: country); | ||
37 | + }, | ||
38 | + trailing: CircleAvatar( | ||
39 | + backgroundImage: NetworkImage( | ||
40 | + "https://flagpedia.net/data/flags/normal/${country.countryCode.toLowerCase()}.png"), | ||
41 | + ), | ||
42 | + title: Text(country.country), | ||
43 | + subtitle: | ||
44 | + Text("Total infecteds: ${country.totalConfirmed}"), | ||
45 | + ); | ||
46 | + }), | ||
47 | + ), | ||
48 | + ), | ||
49 | + ), | ||
50 | + ), | ||
51 | + ); | ||
52 | + } | ||
53 | +} |
example/lib/home/views/details_view.dart
0 → 100644
1 | +import 'dart:ui'; | ||
2 | +import 'package:flutter/material.dart'; | ||
3 | +import 'package:get/get.dart'; | ||
4 | +import 'package:get_state/home/models/home_model.dart'; | ||
5 | + | ||
6 | +class DetailsPage extends StatelessWidget { | ||
7 | + @override | ||
8 | + Widget build(BuildContext context) { | ||
9 | + Country country = Get.arguments; | ||
10 | + return Container( | ||
11 | + decoration: BoxDecoration( | ||
12 | + image: DecorationImage( | ||
13 | + fit: BoxFit.cover, | ||
14 | + colorFilter: ColorFilter.linearToSrgbGamma(), | ||
15 | + image: NetworkImage( | ||
16 | + "https://flagpedia.net/data/flags/normal/${country.countryCode.toLowerCase()}.png"))), | ||
17 | + child: BackdropFilter( | ||
18 | + filter: ImageFilter.blur(sigmaX: 15.0, sigmaY: 15.0), | ||
19 | + child: Container( | ||
20 | + decoration: BoxDecoration(color: Colors.white.withOpacity(0.0)), | ||
21 | + child: Scaffold( | ||
22 | + backgroundColor: Colors.transparent, | ||
23 | + appBar: AppBar( | ||
24 | + title: Text("Details"), | ||
25 | + backgroundColor: Colors.black12, | ||
26 | + elevation: 0, | ||
27 | + centerTitle: true, | ||
28 | + ), | ||
29 | + body: Center( | ||
30 | + child: Column( | ||
31 | + mainAxisAlignment: MainAxisAlignment.center, | ||
32 | + children: [ | ||
33 | + Text( | ||
34 | + '${country.country}', | ||
35 | + style: TextStyle(fontSize: 45, fontWeight: FontWeight.bold), | ||
36 | + ), | ||
37 | + SizedBox( | ||
38 | + height: 35, | ||
39 | + ), | ||
40 | + Text( | ||
41 | + "Total Confirmed", | ||
42 | + style: TextStyle( | ||
43 | + fontSize: 25, | ||
44 | + ), | ||
45 | + ), | ||
46 | + Text( | ||
47 | + '${country.totalConfirmed}', | ||
48 | + style: TextStyle(fontSize: 35, fontWeight: FontWeight.bold), | ||
49 | + ), | ||
50 | + SizedBox( | ||
51 | + height: 10, | ||
52 | + ), | ||
53 | + Text( | ||
54 | + "Total Deaths", | ||
55 | + style: TextStyle( | ||
56 | + fontSize: 25, | ||
57 | + ), | ||
58 | + ), | ||
59 | + Text( | ||
60 | + '${country.totalDeaths}', | ||
61 | + style: TextStyle(fontSize: 35, fontWeight: FontWeight.bold), | ||
62 | + ), | ||
63 | + SizedBox( | ||
64 | + height: 10, | ||
65 | + ), | ||
66 | + Text( | ||
67 | + "Total Recovered", | ||
68 | + style: TextStyle( | ||
69 | + fontSize: 25, | ||
70 | + ), | ||
71 | + ), | ||
72 | + Text( | ||
73 | + '${country.totalRecovered}', | ||
74 | + style: TextStyle(fontSize: 35, fontWeight: FontWeight.bold), | ||
75 | + ), | ||
76 | + ], | ||
77 | + )), | ||
78 | + ), | ||
79 | + ), | ||
80 | + ), | ||
81 | + ); | ||
82 | + } | ||
83 | +} |
example/lib/home/views/home_view.dart
0 → 100644
1 | +import 'dart:ui'; | ||
2 | +import 'package:flutter/material.dart'; | ||
3 | +import 'package:get/get.dart'; | ||
4 | +import 'package:get_state/home/controllers/home_controller.dart'; | ||
5 | + | ||
6 | +class HomePage extends StatelessWidget { | ||
7 | + @override | ||
8 | + Widget build(BuildContext context) { | ||
9 | + print("rebuild"); | ||
10 | + return Container( | ||
11 | + decoration: BoxDecoration( | ||
12 | + color: Colors.white, | ||
13 | + image: DecorationImage( | ||
14 | + fit: BoxFit.cover, | ||
15 | + colorFilter: ColorFilter.linearToSrgbGamma(), | ||
16 | + image: NetworkImage( | ||
17 | + "https://images.pexels.com/photos/3902882/pexels-photo-3902882.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940"))), | ||
18 | + child: Scaffold( | ||
19 | + backgroundColor: Colors.transparent, | ||
20 | + appBar: AppBar( | ||
21 | + title: Text("Corona Virus"), | ||
22 | + backgroundColor: Colors.white10, | ||
23 | + elevation: 0, | ||
24 | + centerTitle: true, | ||
25 | + ), | ||
26 | + body: Center( | ||
27 | + child: GetBuilder<Controller>( | ||
28 | + init: Controller(), | ||
29 | + initState: (_) { | ||
30 | + Controller.to.fetchDataFromApi(); | ||
31 | + }, | ||
32 | + builder: (_) { | ||
33 | + if (_.data == null) { | ||
34 | + return CircularProgressIndicator(); | ||
35 | + } else { | ||
36 | + return Column( | ||
37 | + mainAxisAlignment: MainAxisAlignment.center, | ||
38 | + children: [ | ||
39 | + SizedBox( | ||
40 | + height: 100, | ||
41 | + ), | ||
42 | + Text( | ||
43 | + "Total Confirmed", | ||
44 | + style: TextStyle( | ||
45 | + fontSize: 30, | ||
46 | + ), | ||
47 | + ), | ||
48 | + Text( | ||
49 | + '${_.data.global.totalConfirmed}', | ||
50 | + style: TextStyle( | ||
51 | + fontSize: 45, fontWeight: FontWeight.bold), | ||
52 | + ), | ||
53 | + SizedBox( | ||
54 | + height: 10, | ||
55 | + ), | ||
56 | + Text( | ||
57 | + "Total Deaths", | ||
58 | + style: TextStyle( | ||
59 | + fontSize: 30, | ||
60 | + ), | ||
61 | + ), | ||
62 | + Text( | ||
63 | + '${_.data.global.totalDeaths}', | ||
64 | + style: TextStyle( | ||
65 | + fontSize: 45, fontWeight: FontWeight.bold), | ||
66 | + ), | ||
67 | + SizedBox( | ||
68 | + height: 10, | ||
69 | + ), | ||
70 | + OutlineButton( | ||
71 | + borderSide: BorderSide( | ||
72 | + color: Colors.deepPurple, | ||
73 | + width: 3, | ||
74 | + ), | ||
75 | + shape: StadiumBorder(), | ||
76 | + onPressed: () { | ||
77 | + Get.toNamed('/country'); | ||
78 | + }, | ||
79 | + child: Text( | ||
80 | + "Fetch by country", | ||
81 | + style: TextStyle(fontWeight: FontWeight.bold), | ||
82 | + )) | ||
83 | + ], | ||
84 | + ); | ||
85 | + } | ||
86 | + }), | ||
87 | + ), | ||
88 | + ), | ||
89 | + ); | ||
90 | + } | ||
91 | +} |
1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
2 | import 'package:get/get.dart'; | 2 | import 'package:get/get.dart'; |
3 | +import 'package:get_state/home/views/country_view.dart'; | ||
4 | +import 'home/views/details_view.dart'; | ||
5 | +import 'home/views/home_view.dart'; | ||
3 | 6 | ||
4 | -void main() => runApp(MyApp()); | ||
5 | - | ||
6 | -class MyApp extends StatelessWidget { | ||
7 | - @override | ||
8 | - Widget build(BuildContext context) { | ||
9 | - return MaterialApp( | ||
10 | - navigatorKey: Get.key, | ||
11 | - initialRoute: "/", | ||
12 | - navigatorObservers: [ | ||
13 | - GetObserver(MiddleWare.observer), | ||
14 | - ], | ||
15 | - onGenerateRoute: Router.generateRoute, | ||
16 | - ); | ||
17 | - } | ||
18 | -} | ||
19 | - | ||
20 | -class MiddleWare { | ||
21 | - static observer(Routing routing) { | ||
22 | - ///Trigger any event when a route is pushed or popped by Get. | ||
23 | - /// You can listen in addition to the routes, the snackbars, dialogs and bottomsheets on each screen. | ||
24 | - ///If you need to enter any of these 3 events directly here, | ||
25 | - ///you must specify that the event is != Than you are trying to do. | ||
26 | - if (routing.current == '/second' && !routing.isSnackbar) { | ||
27 | - Get.snackbar("Hi", "You are on second route"); | ||
28 | - } else if (routing.current =='/third'){ | ||
29 | - print('last route called'); | ||
30 | - } | ||
31 | - } | ||
32 | -} | ||
33 | - | ||
34 | -class First extends StatelessWidget { | ||
35 | - @override | ||
36 | - Widget build(BuildContext context) { | ||
37 | - return Scaffold( | ||
38 | - appBar: AppBar( | ||
39 | - leading: IconButton( | ||
40 | - icon: Icon(Icons.add), | ||
41 | - onPressed: () { | ||
42 | - Get.snackbar("hi", "i am a modern snackbar"); | ||
43 | - }, | ||
44 | - ), | ||
45 | - title: Text('First Route'), | ||
46 | - ), | ||
47 | - body: Center( | ||
48 | - child: RaisedButton( | ||
49 | - child: Text('Open route'), | ||
50 | - onPressed: () { | ||
51 | - Get.toNamed("/second"); | ||
52 | - }, | ||
53 | - ), | ||
54 | - ), | ||
55 | - ); | ||
56 | - } | ||
57 | -} | ||
58 | - | ||
59 | -class Second extends StatelessWidget { | ||
60 | - @override | ||
61 | - Widget build(BuildContext context) { | ||
62 | - return Scaffold( | ||
63 | - appBar: AppBar( | ||
64 | - leading: IconButton( | ||
65 | - icon: Icon(Icons.add), | ||
66 | - onPressed: () { | ||
67 | - Get.snackbar("hi", "i am a modern snackbar"); | ||
68 | - }, | ||
69 | - ), | ||
70 | - title: Text('second Route'), | ||
71 | - ), | ||
72 | - body: Center( | ||
73 | - child: RaisedButton( | ||
74 | - child: Text('Open route'), | ||
75 | - onPressed: () { | ||
76 | - Get.toNamed("/third"); | ||
77 | - }, | ||
78 | - ), | ||
79 | - ), | ||
80 | - ); | ||
81 | - } | ||
82 | -} | ||
83 | - | ||
84 | -class Third extends StatelessWidget { | ||
85 | - @override | ||
86 | - Widget build(BuildContext context) { | ||
87 | - return Scaffold( | ||
88 | - appBar: AppBar( | ||
89 | - title: Text("Third Route"), | ||
90 | - ), | ||
91 | - body: Center( | ||
92 | - child: RaisedButton( | ||
93 | - onPressed: () { | ||
94 | - Get.back(); | ||
95 | - }, | ||
96 | - child: Text('Go back!'), | ||
97 | - ), | ||
98 | - ), | ||
99 | - ); | ||
100 | - } | ||
101 | -} | ||
102 | - | ||
103 | -class Router { | ||
104 | - static Route<dynamic> generateRoute(RouteSettings settings) { | ||
105 | - switch (settings.name) { | ||
106 | - case '/': | ||
107 | - return GetRoute( | ||
108 | - page: First(), | ||
109 | - settings: settings, | ||
110 | - ); | ||
111 | - case '/second': | ||
112 | - return GetRoute( | ||
113 | - settings: settings, page: Second(), transition: Transition.fade); | ||
114 | - case '/third': | ||
115 | - return GetRoute( | ||
116 | - settings: settings, | ||
117 | - page: Third(), | ||
118 | - transition: Transition.rightToLeft); | ||
119 | - default: | ||
120 | - return GetRoute( | ||
121 | - settings: settings, | ||
122 | - transition: Transition.fade, | ||
123 | - page: Scaffold( | ||
124 | - body: | ||
125 | - Center(child: Text('No route defined for ${settings.name}')), | ||
126 | - )); | ||
127 | - } | ||
128 | - } | 7 | +void main() { |
8 | + runApp(GetMaterialApp( | ||
9 | + debugShowCheckedModeBanner: false, | ||
10 | + initialRoute: '/', | ||
11 | + namedRoutes: { | ||
12 | + '/': GetRoute(page: HomePage()), | ||
13 | + '/country': GetRoute(page: CountryPage()), | ||
14 | + '/details': GetRoute(page: DetailsPage()), | ||
15 | + }, | ||
16 | + )); | ||
129 | } | 17 | } |
example/linux/Makefile
0 → 100644
1 | +include app_configuration.mk | ||
2 | + | ||
3 | +# Default build type. | ||
4 | +BUILD=debug | ||
5 | + | ||
6 | +FLUTTER_MANAGED_DIR=flutter | ||
7 | +FLUTTER_EPHEMERAL_DIR=$(FLUTTER_MANAGED_DIR)/ephemeral | ||
8 | + | ||
9 | +# Configuration provided via flutter tool. | ||
10 | +FLUTTER_CONFIG_FILE=$(FLUTTER_EPHEMERAL_DIR)/generated_config.mk | ||
11 | +include $(FLUTTER_CONFIG_FILE) | ||
12 | + | ||
13 | +# Dependency locations | ||
14 | +FLUTTER_APP_DIR=$(CURDIR)/.. | ||
15 | +FLUTTER_APP_BUILD_DIR=$(FLUTTER_APP_DIR)/build | ||
16 | + | ||
17 | +OUT_DIR=$(FLUTTER_APP_BUILD_DIR)/linux | ||
18 | +OBJ_DIR=$(OUT_DIR)/obj/$(BUILD) | ||
19 | + | ||
20 | +# Libraries | ||
21 | +FLUTTER_LIB_NAME=flutter_linux_glfw | ||
22 | +FLUTTER_LIB=$(FLUTTER_EPHEMERAL_DIR)/lib$(FLUTTER_LIB_NAME).so | ||
23 | + | ||
24 | +# Tools | ||
25 | +FLUTTER_BIN=$(FLUTTER_ROOT)/bin/flutter | ||
26 | +LINUX_BUILD=$(FLUTTER_ROOT)/packages/flutter_tools/bin/tool_backend.sh | ||
27 | + | ||
28 | +# Resources | ||
29 | +ICU_DATA_NAME=icudtl.dat | ||
30 | +ICU_DATA_SOURCE=$(FLUTTER_EPHEMERAL_DIR)/$(ICU_DATA_NAME) | ||
31 | +FLUTTER_ASSETS_NAME=flutter_assets | ||
32 | +FLUTTER_ASSETS_SOURCE=$(FLUTTER_APP_BUILD_DIR)/$(FLUTTER_ASSETS_NAME) | ||
33 | + | ||
34 | +# Bundle structure | ||
35 | +BUNDLE_OUT_DIR=$(OUT_DIR)/$(BUILD) | ||
36 | +BUNDLE_DATA_DIR=$(BUNDLE_OUT_DIR)/data | ||
37 | +BUNDLE_LIB_DIR=$(BUNDLE_OUT_DIR)/lib | ||
38 | + | ||
39 | +BIN_OUT=$(BUNDLE_OUT_DIR)/$(BINARY_NAME) | ||
40 | +ICU_DATA_OUT=$(BUNDLE_DATA_DIR)/$(ICU_DATA_NAME) | ||
41 | +FLUTTER_LIB_OUT=$(BUNDLE_LIB_DIR)/$(notdir $(FLUTTER_LIB)) | ||
42 | +ALL_LIBS_OUT=$(FLUTTER_LIB_OUT) \ | ||
43 | + $(foreach lib,$(EXTRA_BUNDLED_LIBRARIES),$(BUNDLE_LIB_DIR)/$(notdir $(lib))) | ||
44 | + | ||
45 | +# Add relevant code from the wrapper library, which is intended to be statically | ||
46 | +# built into the client. | ||
47 | +# Use abspath for the wrapper root, which can contain relative paths; the | ||
48 | +# intermediate build files will be based on the source path, which will cause | ||
49 | +# issues if they start with one or more '../'s. | ||
50 | +WRAPPER_ROOT=$(abspath $(FLUTTER_EPHEMERAL_DIR)/cpp_client_wrapper_glfw) | ||
51 | +WRAPPER_SOURCES= \ | ||
52 | + $(WRAPPER_ROOT)/flutter_window_controller.cc \ | ||
53 | + $(WRAPPER_ROOT)/plugin_registrar.cc \ | ||
54 | + $(WRAPPER_ROOT)/engine_method_result.cc | ||
55 | + | ||
56 | +# Use abspath for extra sources, which may also contain relative paths (see | ||
57 | +# note above about WRAPPER_ROOT). | ||
58 | +SOURCES=main.cc window_configuration.cc \ | ||
59 | + flutter/generated_plugin_registrant.cc \ | ||
60 | + $(WRAPPER_SOURCES) $(abspath $(EXTRA_SOURCES)) | ||
61 | + | ||
62 | +# Headers | ||
63 | +WRAPPER_INCLUDE_DIR=$(WRAPPER_ROOT)/include | ||
64 | +INCLUDE_DIRS=$(FLUTTER_EPHEMERAL_DIR) $(WRAPPER_INCLUDE_DIR) | ||
65 | + | ||
66 | +# Build settings | ||
67 | +ifneq ($(strip $(SYSTEM_LIBRARIES)),) | ||
68 | +EXTRA_CPPFLAGS+=$(patsubst -I%,-isystem%,$(shell pkg-config --cflags $(SYSTEM_LIBRARIES))) | ||
69 | +EXTRA_LDFLAGS+=$(shell pkg-config --libs $(SYSTEM_LIBRARIES)) | ||
70 | +endif | ||
71 | +CXX=clang++ | ||
72 | +CPPFLAGS.release=-DNDEBUG | ||
73 | +CPPFLAGS.profile=$(CPPFLAGS.release) | ||
74 | +CXXFLAGS.release=-O2 | ||
75 | +CXXFLAGS.profile=$(CXXFLAGS.release) | ||
76 | +CXXFLAGS=-std=c++14 -Wall -Werror $(CXXFLAGS.$(BUILD)) $(EXTRA_CXXFLAGS) | ||
77 | +CPPFLAGS=$(patsubst %,-I%,$(INCLUDE_DIRS)) \ | ||
78 | + $(CPPFLAGS.$(BUILD)) $(EXTRA_CPPFLAGS) | ||
79 | +LDFLAGS=-L$(BUNDLE_LIB_DIR) \ | ||
80 | + -l$(FLUTTER_LIB_NAME) \ | ||
81 | + $(EXTRA_LDFLAGS) \ | ||
82 | + -Wl,-rpath=\$$ORIGIN/lib | ||
83 | + | ||
84 | +# Intermediate files. | ||
85 | +OBJ_FILES=$(SOURCES:%.cc=$(OBJ_DIR)/%.o) | ||
86 | +DEPENDENCY_FILES=$(OBJ_FILES:%.o=%.d) | ||
87 | + | ||
88 | +# Targets | ||
89 | + | ||
90 | +.PHONY: all | ||
91 | +all: $(BIN_OUT) bundle | ||
92 | + | ||
93 | +# Add the plugin targets, and their associated settings. | ||
94 | +include $(FLUTTER_MANAGED_DIR)/generated_plugins.mk | ||
95 | +EXTRA_BUNDLED_LIBRARIES+=$(PLUGIN_LIBRARIES) | ||
96 | +EXTRA_LDFLAGS+=$(PLUGIN_LDFLAGS) | ||
97 | +EXTRA_CPPFLAGS+=$(PLUGIN_CPPFLAGS) | ||
98 | + | ||
99 | +# This is a phony target because the flutter tool cannot describe | ||
100 | +# its inputs and outputs yet. | ||
101 | +.PHONY: sync | ||
102 | +sync: $(FLUTTER_CONFIG_FILE) | ||
103 | + $(LINUX_BUILD) linux-x64 $(BUILD) | ||
104 | + | ||
105 | +.PHONY: bundle | ||
106 | +bundle: $(ICU_DATA_OUT) $(ALL_LIBS_OUT) bundleflutterassets | ||
107 | + | ||
108 | +$(BIN_OUT): $(OBJ_FILES) $(ALL_LIBS_OUT) | ||
109 | + mkdir -p $(@D) | ||
110 | + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OBJ_FILES) $(LDFLAGS) -o $@ | ||
111 | + | ||
112 | +$(WRAPPER_SOURCES) $(FLUTTER_LIB) $(ICU_DATA_SOURCE) $(FLUTTER_ASSETS_SOURCE) \ | ||
113 | + $(PLUGIN_TARGETS): | sync | ||
114 | + | ||
115 | +# Plugin library bundling pattern. | ||
116 | +$(BUNDLE_LIB_DIR)/%: $(OUT_DIR)/% | ||
117 | + mkdir -p $(BUNDLE_LIB_DIR) | ||
118 | + cp $< $@ | ||
119 | + | ||
120 | +$(FLUTTER_LIB_OUT): $(FLUTTER_LIB) | ||
121 | + mkdir -p $(@D) | ||
122 | + cp $< $@ | ||
123 | + | ||
124 | +$(ICU_DATA_OUT): $(ICU_DATA_SOURCE) | ||
125 | + mkdir -p $(@D) | ||
126 | + cp $< $@ | ||
127 | + | ||
128 | +-include $(DEPENDENCY_FILES) | ||
129 | + | ||
130 | +$(OBJ_DIR)/%.o : %.cc | sync | ||
131 | + mkdir -p $(@D) | ||
132 | + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -MMD -c $< -o $@ | ||
133 | + | ||
134 | +# Fully re-copy the assets directory on each build to avoid having to keep a | ||
135 | +# comprehensive list of all asset files here, which would be fragile to changes | ||
136 | +# in other files (e.g., adding a new font to pubspec.yaml). | ||
137 | +.PHONY: bundleflutterassets | ||
138 | +bundleflutterassets: $(FLUTTER_ASSETS_SOURCE) | ||
139 | + mkdir -p $(BUNDLE_DATA_DIR) | ||
140 | + rsync -rpu --delete $(FLUTTER_ASSETS_SOURCE) $(BUNDLE_DATA_DIR) | ||
141 | + | ||
142 | +.PHONY: clean | ||
143 | +clean: | ||
144 | + rm -rf $(OUT_DIR); \ | ||
145 | + cd $(FLUTTER_APP_DIR); \ | ||
146 | + $(FLUTTER_BIN) clean |
example/linux/app_configuration.mk
0 → 100644
1 | +# This file contains variables that applications are likely to need to | ||
2 | +# change, to isolate them from the main Makefile where the build rules are still | ||
3 | +# in flux. This should simplify re-creating the runner while preserving local | ||
4 | +# changes. | ||
5 | + | ||
6 | +# Executable name. | ||
7 | +BINARY_NAME=get_state | ||
8 | +# Any extra source files to build. | ||
9 | +EXTRA_SOURCES= | ||
10 | +# Paths of any additional libraries to be bundled in the output directory. | ||
11 | +EXTRA_BUNDLED_LIBRARIES= | ||
12 | +# Extra flags (e.g., for library dependencies). | ||
13 | +SYSTEM_LIBRARIES= | ||
14 | +EXTRA_CXXFLAGS= | ||
15 | +EXTRA_CPPFLAGS= | ||
16 | +EXTRA_LDFLAGS= |
1 | +// | ||
2 | +// Generated file. Do not edit. | ||
3 | +// | ||
4 | + | ||
5 | +#ifndef GENERATED_PLUGIN_REGISTRANT_ | ||
6 | +#define GENERATED_PLUGIN_REGISTRANT_ | ||
7 | + | ||
8 | +#include <flutter/plugin_registry.h> | ||
9 | + | ||
10 | +// Registers Flutter plugins. | ||
11 | +void RegisterPlugins(flutter::PluginRegistry* registry); | ||
12 | + | ||
13 | +#endif // GENERATED_PLUGIN_REGISTRANT_ |
example/linux/flutter/generated_plugins.mk
0 → 100644
1 | +# Plugins to include in the build. | ||
2 | +GENERATED_PLUGINS=\ | ||
3 | + | ||
4 | +GENERATED_PLUGINS_DIR=flutter/ephemeral/.plugin_symlinks | ||
5 | +# A plugin library name plugin name with _plugin appended. | ||
6 | +GENERATED_PLUGIN_LIB_NAMES=$(foreach plugin,$(GENERATED_PLUGINS),$(plugin)_plugin) | ||
7 | + | ||
8 | +# Variables for use in the enclosing Makefile. Changes to these names are | ||
9 | +# breaking changes. | ||
10 | +PLUGIN_TARGETS=$(GENERATED_PLUGINS) | ||
11 | +PLUGIN_LIBRARIES=$(foreach plugin,$(GENERATED_PLUGIN_LIB_NAMES),\ | ||
12 | + $(OUT_DIR)/lib$(plugin).so) | ||
13 | +PLUGIN_LDFLAGS=$(patsubst %,-l%,$(GENERATED_PLUGIN_LIB_NAMES)) | ||
14 | +PLUGIN_CPPFLAGS=$(foreach plugin,$(GENERATED_PLUGINS),\ | ||
15 | + -I$(GENERATED_PLUGINS_DIR)/$(plugin)/linux) | ||
16 | + | ||
17 | +# Targets | ||
18 | + | ||
19 | +# Implicit rules don't match phony targets, so list plugin builds explicitly. | ||
20 | + | ||
21 | +.PHONY: $(GENERATED_PLUGINS) | ||
22 | +$(GENERATED_PLUGINS): | ||
23 | + make -C $(GENERATED_PLUGINS_DIR)/$@/linux \ | ||
24 | + OUT_DIR=$(OUT_DIR) \ | ||
25 | + FLUTTER_EPHEMERAL_DIR="$(abspath flutter/ephemeral)" |
example/linux/main.cc
0 → 100644
1 | +#include <flutter/flutter_window_controller.h> | ||
2 | +#include <linux/limits.h> | ||
3 | +#include <unistd.h> | ||
4 | + | ||
5 | +#include <cstdlib> | ||
6 | +#include <iostream> | ||
7 | +#include <memory> | ||
8 | +#include <vector> | ||
9 | + | ||
10 | +#include "flutter/generated_plugin_registrant.h" | ||
11 | +#include "window_configuration.h" | ||
12 | + | ||
13 | +namespace { | ||
14 | + | ||
15 | +// Returns the path of the directory containing this executable, or an empty | ||
16 | +// string if the directory cannot be found. | ||
17 | +std::string GetExecutableDirectory() { | ||
18 | + char buffer[PATH_MAX + 1]; | ||
19 | + ssize_t length = readlink("/proc/self/exe", buffer, sizeof(buffer)); | ||
20 | + if (length > PATH_MAX) { | ||
21 | + std::cerr << "Couldn't locate executable" << std::endl; | ||
22 | + return ""; | ||
23 | + } | ||
24 | + std::string executable_path(buffer, length); | ||
25 | + size_t last_separator_position = executable_path.find_last_of('/'); | ||
26 | + if (last_separator_position == std::string::npos) { | ||
27 | + std::cerr << "Unabled to find parent directory of " << executable_path | ||
28 | + << std::endl; | ||
29 | + return ""; | ||
30 | + } | ||
31 | + return executable_path.substr(0, last_separator_position); | ||
32 | +} | ||
33 | + | ||
34 | +} // namespace | ||
35 | + | ||
36 | +int main(int argc, char **argv) { | ||
37 | + // Resources are located relative to the executable. | ||
38 | + std::string base_directory = GetExecutableDirectory(); | ||
39 | + if (base_directory.empty()) { | ||
40 | + base_directory = "."; | ||
41 | + } | ||
42 | + std::string data_directory = base_directory + "/data"; | ||
43 | + std::string assets_path = data_directory + "/flutter_assets"; | ||
44 | + std::string icu_data_path = data_directory + "/icudtl.dat"; | ||
45 | + | ||
46 | + // Arguments for the Flutter Engine. | ||
47 | + std::vector<std::string> arguments; | ||
48 | + | ||
49 | + flutter::FlutterWindowController flutter_controller(icu_data_path); | ||
50 | + flutter::WindowProperties window_properties = {}; | ||
51 | + window_properties.title = kFlutterWindowTitle; | ||
52 | + window_properties.width = kFlutterWindowWidth; | ||
53 | + window_properties.height = kFlutterWindowHeight; | ||
54 | + | ||
55 | + // Start the engine. | ||
56 | + if (!flutter_controller.CreateWindow(window_properties, assets_path, | ||
57 | + arguments)) { | ||
58 | + return EXIT_FAILURE; | ||
59 | + } | ||
60 | + RegisterPlugins(&flutter_controller); | ||
61 | + | ||
62 | + // Run until the window is closed. | ||
63 | + while (flutter_controller.RunEventLoopWithTimeout( | ||
64 | + std::chrono::milliseconds::max())) { | ||
65 | + } | ||
66 | + return EXIT_SUCCESS; | ||
67 | +} |
example/linux/window_configuration.cc
0 → 100644
example/linux/window_configuration.h
0 → 100644
1 | +#ifndef WINDOW_CONFIGURATION_ | ||
2 | +#define WINDOW_CONFIGURATION_ | ||
3 | + | ||
4 | +// This is a temporary approach to isolate common customizations from main.cpp, | ||
5 | +// where the APIs are still in flux. This should simplify re-creating the | ||
6 | +// runner while preserving local changes. | ||
7 | +// | ||
8 | +// Longer term there should be simpler configuration options for common | ||
9 | +// customizations like this, without requiring native code changes. | ||
10 | + | ||
11 | +extern const char *kFlutterWindowTitle; | ||
12 | +extern const unsigned int kFlutterWindowWidth; | ||
13 | +extern const unsigned int kFlutterWindowHeight; | ||
14 | + | ||
15 | +#endif // WINDOW_CONFIGURATION_ |
1 | # Generated by pub | 1 | # Generated by pub |
2 | # See https://dart.dev/tools/pub/glossary#lockfile | 2 | # See https://dart.dev/tools/pub/glossary#lockfile |
3 | packages: | 3 | packages: |
4 | - archive: | ||
5 | - dependency: transitive | ||
6 | - description: | ||
7 | - name: archive | ||
8 | - url: "https://pub.dartlang.org" | ||
9 | - source: hosted | ||
10 | - version: "2.0.13" | ||
11 | - args: | ||
12 | - dependency: transitive | ||
13 | - description: | ||
14 | - name: args | ||
15 | - url: "https://pub.dartlang.org" | ||
16 | - source: hosted | ||
17 | - version: "1.6.0" | ||
18 | async: | 4 | async: |
19 | dependency: transitive | 5 | dependency: transitive |
20 | description: | 6 | description: |
@@ -36,34 +22,34 @@ packages: | @@ -36,34 +22,34 @@ packages: | ||
36 | url: "https://pub.dartlang.org" | 22 | url: "https://pub.dartlang.org" |
37 | source: hosted | 23 | source: hosted |
38 | version: "1.1.3" | 24 | version: "1.1.3" |
39 | - collection: | 25 | + clock: |
40 | dependency: transitive | 26 | dependency: transitive |
41 | description: | 27 | description: |
42 | - name: collection | 28 | + name: clock |
43 | url: "https://pub.dartlang.org" | 29 | url: "https://pub.dartlang.org" |
44 | source: hosted | 30 | source: hosted |
45 | - version: "1.14.12" | ||
46 | - convert: | 31 | + version: "1.0.1" |
32 | + collection: | ||
47 | dependency: transitive | 33 | dependency: transitive |
48 | description: | 34 | description: |
49 | - name: convert | 35 | + name: collection |
50 | url: "https://pub.dartlang.org" | 36 | url: "https://pub.dartlang.org" |
51 | source: hosted | 37 | source: hosted |
52 | - version: "2.1.1" | ||
53 | - crypto: | ||
54 | - dependency: transitive | 38 | + version: "1.14.12" |
39 | + dio: | ||
40 | + dependency: "direct main" | ||
55 | description: | 41 | description: |
56 | - name: crypto | 42 | + name: dio |
57 | url: "https://pub.dartlang.org" | 43 | url: "https://pub.dartlang.org" |
58 | source: hosted | 44 | source: hosted |
59 | - version: "2.1.4" | ||
60 | - cupertino_icons: | ||
61 | - dependency: "direct main" | 45 | + version: "3.0.9" |
46 | + fake_async: | ||
47 | + dependency: transitive | ||
62 | description: | 48 | description: |
63 | - name: cupertino_icons | 49 | + name: fake_async |
64 | url: "https://pub.dartlang.org" | 50 | url: "https://pub.dartlang.org" |
65 | source: hosted | 51 | source: hosted |
66 | - version: "0.1.3" | 52 | + version: "1.1.0" |
67 | flutter: | 53 | flutter: |
68 | dependency: "direct main" | 54 | dependency: "direct main" |
69 | description: flutter | 55 | description: flutter |
@@ -80,14 +66,14 @@ packages: | @@ -80,14 +66,14 @@ packages: | ||
80 | name: get | 66 | name: get |
81 | url: "https://pub.dartlang.org" | 67 | url: "https://pub.dartlang.org" |
82 | source: hosted | 68 | source: hosted |
83 | - version: "1.15.2" | ||
84 | - image: | 69 | + version: "2.0.8-dev" |
70 | + http_parser: | ||
85 | dependency: transitive | 71 | dependency: transitive |
86 | description: | 72 | description: |
87 | - name: image | 73 | + name: http_parser |
88 | url: "https://pub.dartlang.org" | 74 | url: "https://pub.dartlang.org" |
89 | source: hosted | 75 | source: hosted |
90 | - version: "2.1.12" | 76 | + version: "3.1.4" |
91 | matcher: | 77 | matcher: |
92 | dependency: transitive | 78 | dependency: transitive |
93 | description: | 79 | description: |
@@ -108,21 +94,7 @@ packages: | @@ -108,21 +94,7 @@ packages: | ||
108 | name: path | 94 | name: path |
109 | url: "https://pub.dartlang.org" | 95 | url: "https://pub.dartlang.org" |
110 | source: hosted | 96 | source: hosted |
111 | - version: "1.6.4" | ||
112 | - petitparser: | ||
113 | - dependency: transitive | ||
114 | - description: | ||
115 | - name: petitparser | ||
116 | - url: "https://pub.dartlang.org" | ||
117 | - source: hosted | ||
118 | - version: "2.4.0" | ||
119 | - quiver: | ||
120 | - dependency: transitive | ||
121 | - description: | ||
122 | - name: quiver | ||
123 | - url: "https://pub.dartlang.org" | ||
124 | - source: hosted | ||
125 | - version: "2.1.3" | 97 | + version: "1.7.0" |
126 | sky_engine: | 98 | sky_engine: |
127 | dependency: transitive | 99 | dependency: transitive |
128 | description: flutter | 100 | description: flutter |
@@ -184,12 +156,5 @@ packages: | @@ -184,12 +156,5 @@ packages: | ||
184 | url: "https://pub.dartlang.org" | 156 | url: "https://pub.dartlang.org" |
185 | source: hosted | 157 | source: hosted |
186 | version: "2.0.8" | 158 | version: "2.0.8" |
187 | - xml: | ||
188 | - dependency: transitive | ||
189 | - description: | ||
190 | - name: xml | ||
191 | - url: "https://pub.dartlang.org" | ||
192 | - source: hosted | ||
193 | - version: "3.6.1" | ||
194 | sdks: | 159 | sdks: |
195 | - dart: ">=2.6.0 <3.0.0" | 160 | + dart: ">=2.7.0 <3.0.0" |
1 | -name: profileweb | 1 | +name: get_state |
2 | description: A new Flutter project. | 2 | description: A new Flutter project. |
3 | 3 | ||
4 | +# The following line prevents the package from being accidentally published to | ||
5 | +# pub.dev using `pub publish`. This is preferred for private packages. | ||
6 | +publish_to: 'none' # Remove this line if you wish to publish to pub.dev | ||
7 | + | ||
4 | # The following defines the version and build number for your application. | 8 | # 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 | 9 | # A version number is three numbers separated by dots, like 1.2.43 |
6 | # followed by an optional build number separated by a +. | 10 | # followed by an optional build number separated by a +. |
@@ -14,22 +18,22 @@ description: A new Flutter project. | @@ -14,22 +18,22 @@ description: A new Flutter project. | ||
14 | version: 1.0.0+1 | 18 | version: 1.0.0+1 |
15 | 19 | ||
16 | environment: | 20 | environment: |
17 | - sdk: ">=2.1.0 <3.0.0" | 21 | + sdk: ">=2.7.0 <3.0.0" |
18 | 22 | ||
19 | dependencies: | 23 | dependencies: |
20 | flutter: | 24 | flutter: |
21 | sdk: flutter | 25 | sdk: flutter |
22 | 26 | ||
27 | + | ||
23 | # The following adds the Cupertino Icons font to your application. | 28 | # The following adds the Cupertino Icons font to your application. |
24 | # Use with the CupertinoIcons class for iOS style icons. | 29 | # Use with the CupertinoIcons class for iOS style icons. |
25 | - cupertino_icons: ^0.1.2 | ||
26 | - get: | 30 | + get: ^2.0.8-dev |
31 | + dio: ^3.0.9 | ||
27 | 32 | ||
28 | dev_dependencies: | 33 | dev_dependencies: |
29 | flutter_test: | 34 | flutter_test: |
30 | sdk: flutter | 35 | sdk: flutter |
31 | 36 | ||
32 | - | ||
33 | # For information on the generic Dart part of this file, see the | 37 | # For information on the generic Dart part of this file, see the |
34 | # following page: https://dart.dev/tools/pub/pubspec | 38 | # following page: https://dart.dev/tools/pub/pubspec |
35 | 39 | ||
@@ -43,8 +47,8 @@ flutter: | @@ -43,8 +47,8 @@ flutter: | ||
43 | 47 | ||
44 | # To add assets to your application, add an assets section, like this: | 48 | # To add assets to your application, add an assets section, like this: |
45 | # assets: | 49 | # assets: |
46 | - # - images/a_dot_burr.jpeg | ||
47 | - # - images/a_dot_ham.jpeg | 50 | + # - images/a_dot_burr.jpeg |
51 | + # - images/a_dot_ham.jpeg | ||
48 | 52 | ||
49 | # An image asset can refer to one or more resolution-specific "variants", see | 53 | # An image asset can refer to one or more resolution-specific "variants", see |
50 | # https://flutter.dev/assets-and-images/#resolution-aware. | 54 | # https://flutter.dev/assets-and-images/#resolution-aware. |
@@ -70,4 +74,4 @@ flutter: | @@ -70,4 +74,4 @@ flutter: | ||
70 | # weight: 700 | 74 | # weight: 700 |
71 | # | 75 | # |
72 | # For details regarding fonts from package dependencies, | 76 | # For details regarding fonts from package dependencies, |
73 | - # see https://flutter.dev/custom-fonts/#from-packages | 77 | + # see https://flutter.dev/custom-fonts/#from-packages |
example/test/widget_test.dart
0 → 100644
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:get_state/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 | +// } |
example/web/favicon.png
0 → 100644

917 Bytes
example/web/icons/Icon-192.png
0 → 100644

5.17 KB
example/web/icons/Icon-512.png
0 → 100644

8.06 KB
example/web/index.html
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | +<head> | ||
4 | + <meta charset="UTF-8"> | ||
5 | + <meta content="IE=Edge" http-equiv="X-UA-Compatible"> | ||
6 | + <meta name="description" content="A new Flutter project."> | ||
7 | + | ||
8 | + <!-- iOS meta tags & icons --> | ||
9 | + <meta name="apple-mobile-web-app-capable" content="yes"> | ||
10 | + <meta name="apple-mobile-web-app-status-bar-style" content="black"> | ||
11 | + <meta name="apple-mobile-web-app-title" content="get_state"> | ||
12 | + <link rel="apple-touch-icon" href="icons/Icon-192.png"> | ||
13 | + | ||
14 | + <!-- Favicon --> | ||
15 | + <link rel="shortcut icon" type="image/png" href="favicon.png"/> | ||
16 | + | ||
17 | + <title>get_state</title> | ||
18 | + <link rel="manifest" href="manifest.json"> | ||
19 | +</head> | ||
20 | +<body> | ||
21 | + <!-- This script installs service_worker.js to provide PWA functionality to | ||
22 | + application. For more information, see: | ||
23 | + https://developers.google.com/web/fundamentals/primers/service-workers --> | ||
24 | + <script> | ||
25 | + if ('serviceWorker' in navigator) { | ||
26 | + window.addEventListener('load', function () { | ||
27 | + navigator.serviceWorker.register('flutter_service_worker.js'); | ||
28 | + }); | ||
29 | + } | ||
30 | + </script> | ||
31 | + <script src="main.dart.js" type="application/javascript"></script> | ||
32 | +</body> | ||
33 | +</html> |
example/web/manifest.json
0 → 100644
1 | +{ | ||
2 | + "name": "get_state", | ||
3 | + "short_name": "get_state", | ||
4 | + "start_url": ".", | ||
5 | + "display": "minimal-ui", | ||
6 | + "background_color": "#0175C2", | ||
7 | + "theme_color": "#0175C2", | ||
8 | + "description": "A new Flutter project.", | ||
9 | + "orientation": "portrait-primary", | ||
10 | + "prefer_related_applications": false, | ||
11 | + "icons": [ | ||
12 | + { | ||
13 | + "src": "icons/Icon-192.png", | ||
14 | + "sizes": "192x192", | ||
15 | + "type": "image/png" | ||
16 | + }, | ||
17 | + { | ||
18 | + "src": "icons/Icon-512.png", | ||
19 | + "sizes": "512x512", | ||
20 | + "type": "image/png" | ||
21 | + } | ||
22 | + ] | ||
23 | +} |
-
Please register or login to post a comment