├── .DS_Store ├── .idea ├── codeStyles │ └── Project.xml ├── libraries │ ├── Dart_Packages.xml │ ├── Dart_SDK.xml │ └── Flutter_Plugins.xml └── vcs.xml ├── README.md ├── android ├── .gitignore ├── .idea │ ├── caches │ │ └── build_file_checksums.ser │ ├── codeStyles │ │ └── Project.xml │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ └── runConfigurations.xml ├── app │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── aeologic │ │ │ └── flutterlocalizationapp │ │ │ └── MainActivity.java │ │ └── res │ │ ├── drawable │ │ └── launch_background.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ └── values │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── assets └── images │ ├── ic_banner.png │ ├── ic_flutter_devs_logo.png │ └── ic_powered_by.png ├── flutter_localization_app.iml ├── flutter_localization_app_android.iml ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── main.m ├── lib ├── constant │ └── Constant.dart ├── generated │ └── i18n.dart ├── localization │ └── localizations.dart ├── main.dart ├── model │ └── RadioModel.dart └── screen │ ├── HomeScreen.dart │ └── SplashScreen.dart ├── pubspec.lock ├── pubspec.yaml ├── res └── values │ └── strings_en.arb ├── screens ├── .DS_Store ├── android1.jpg ├── android2.jpg ├── demo.gif ├── iphone1.jpg └── iphone2.jpg └── test └── widget_test.dart /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/.DS_Store -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_Packages.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_Plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flutter Localization Demo 2 | 3 | A Flutter application to showcase localisation. 4 | 5 | 6 | # Demo 7 | 8 | 9 | 10 | 11 | # Android Screen 12 | 13 | 14 | 15 | # iOS Screen 16 | 17 | 18 | 19 | ## Getting Started 20 | 21 | For help getting started with Flutter, view our online 22 | [documentation](https://flutter.io/). 23 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.class 3 | .gradle 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | GeneratedPluginRegistrant.java 11 | -------------------------------------------------------------------------------- /android/.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/android/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /android/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /android/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /android/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | -------------------------------------------------------------------------------- /android/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 27 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.aeologic.flutterlocalizationapp" 37 | minSdkVersion 16 38 | targetSdkVersion 27 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 61 | } 62 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/aeologic/flutterlocalizationapp/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.aeologic.flutterlocalizationapp; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.1.2' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 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 "$@" 161 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 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 91 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /assets/images/ic_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/assets/images/ic_banner.png -------------------------------------------------------------------------------- /assets/images/ic_flutter_devs_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/assets/images/ic_flutter_devs_logo.png -------------------------------------------------------------------------------- /assets/images/ic_powered_by.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/assets/images/ic_powered_by.png -------------------------------------------------------------------------------- /flutter_localization_app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /flutter_localization_app_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/app.flx 37 | /Flutter/app.zip 38 | /Flutter/flutter_assets/ 39 | /Flutter/App.framework 40 | /Flutter/Flutter.framework 41 | /Flutter/Generated.xcconfig 42 | /ServiceDefinitions.json 43 | 44 | Pods/ 45 | .symlinks/ 46 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | def parse_KV_file(file, separator='=') 8 | file_abs_path = File.expand_path(file) 9 | if !File.exists? file_abs_path 10 | return []; 11 | end 12 | pods_ary = [] 13 | skip_line_start_symbols = ["#", "/"] 14 | File.foreach(file_abs_path) { |line| 15 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 16 | plugin = line.split(pattern=separator) 17 | if plugin.length == 2 18 | podname = plugin[0].strip() 19 | path = plugin[1].strip() 20 | podpath = File.expand_path("#{path}", file_abs_path) 21 | pods_ary.push({:name => podname, :path => podpath}); 22 | else 23 | puts "Invalid plugin specification: #{line}" 24 | end 25 | } 26 | return pods_ary 27 | end 28 | 29 | target 'Runner' do 30 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 31 | # referring to absolute paths on developers' machines. 32 | system('rm -rf .symlinks') 33 | system('mkdir -p .symlinks/plugins') 34 | 35 | # Flutter Pods 36 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') 37 | if generated_xcode_build_settings.empty? 38 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." 39 | end 40 | generated_xcode_build_settings.map { |p| 41 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR' 42 | symlink = File.join('.symlinks', 'flutter') 43 | File.symlink(File.dirname(p[:path]), symlink) 44 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) 45 | end 46 | } 47 | 48 | # Plugin Pods 49 | plugin_pods = parse_KV_file('../.flutter-plugins') 50 | plugin_pods.map { |p| 51 | symlink = File.join('.symlinks', 'plugins', p[:name]) 52 | File.symlink(p[:path], symlink) 53 | pod p[:name], :path => File.join(symlink, 'ios') 54 | } 55 | end 56 | 57 | post_install do |installer| 58 | installer.pods_project.targets.each do |target| 59 | target.build_configurations.each do |config| 60 | config.build_settings['ENABLE_BITCODE'] = 'NO' 61 | end 62 | end 63 | end 64 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - shared_preferences (0.0.1): 4 | - Flutter 5 | 6 | DEPENDENCIES: 7 | - Flutter (from `.symlinks/flutter/ios`) 8 | - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) 9 | 10 | EXTERNAL SOURCES: 11 | Flutter: 12 | :path: ".symlinks/flutter/ios" 13 | shared_preferences: 14 | :path: ".symlinks/plugins/shared_preferences/ios" 15 | 16 | SPEC CHECKSUMS: 17 | Flutter: 9d0fac939486c9aba2809b7982dfdbb47a7b0296 18 | shared_preferences: 5a1d487c427ee18fcd3ea1f2a131569481834b53 19 | 20 | PODFILE CHECKSUM: 1e5af4103afd21ca5ead147d7b81d06f494f51a2 21 | 22 | COCOAPODS: 1.5.3 23 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 17 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 18 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 19 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 20 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 21 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 22 | B9FADCCFA42E25DF2D0FD4ED /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 782DBC592DF7A1CFF01AC24E /* libPods-Runner.a */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXCopyFilesBuildPhase section */ 26 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 27 | isa = PBXCopyFilesBuildPhase; 28 | buildActionMask = 2147483647; 29 | dstPath = ""; 30 | dstSubfolderSpec = 10; 31 | files = ( 32 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 33 | ); 34 | name = "Embed Frameworks"; 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 42 | 160FEEEFCBBEBCC8B17453F2 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 43 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; 44 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 45 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 46 | 782DBC592DF7A1CFF01AC24E /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 48 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 49 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 50 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 51 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 52 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 53 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 55 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 56 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 57 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 58 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 59 | EFBBE9EEFC10DB19702E4680 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 68 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 69 | B9FADCCFA42E25DF2D0FD4ED /* libPods-Runner.a in Frameworks */, 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | /* End PBXFrameworksBuildPhase section */ 74 | 75 | /* Begin PBXGroup section */ 76 | 526C1CB2C9316E15D732CB2A /* Frameworks */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 782DBC592DF7A1CFF01AC24E /* libPods-Runner.a */, 80 | ); 81 | name = Frameworks; 82 | sourceTree = ""; 83 | }; 84 | 66B82DA5D2AEAE62E557F364 /* Pods */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 160FEEEFCBBEBCC8B17453F2 /* Pods-Runner.debug.xcconfig */, 88 | EFBBE9EEFC10DB19702E4680 /* Pods-Runner.release.xcconfig */, 89 | ); 90 | path = Pods; 91 | sourceTree = ""; 92 | }; 93 | 9740EEB11CF90186004384FC /* Flutter */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, 97 | 3B80C3931E831B6300D905FE /* App.framework */, 98 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 99 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 100 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 101 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 102 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 103 | ); 104 | name = Flutter; 105 | sourceTree = ""; 106 | }; 107 | 97C146E51CF9000F007C117D = { 108 | isa = PBXGroup; 109 | children = ( 110 | 9740EEB11CF90186004384FC /* Flutter */, 111 | 97C146F01CF9000F007C117D /* Runner */, 112 | 97C146EF1CF9000F007C117D /* Products */, 113 | 66B82DA5D2AEAE62E557F364 /* Pods */, 114 | 526C1CB2C9316E15D732CB2A /* Frameworks */, 115 | ); 116 | sourceTree = ""; 117 | }; 118 | 97C146EF1CF9000F007C117D /* Products */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 97C146EE1CF9000F007C117D /* Runner.app */, 122 | ); 123 | name = Products; 124 | sourceTree = ""; 125 | }; 126 | 97C146F01CF9000F007C117D /* Runner */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 130 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 131 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 132 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 133 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 134 | 97C147021CF9000F007C117D /* Info.plist */, 135 | 97C146F11CF9000F007C117D /* Supporting Files */, 136 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 137 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 138 | ); 139 | path = Runner; 140 | sourceTree = ""; 141 | }; 142 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 97C146F21CF9000F007C117D /* main.m */, 146 | ); 147 | name = "Supporting Files"; 148 | sourceTree = ""; 149 | }; 150 | /* End PBXGroup section */ 151 | 152 | /* Begin PBXNativeTarget section */ 153 | 97C146ED1CF9000F007C117D /* Runner */ = { 154 | isa = PBXNativeTarget; 155 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 156 | buildPhases = ( 157 | AB16C02AE971BB338889D2CF /* [CP] Check Pods Manifest.lock */, 158 | 9740EEB61CF901F6004384FC /* Run Script */, 159 | 97C146EA1CF9000F007C117D /* Sources */, 160 | 97C146EB1CF9000F007C117D /* Frameworks */, 161 | 97C146EC1CF9000F007C117D /* Resources */, 162 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 163 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 164 | 25DB1CFC47324FAAC67B98A1 /* [CP] Embed Pods Frameworks */, 165 | ); 166 | buildRules = ( 167 | ); 168 | dependencies = ( 169 | ); 170 | name = Runner; 171 | productName = Runner; 172 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 173 | productType = "com.apple.product-type.application"; 174 | }; 175 | /* End PBXNativeTarget section */ 176 | 177 | /* Begin PBXProject section */ 178 | 97C146E61CF9000F007C117D /* Project object */ = { 179 | isa = PBXProject; 180 | attributes = { 181 | LastUpgradeCheck = 0910; 182 | ORGANIZATIONNAME = "The Chromium Authors"; 183 | TargetAttributes = { 184 | 97C146ED1CF9000F007C117D = { 185 | CreatedOnToolsVersion = 7.3.1; 186 | }; 187 | }; 188 | }; 189 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 190 | compatibilityVersion = "Xcode 3.2"; 191 | developmentRegion = English; 192 | hasScannedForEncodings = 0; 193 | knownRegions = ( 194 | en, 195 | Base, 196 | ); 197 | mainGroup = 97C146E51CF9000F007C117D; 198 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 199 | projectDirPath = ""; 200 | projectRoot = ""; 201 | targets = ( 202 | 97C146ED1CF9000F007C117D /* Runner */, 203 | ); 204 | }; 205 | /* End PBXProject section */ 206 | 207 | /* Begin PBXResourcesBuildPhase section */ 208 | 97C146EC1CF9000F007C117D /* Resources */ = { 209 | isa = PBXResourcesBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 213 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 214 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 215 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 216 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, 217 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 218 | ); 219 | runOnlyForDeploymentPostprocessing = 0; 220 | }; 221 | /* End PBXResourcesBuildPhase section */ 222 | 223 | /* Begin PBXShellScriptBuildPhase section */ 224 | 25DB1CFC47324FAAC67B98A1 /* [CP] Embed Pods Frameworks */ = { 225 | isa = PBXShellScriptBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | ); 229 | inputFileListPaths = ( 230 | ); 231 | inputPaths = ( 232 | "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", 233 | "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", 234 | ); 235 | name = "[CP] Embed Pods Frameworks"; 236 | outputFileListPaths = ( 237 | ); 238 | outputPaths = ( 239 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", 240 | ); 241 | runOnlyForDeploymentPostprocessing = 0; 242 | shellPath = /bin/sh; 243 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 244 | showEnvVarsInLog = 0; 245 | }; 246 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 247 | isa = PBXShellScriptBuildPhase; 248 | buildActionMask = 2147483647; 249 | files = ( 250 | ); 251 | inputPaths = ( 252 | ); 253 | name = "Thin Binary"; 254 | outputPaths = ( 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | shellPath = /bin/sh; 258 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin\n"; 259 | }; 260 | 9740EEB61CF901F6004384FC /* Run Script */ = { 261 | isa = PBXShellScriptBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | ); 265 | inputPaths = ( 266 | ); 267 | name = "Run Script"; 268 | outputPaths = ( 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | shellPath = /bin/sh; 272 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 273 | }; 274 | AB16C02AE971BB338889D2CF /* [CP] Check Pods Manifest.lock */ = { 275 | isa = PBXShellScriptBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | ); 279 | inputFileListPaths = ( 280 | ); 281 | inputPaths = ( 282 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 283 | "${PODS_ROOT}/Manifest.lock", 284 | ); 285 | name = "[CP] Check Pods Manifest.lock"; 286 | outputFileListPaths = ( 287 | ); 288 | outputPaths = ( 289 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | shellPath = /bin/sh; 293 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 294 | showEnvVarsInLog = 0; 295 | }; 296 | /* End PBXShellScriptBuildPhase section */ 297 | 298 | /* Begin PBXSourcesBuildPhase section */ 299 | 97C146EA1CF9000F007C117D /* Sources */ = { 300 | isa = PBXSourcesBuildPhase; 301 | buildActionMask = 2147483647; 302 | files = ( 303 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 304 | 97C146F31CF9000F007C117D /* main.m in Sources */, 305 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 306 | ); 307 | runOnlyForDeploymentPostprocessing = 0; 308 | }; 309 | /* End PBXSourcesBuildPhase section */ 310 | 311 | /* Begin PBXVariantGroup section */ 312 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 313 | isa = PBXVariantGroup; 314 | children = ( 315 | 97C146FB1CF9000F007C117D /* Base */, 316 | ); 317 | name = Main.storyboard; 318 | sourceTree = ""; 319 | }; 320 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 321 | isa = PBXVariantGroup; 322 | children = ( 323 | 97C147001CF9000F007C117D /* Base */, 324 | ); 325 | name = LaunchScreen.storyboard; 326 | sourceTree = ""; 327 | }; 328 | /* End PBXVariantGroup section */ 329 | 330 | /* Begin XCBuildConfiguration section */ 331 | 97C147031CF9000F007C117D /* Debug */ = { 332 | isa = XCBuildConfiguration; 333 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 334 | buildSettings = { 335 | ALWAYS_SEARCH_USER_PATHS = NO; 336 | CLANG_ANALYZER_NONNULL = YES; 337 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 338 | CLANG_CXX_LIBRARY = "libc++"; 339 | CLANG_ENABLE_MODULES = YES; 340 | CLANG_ENABLE_OBJC_ARC = YES; 341 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 342 | CLANG_WARN_BOOL_CONVERSION = YES; 343 | CLANG_WARN_COMMA = YES; 344 | CLANG_WARN_CONSTANT_CONVERSION = YES; 345 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 346 | CLANG_WARN_EMPTY_BODY = YES; 347 | CLANG_WARN_ENUM_CONVERSION = YES; 348 | CLANG_WARN_INFINITE_RECURSION = YES; 349 | CLANG_WARN_INT_CONVERSION = YES; 350 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 351 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 352 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 353 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 354 | CLANG_WARN_STRICT_PROTOTYPES = YES; 355 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 356 | CLANG_WARN_UNREACHABLE_CODE = YES; 357 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 358 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 359 | COPY_PHASE_STRIP = NO; 360 | DEBUG_INFORMATION_FORMAT = dwarf; 361 | ENABLE_STRICT_OBJC_MSGSEND = YES; 362 | ENABLE_TESTABILITY = YES; 363 | GCC_C_LANGUAGE_STANDARD = gnu99; 364 | GCC_DYNAMIC_NO_PIC = NO; 365 | GCC_NO_COMMON_BLOCKS = YES; 366 | GCC_OPTIMIZATION_LEVEL = 0; 367 | GCC_PREPROCESSOR_DEFINITIONS = ( 368 | "DEBUG=1", 369 | "$(inherited)", 370 | ); 371 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 372 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 373 | GCC_WARN_UNDECLARED_SELECTOR = YES; 374 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 375 | GCC_WARN_UNUSED_FUNCTION = YES; 376 | GCC_WARN_UNUSED_VARIABLE = YES; 377 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 378 | MTL_ENABLE_DEBUG_INFO = YES; 379 | ONLY_ACTIVE_ARCH = YES; 380 | SDKROOT = iphoneos; 381 | TARGETED_DEVICE_FAMILY = "1,2"; 382 | }; 383 | name = Debug; 384 | }; 385 | 97C147041CF9000F007C117D /* Release */ = { 386 | isa = XCBuildConfiguration; 387 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 388 | buildSettings = { 389 | ALWAYS_SEARCH_USER_PATHS = NO; 390 | CLANG_ANALYZER_NONNULL = YES; 391 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 392 | CLANG_CXX_LIBRARY = "libc++"; 393 | CLANG_ENABLE_MODULES = YES; 394 | CLANG_ENABLE_OBJC_ARC = YES; 395 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 396 | CLANG_WARN_BOOL_CONVERSION = YES; 397 | CLANG_WARN_COMMA = YES; 398 | CLANG_WARN_CONSTANT_CONVERSION = YES; 399 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 400 | CLANG_WARN_EMPTY_BODY = YES; 401 | CLANG_WARN_ENUM_CONVERSION = YES; 402 | CLANG_WARN_INFINITE_RECURSION = YES; 403 | CLANG_WARN_INT_CONVERSION = YES; 404 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 405 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 406 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 407 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 408 | CLANG_WARN_STRICT_PROTOTYPES = YES; 409 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 410 | CLANG_WARN_UNREACHABLE_CODE = YES; 411 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 412 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 413 | COPY_PHASE_STRIP = NO; 414 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 415 | ENABLE_NS_ASSERTIONS = NO; 416 | ENABLE_STRICT_OBJC_MSGSEND = YES; 417 | GCC_C_LANGUAGE_STANDARD = gnu99; 418 | GCC_NO_COMMON_BLOCKS = YES; 419 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 420 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 421 | GCC_WARN_UNDECLARED_SELECTOR = YES; 422 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 423 | GCC_WARN_UNUSED_FUNCTION = YES; 424 | GCC_WARN_UNUSED_VARIABLE = YES; 425 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 426 | MTL_ENABLE_DEBUG_INFO = NO; 427 | SDKROOT = iphoneos; 428 | TARGETED_DEVICE_FAMILY = "1,2"; 429 | VALIDATE_PRODUCT = YES; 430 | }; 431 | name = Release; 432 | }; 433 | 97C147061CF9000F007C117D /* Debug */ = { 434 | isa = XCBuildConfiguration; 435 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 436 | buildSettings = { 437 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 438 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 439 | ENABLE_BITCODE = NO; 440 | FRAMEWORK_SEARCH_PATHS = ( 441 | "$(inherited)", 442 | "$(PROJECT_DIR)/Flutter", 443 | ); 444 | INFOPLIST_FILE = Runner/Info.plist; 445 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 446 | LIBRARY_SEARCH_PATHS = ( 447 | "$(inherited)", 448 | "$(PROJECT_DIR)/Flutter", 449 | ); 450 | PRODUCT_BUNDLE_IDENTIFIER = com.aeologic.flutterLocalizationApp; 451 | PRODUCT_NAME = "$(TARGET_NAME)"; 452 | VERSIONING_SYSTEM = "apple-generic"; 453 | }; 454 | name = Debug; 455 | }; 456 | 97C147071CF9000F007C117D /* Release */ = { 457 | isa = XCBuildConfiguration; 458 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 459 | buildSettings = { 460 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 461 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 462 | ENABLE_BITCODE = NO; 463 | FRAMEWORK_SEARCH_PATHS = ( 464 | "$(inherited)", 465 | "$(PROJECT_DIR)/Flutter", 466 | ); 467 | INFOPLIST_FILE = Runner/Info.plist; 468 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 469 | LIBRARY_SEARCH_PATHS = ( 470 | "$(inherited)", 471 | "$(PROJECT_DIR)/Flutter", 472 | ); 473 | PRODUCT_BUNDLE_IDENTIFIER = com.aeologic.flutterLocalizationApp; 474 | PRODUCT_NAME = "$(TARGET_NAME)"; 475 | VERSIONING_SYSTEM = "apple-generic"; 476 | }; 477 | name = Release; 478 | }; 479 | /* End XCBuildConfiguration section */ 480 | 481 | /* Begin XCConfigurationList section */ 482 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 483 | isa = XCConfigurationList; 484 | buildConfigurations = ( 485 | 97C147031CF9000F007C117D /* Debug */, 486 | 97C147041CF9000F007C117D /* Release */, 487 | ); 488 | defaultConfigurationIsVisible = 0; 489 | defaultConfigurationName = Release; 490 | }; 491 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 492 | isa = XCConfigurationList; 493 | buildConfigurations = ( 494 | 97C147061CF9000F007C117D /* Debug */, 495 | 97C147071CF9000F007C117D /* Release */, 496 | ); 497 | defaultConfigurationIsVisible = 0; 498 | defaultConfigurationName = Release; 499 | }; 500 | /* End XCConfigurationList section */ 501 | }; 502 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 503 | } 504 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_localization_app 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/constant/Constant.dart: -------------------------------------------------------------------------------- 1 | final String HOME_SCREEN='/HOME_SCREEN'; -------------------------------------------------------------------------------- /lib/generated/i18n.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'dart:async'; 3 | 4 | import 'package:flutter/foundation.dart'; 5 | import 'package:flutter/material.dart'; 6 | // ignore_for_file: non_constant_identifier_names 7 | // ignore_for_file: camel_case_types 8 | // ignore_for_file: prefer_single_quotes 9 | 10 | //This file is automatically generated. DO NOT EDIT, all your changes would be lost. 11 | 12 | class S implements WidgetsLocalizations { 13 | const S(); 14 | 15 | static const GeneratedLocalizationsDelegate delegate = 16 | const GeneratedLocalizationsDelegate(); 17 | 18 | static S of(BuildContext context) => 19 | Localizations.of(context, WidgetsLocalizations); 20 | 21 | @override 22 | TextDirection get textDirection => TextDirection.ltr; 23 | 24 | } 25 | 26 | class en extends S { 27 | const en(); 28 | } 29 | 30 | 31 | class GeneratedLocalizationsDelegate extends LocalizationsDelegate { 32 | const GeneratedLocalizationsDelegate(); 33 | 34 | List get supportedLocales { 35 | return const [ 36 | 37 | const Locale("en", ""), 38 | 39 | ]; 40 | } 41 | 42 | LocaleResolutionCallback resolution({Locale fallback}) { 43 | return (Locale locale, Iterable supported) { 44 | final Locale languageLocale = new Locale(locale.languageCode, ""); 45 | if (supported.contains(locale)) 46 | return locale; 47 | else if (supported.contains(languageLocale)) 48 | return languageLocale; 49 | else { 50 | final Locale fallbackLocale = fallback ?? supported.first; 51 | return fallbackLocale; 52 | } 53 | }; 54 | } 55 | 56 | @override 57 | Future load(Locale locale) { 58 | final String lang = getLang(locale); 59 | switch (lang) { 60 | 61 | case "en": 62 | return new SynchronousFuture(const en()); 63 | 64 | default: 65 | return new SynchronousFuture(const S()); 66 | } 67 | } 68 | 69 | @override 70 | bool isSupported(Locale locale) => supportedLocales.contains(locale); 71 | 72 | @override 73 | bool shouldReload(GeneratedLocalizationsDelegate old) => false; 74 | } 75 | 76 | String getLang(Locale l) => l.countryCode != null && l.countryCode.isEmpty 77 | ? l.languageCode 78 | : l.toString(); 79 | -------------------------------------------------------------------------------- /lib/localization/localizations.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter/foundation.dart' show SynchronousFuture; 6 | class AppLocalizations { 7 | AppLocalizations(this.locale); 8 | 9 | final Locale locale; 10 | 11 | static AppLocalizations of(BuildContext context) { 12 | return Localizations.of(context, AppLocalizations); 13 | } 14 | 15 | static Map> _localizedValues = { 16 | 'en': { 17 | 'appName': 'Localization Demo', 18 | 'appNameShort': 'Localization', 19 | 'title': 'FlutterDevs', 20 | 'desc': 'FlutterDevs intent to deliver Flutter apps with ' 21 | 'high quality. We’ve adopted Design First attitude ' 22 | 'which helps us deliver applications of highest quality.', 23 | }, 24 | 'hi': { 25 | 'appName': 'लोकलाइजेशन डेमो', 26 | 'appNameShort': 'लोकलाइजेशन', 27 | 'title': 'फ्लूटेरडेव्स', 28 | 'desc': 'FlutterDevs उच्च गुणवत्ता वाले Flutter ऐप्स वितरित करने ' 29 | 'का इरादा रखता है। हमने डिजाइन फर्स्ट रवैया अपनाया है जो हमें ' 30 | 'उच्चतम गुणवत्ता के अनुप्रयोगों को वितरित करने में मदद करता है।', 31 | }, 32 | }; 33 | 34 | String get appName { 35 | return _localizedValues[locale.languageCode]['appName']; 36 | } 37 | String get appNameShort { 38 | return _localizedValues[locale.languageCode]['appNameShort']; 39 | } 40 | String get title { 41 | return _localizedValues[locale.languageCode]['title']; 42 | } 43 | String get desc { 44 | return _localizedValues[locale.languageCode]['desc']; 45 | } 46 | } 47 | 48 | class AppLocalizationsDelegate extends LocalizationsDelegate { 49 | const AppLocalizationsDelegate(); 50 | 51 | @override 52 | bool isSupported(Locale locale) => ['en', 'hi'].contains(locale.languageCode); 53 | 54 | @override 55 | Future load(Locale locale) { 56 | return SynchronousFuture(AppLocalizations(locale)); 57 | } 58 | 59 | @override 60 | bool shouldReload(AppLocalizationsDelegate old) => false; 61 | } -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | /*import 'package:flutter/material.dart'; 2 | 3 | void main() => runApp(new MyApp()); 4 | 5 | class MyApp extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return new MaterialApp( 9 | title: 'Localization Demo', 10 | theme: new ThemeData( 11 | primarySwatch: Colors.blue, 12 | ), 13 | home: new MyHomePage(title: 'Localization'), 14 | ); 15 | } 16 | } 17 | 18 | class MyHomePage extends StatefulWidget { 19 | MyHomePage({Key key, this.title}) : super(key: key); 20 | 21 | final String title; 22 | 23 | @override 24 | _MyHomePageState createState() => new _MyHomePageState(); 25 | } 26 | 27 | class _MyHomePageState extends State { 28 | int _counter = 0; 29 | 30 | void _incrementCounter() { 31 | setState(() { 32 | _counter++; 33 | }); 34 | } 35 | 36 | @override 37 | Widget build(BuildContext context) { 38 | return new Scaffold( 39 | appBar: new AppBar( 40 | title: new Text(widget.title), 41 | ), 42 | body: new Center( 43 | child: new Column( 44 | mainAxisAlignment: MainAxisAlignment.center, 45 | children: [ 46 | new Text( 47 | 'You have pushed the button this many times:', 48 | ), 49 | new Text( 50 | '$_counter', 51 | style: Theme.of(context).textTheme.display1, 52 | ), 53 | ], 54 | ), 55 | ), 56 | floatingActionButton: new FloatingActionButton( 57 | onPressed: _incrementCounter, 58 | tooltip: 'Increment', 59 | child: new Icon(Icons.add), 60 | ), 61 | ); 62 | } 63 | }*/ 64 | 65 | import 'dart:async'; 66 | 67 | import 'package:flutter/material.dart'; 68 | import 'package:flutter_localization_app/constant/Constant.dart'; 69 | import 'package:flutter_localization_app/localization/localizations.dart'; 70 | import 'package:flutter_localization_app/model/RadioModel.dart'; 71 | import 'package:flutter_localization_app/screen/SplashScreen.dart'; 72 | import 'package:flutter_localizations/flutter_localizations.dart'; 73 | import 'package:shared_preferences/shared_preferences.dart'; 74 | 75 | void main() => runApp(MyApp()); 76 | 77 | class MyApp extends StatefulWidget { 78 | static void setLocale(BuildContext context, Locale newLocale) async { 79 | print('setLocale()'); 80 | _MyAppState state = context.ancestorStateOfType(TypeMatcher<_MyAppState>()); 81 | 82 | state.setState(() { 83 | state.locale = newLocale; 84 | }); 85 | } 86 | 87 | @override 88 | State createState() { 89 | return _MyAppState(); 90 | } 91 | } 92 | 93 | class _MyAppState extends State { 94 | Locale locale; 95 | bool localeLoaded = false; 96 | 97 | @override 98 | void initState() { 99 | super.initState(); 100 | print('initState()'); 101 | 102 | this._fetchLocale().then((locale) { 103 | setState(() { 104 | this.localeLoaded = true; 105 | this.locale = locale; 106 | }); 107 | }); 108 | } 109 | 110 | @override 111 | Widget build(BuildContext context) { 112 | if (this.localeLoaded == false) { 113 | return CircularProgressIndicator(); 114 | } else { 115 | return MaterialApp( 116 | title: 'Localization Demo', 117 | debugShowCheckedModeBanner: false, 118 | theme: new ThemeData(primarySwatch: Colors.blue), 119 | home: new SplashScreen(), 120 | localizationsDelegates: [ 121 | AppLocalizationsDelegate(), 122 | GlobalMaterialLocalizations.delegate, 123 | GlobalWidgetsLocalizations.delegate, 124 | ], 125 | supportedLocales: [ 126 | const Locale('en', ''), // English 127 | const Locale('hi', ''), // Hindi 128 | ], 129 | locale: locale, 130 | routes: { 131 | HOME_SCREEN: (BuildContext context) => new HomeScreen(), 132 | }); 133 | } 134 | } 135 | 136 | _fetchLocale() async { 137 | var prefs = await SharedPreferences.getInstance(); 138 | 139 | if (prefs.getString('languageCode') == null) { 140 | return null; 141 | } 142 | 143 | print('_fetchLocale():' + 144 | (prefs.getString('languageCode') + 145 | ':' + 146 | prefs.getString('countryCode'))); 147 | 148 | return Locale( 149 | prefs.getString('languageCode'), prefs.getString('countryCode')); 150 | } 151 | } 152 | 153 | class HomeScreen extends StatefulWidget { 154 | @override 155 | State createState() { 156 | return _HomeScreenState(); 157 | } 158 | } 159 | 160 | class _HomeScreenState extends State { 161 | final GlobalKey _scaffoldKey = new GlobalKey(); 162 | 163 | List _langList = new List(); 164 | 165 | int _index=0; 166 | 167 | @override 168 | void initState() { 169 | super.initState(); 170 | 171 | _initLanguage(); 172 | 173 | } 174 | 175 | bool isDevicePlatformAndroid() { 176 | return Theme.of(context).platform == TargetPlatform.android; 177 | } 178 | 179 | @override 180 | Widget build(BuildContext context) { 181 | return Scaffold( 182 | key: _scaffoldKey, 183 | backgroundColor: const Color(0xFFF6F8FA), 184 | appBar: AppBar( 185 | elevation: isDevicePlatformAndroid() ? 0.2 : 0.0, 186 | backgroundColor: const Color(0xFFF6F8FA), 187 | title: new Center( 188 | child: new Text( 189 | AppLocalizations.of(context).appNameShort, 190 | style: TextStyle( 191 | color: Colors.black, 192 | ), 193 | textAlign: TextAlign.center, 194 | ), 195 | ), 196 | ), 197 | body: new Container( 198 | child: new Column( 199 | children: [ 200 | _buildMainWidget(), 201 | _buildLanguageWidget(), 202 | ], 203 | ))); 204 | } 205 | 206 | Widget _buildMainWidget() { 207 | return new Flexible( 208 | child: Container( 209 | color: Colors.white, 210 | child: ListView( 211 | children: [ 212 | _buildHeaderWidget(), 213 | _buildTitleWidget(), 214 | _buildDescWidget(), 215 | ], 216 | ), 217 | ), 218 | flex: 9, 219 | ); 220 | } 221 | 222 | Widget _buildHeaderWidget() { 223 | return new Center( 224 | child: Container( 225 | margin: EdgeInsets.only(top: 0.0, left: 12.0, right: 12.0), 226 | height: 160.0, 227 | decoration: new BoxDecoration( 228 | shape: BoxShape.rectangle, 229 | borderRadius: new BorderRadius.all( 230 | new Radius.circular(8.0), 231 | ), 232 | image: new DecorationImage( 233 | fit: BoxFit.contain, 234 | image: new AssetImage( 235 | 'assets/images/ic_banner.png', 236 | ), 237 | ), 238 | ), 239 | ), 240 | ); 241 | } 242 | 243 | Widget _buildTitleWidget() { 244 | return new Container( 245 | margin: EdgeInsets.only(top: 16.0, left: 12.0, right: 12.0), 246 | child: Text( 247 | AppLocalizations.of(context).title, 248 | style: TextStyle( 249 | fontSize: 20.0, 250 | fontWeight: FontWeight.bold, 251 | ), 252 | ), 253 | ); 254 | } 255 | 256 | Widget _buildDescWidget() { 257 | return new Center( 258 | child: Container( 259 | margin: EdgeInsets.only(top: 8.0, left: 12.0, right: 12.0), 260 | child: Text( 261 | AppLocalizations.of(context).desc, 262 | style: TextStyle( 263 | color: Colors.black87, 264 | inherit: true, 265 | fontSize: 13.0, 266 | wordSpacing: 8.0), 267 | ), 268 | ), 269 | ); 270 | } 271 | 272 | Widget _buildLanguageWidget() { 273 | return new Flexible( 274 | child: Container( 275 | padding: EdgeInsets.fromLTRB(4.0, 4.0, 4.0, 4.0), 276 | margin: EdgeInsets.only(left: 4.0, right: 4.0), 277 | color: Colors.grey[100], 278 | child: ListView.builder( 279 | itemCount: _langList.length, 280 | scrollDirection: Axis.horizontal, 281 | itemBuilder: (BuildContext context, int index) { 282 | return new InkWell( 283 | splashColor: Colors.blueAccent, 284 | onTap: () { 285 | setState(() { 286 | _langList.forEach((element) => element.isSelected = false); 287 | _langList[index].isSelected = true; 288 | _index = index; 289 | _handleRadioValueChanged(); 290 | }); 291 | }, 292 | child: new RadioItem(_langList[index]), 293 | ); 294 | }, 295 | ), 296 | ), 297 | ); 298 | } 299 | 300 | List _getLangList() { 301 | if(_index==0) { 302 | _langList.add(new RadioModel(true, 'English')); 303 | _langList.add(new RadioModel(false, 'हिंदी')); 304 | } else if(_index==1) { 305 | _langList.add(new RadioModel(false, 'English')); 306 | _langList.add(new RadioModel(true, 'हिंदी')); 307 | } 308 | 309 | return _langList; 310 | } 311 | 312 | Future _getLanguageCode() async { 313 | var prefs = await SharedPreferences.getInstance(); 314 | if (prefs.getString('languageCode') == null) { 315 | return null; 316 | } 317 | print('_fetchLocale():' + prefs.getString('languageCode')); 318 | return prefs.getString('languageCode'); 319 | } 320 | 321 | void _initLanguage() async { 322 | Future status = _getLanguageCode(); 323 | status.then((result) { 324 | if (result != null && result.compareTo('en') == 0) { 325 | setState(() { 326 | _index = 0; 327 | }); 328 | } 329 | if (result != null && result.compareTo('hi') == 0) { 330 | setState(() { 331 | _index = 1; 332 | }); 333 | } else { 334 | setState(() { 335 | _index = 0; 336 | }); 337 | } 338 | print("INDEX: $_index"); 339 | 340 | _setupLangList(); 341 | }); 342 | } 343 | 344 | void _setupLangList() { 345 | setState(() { 346 | _langList.add(new RadioModel(_index==0?true:false, 'English')); 347 | _langList.add(new RadioModel(_index==0?false:true, 'हिंदी')); 348 | }); 349 | } 350 | 351 | void _updateLocale(String lang, String country) async { 352 | print(lang + ':' + country); 353 | 354 | var prefs = await SharedPreferences.getInstance(); 355 | prefs.setString('languageCode', lang); 356 | prefs.setString('countryCode', country); 357 | 358 | MyApp.setLocale(context, Locale(lang, country)); 359 | } 360 | 361 | void _handleRadioValueChanged() { 362 | print("SELCET_VALUE: " + _index.toString()); 363 | setState(() { 364 | switch (_index) { 365 | case 0: 366 | print("English"); 367 | _updateLocale('en', ''); 368 | break; 369 | case 1: 370 | print("Hindi"); 371 | _updateLocale('hi', ''); 372 | break; 373 | } 374 | }); 375 | } 376 | 377 | 378 | } 379 | 380 | class RadioItem extends StatelessWidget { 381 | final RadioModel _item; 382 | 383 | RadioItem(this._item); 384 | 385 | @override 386 | Widget build(BuildContext context) { 387 | return new Container( 388 | padding: EdgeInsets.fromLTRB(4.0, 4.0, 4.0, 4.0), 389 | margin: EdgeInsets.only(left: 4.0, right: 4.0), 390 | color: Colors.grey[100], 391 | child: Row( 392 | mainAxisAlignment: MainAxisAlignment.center, 393 | children: [ 394 | Container( 395 | margin: EdgeInsets.only(left: 4.0, right: 4.0), 396 | child: new Column( 397 | mainAxisSize: MainAxisSize.max, 398 | children: [ 399 | new Container( 400 | width: 60.0, 401 | height: 4.0, 402 | decoration: new BoxDecoration( 403 | color: _item.isSelected 404 | ? Colors.redAccent 405 | : Colors.transparent, 406 | border: new Border.all( 407 | width: 1.0, 408 | color: _item.isSelected 409 | ? Colors.redAccent 410 | : Colors.transparent), 411 | borderRadius: 412 | const BorderRadius.all(const Radius.circular(2.0)), 413 | ), 414 | ), 415 | new Container( 416 | margin: new EdgeInsets.only(top: 8.0), 417 | child: new Text( 418 | _item.title, 419 | style: TextStyle( 420 | color: 421 | _item.isSelected ? Colors.redAccent : Colors.black54, 422 | ), 423 | ), 424 | ) 425 | ], 426 | ), 427 | ), 428 | ], 429 | ), 430 | ); 431 | } 432 | } 433 | -------------------------------------------------------------------------------- /lib/model/RadioModel.dart: -------------------------------------------------------------------------------- 1 | class RadioModel { 2 | bool isSelected; 3 | final String title; 4 | 5 | RadioModel(this.isSelected, this.title); 6 | } 7 | -------------------------------------------------------------------------------- /lib/screen/HomeScreen.dart: -------------------------------------------------------------------------------- 1 | /* 2 | import 'dart:async'; 3 | 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_localization_app/main.dart'; 6 | import 'package:flutter_localization_app/model/RadioModel.dart'; 7 | import 'package:shared_preferences/shared_preferences.dart'; 8 | 9 | class HomeScreen extends StatefulWidget { 10 | @override 11 | State createState() { 12 | return _HomeScreenState(); 13 | } 14 | } 15 | 16 | class _HomeScreenState extends State { 17 | final GlobalKey _scaffoldKey = new GlobalKey(); 18 | 19 | List _langList = new List(); 20 | 21 | int _index; 22 | 23 | @override 24 | void initState() { 25 | super.initState(); 26 | _langList = _getLangList(); 27 | 28 | _initLanguage(); 29 | } 30 | 31 | bool isDevicePlatformAndroid() { 32 | return Theme.of(context).platform == TargetPlatform.android; 33 | } 34 | 35 | @override 36 | Widget build(BuildContext context) { 37 | return Scaffold( 38 | key: _scaffoldKey, 39 | backgroundColor: const Color(0xFFF6F8FA), 40 | appBar: AppBar( 41 | elevation: isDevicePlatformAndroid() ? 0.2 : 0.0, 42 | backgroundColor: const Color(0xFFF6F8FA), 43 | title: new Center( 44 | child: new Text( 45 | 'Localization', 46 | style: TextStyle( 47 | color: Colors.black, 48 | ), 49 | textAlign: TextAlign.center, 50 | ), 51 | ), 52 | ), 53 | body: new Container( 54 | child: new Column( 55 | children: [ 56 | _buildMainWidget(), 57 | _buildLanguageWidget(), 58 | ], 59 | ))); 60 | } 61 | 62 | Widget _buildMainWidget() { 63 | return new Flexible( 64 | child: Container( 65 | color: Colors.white, 66 | child: ListView( 67 | children: [ 68 | _buildHeaderWidget(), 69 | _buildTitleWidget(), 70 | _buildDescWidget(), 71 | ], 72 | ), 73 | ), 74 | flex: 9, 75 | ); 76 | } 77 | 78 | Widget _buildHeaderWidget() { 79 | return new Center( 80 | child: Container( 81 | margin: EdgeInsets.only(top: 12.0, left: 12.0, right: 12.0), 82 | height: 180.0, 83 | decoration: new BoxDecoration( 84 | shape: BoxShape.rectangle, 85 | borderRadius: new BorderRadius.all( 86 | new Radius.circular(8.0), 87 | ), 88 | image: new DecorationImage( 89 | fit: BoxFit.cover, 90 | image: new AssetImage( 91 | 'assets/images/ic_banner.png', 92 | ), 93 | ), 94 | ), 95 | ), 96 | ); 97 | } 98 | 99 | Widget _buildTitleWidget() { 100 | return new Container( 101 | margin: EdgeInsets.only(top: 16.0, left: 12.0, right: 12.0), 102 | child: Text( 103 | 'Lorem Ipsum', 104 | style: TextStyle( 105 | fontSize: 20.0, 106 | fontWeight: FontWeight.bold, 107 | ), 108 | ), 109 | ); 110 | } 111 | 112 | Widget _buildDescWidget() { 113 | return new Center( 114 | child: Container( 115 | margin: EdgeInsets.only(top: 8.0, left: 12.0, right: 12.0), 116 | child: Text( 117 | 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. ' 118 | 'Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, ' 119 | 'when an unknown printer took a galley of type and scrambled it to make a ' 120 | 'type specimen book. It has survived not only five centuries, but also ' 121 | 'the leap into electronic typesetting, remaining essentially unchanged. ' 122 | 'It was popularised in the 1960s with the release of Letraset sheets containing' 123 | ' Lorem Ipsum passages, and more recently with desktop publishing software like ' 124 | 'Aldus PageMaker including versions of Lorem Ipsum', 125 | style: TextStyle( 126 | color: Colors.black87, 127 | inherit: true, 128 | fontSize: 13.0, 129 | wordSpacing: 8.0), 130 | ), 131 | ), 132 | ); 133 | } 134 | 135 | Widget _buildLanguageWidget() { 136 | return new Flexible( 137 | child: Container( 138 | padding: EdgeInsets.fromLTRB(4.0, 4.0, 4.0, 4.0), 139 | margin: EdgeInsets.only(left: 4.0, right: 4.0), 140 | color: Colors.grey[100], 141 | child: ListView.builder( 142 | itemCount: _langList.length, 143 | scrollDirection: Axis.horizontal, 144 | itemBuilder: (BuildContext context, int index) { 145 | return new InkWell( 146 | splashColor: Colors.blueAccent, 147 | onTap: () { 148 | setState(() { 149 | _langList.forEach((element) => element.isSelected = false); 150 | _langList[index].isSelected = true; 151 | _index = index; 152 | _handleRadioValueChanged(); 153 | }); 154 | }, 155 | child: new RadioItem(_langList[index]), 156 | ); 157 | }, 158 | ), 159 | ), 160 | ); 161 | } 162 | 163 | List _getLangList() { 164 | _langList.add(new RadioModel(true, 'English')); 165 | _langList.add(new RadioModel(false, 'Hindi')); 166 | _langList.add(new RadioModel(false, 'Marathi')); 167 | return _langList; 168 | } 169 | 170 | Future _getLanguageCode() async { 171 | var prefs = await SharedPreferences.getInstance(); 172 | if (prefs.getString('languageCode') == null) { 173 | return null; 174 | } 175 | print('_fetchLocale():' + prefs.getString('languageCode')); 176 | return prefs.getString('languageCode'); 177 | } 178 | 179 | void _initLanguage() async { 180 | Future status = _getLanguageCode(); 181 | status.then((result) { 182 | if (result != null && result.compareTo('en') == 0) { 183 | setState(() { 184 | _index = 0; 185 | }); 186 | } 187 | if (result != null && result.compareTo('hi') == 0) { 188 | setState(() { 189 | _index = 1; 190 | }); 191 | } else { 192 | setState(() { 193 | _index = 0; 194 | }); 195 | } 196 | }); 197 | } 198 | 199 | void _updateLocale(String lang, String country) async { 200 | print(lang + ':' + country); 201 | 202 | var prefs = await SharedPreferences.getInstance(); 203 | prefs.setString('languageCode', lang); 204 | prefs.setString('countryCode', country); 205 | 206 | MyApp.setLocale(context, Locale(lang, country)); 207 | } 208 | 209 | void _handleRadioValueChanged() { 210 | print("SELCET_VALUE: " + _index.toString()); 211 | setState(() { 212 | switch (_index) { 213 | case 0: 214 | print("English"); 215 | _updateLocale('en', 'IN'); 216 | break; 217 | case 1: 218 | print("Hindi"); 219 | _updateLocale('hi', 'IN'); 220 | break; 221 | } 222 | }); 223 | } 224 | } 225 | 226 | class RadioItem extends StatelessWidget { 227 | final RadioModel _item; 228 | 229 | RadioItem(this._item); 230 | 231 | @override 232 | Widget build(BuildContext context) { 233 | return new Container( 234 | padding: EdgeInsets.fromLTRB(4.0, 4.0, 4.0, 4.0), 235 | margin: EdgeInsets.only(left: 4.0, right: 4.0), 236 | color: Colors.grey[100], 237 | child: Row( 238 | mainAxisAlignment: MainAxisAlignment.center, 239 | children: [ 240 | Container( 241 | margin: EdgeInsets.only(left: 4.0, right: 4.0), 242 | child: new Column( 243 | mainAxisSize: MainAxisSize.max, 244 | children: [ 245 | new Container( 246 | width: 60.0, 247 | height: 4.0, 248 | decoration: new BoxDecoration( 249 | color: _item.isSelected 250 | ? Colors.redAccent 251 | : Colors.transparent, 252 | border: new Border.all( 253 | width: 1.0, 254 | color: _item.isSelected 255 | ? Colors.redAccent 256 | : Colors.transparent), 257 | borderRadius: 258 | const BorderRadius.all(const Radius.circular(2.0)), 259 | ), 260 | ), 261 | new Container( 262 | margin: new EdgeInsets.only(top: 8.0), 263 | child: new Text( 264 | _item.title, 265 | style: TextStyle( 266 | color: 267 | _item.isSelected ? Colors.redAccent : Colors.black54, 268 | ), 269 | ), 270 | ) 271 | ], 272 | ), 273 | ), 274 | ], 275 | ), 276 | ); 277 | } 278 | } 279 | */ 280 | -------------------------------------------------------------------------------- /lib/screen/SplashScreen.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_localization_app/constant/Constant.dart'; 6 | 7 | class SplashScreen extends StatefulWidget { 8 | @override 9 | SplashScreenState createState() => new SplashScreenState(); 10 | } 11 | 12 | class SplashScreenState extends State 13 | with SingleTickerProviderStateMixin { 14 | var _visible = true; 15 | 16 | AnimationController animationController; 17 | Animation animation; 18 | 19 | startTime() async { 20 | var _duration = new Duration(seconds: 3); 21 | return new Timer(_duration, navigationPage); 22 | } 23 | 24 | void navigationPage() { 25 | Navigator.of(context).pushReplacementNamed(HOME_SCREEN); 26 | } 27 | 28 | @override 29 | void initState() { 30 | super.initState(); 31 | animationController = new AnimationController( 32 | vsync: this, 33 | duration: new Duration(seconds: 2), 34 | ); 35 | animation = 36 | new CurvedAnimation(parent: animationController, curve: Curves.easeOut); 37 | 38 | animation.addListener(() => this.setState(() {})); 39 | animationController.forward(); 40 | 41 | setState(() { 42 | _visible = !_visible; 43 | }); 44 | startTime(); 45 | } 46 | 47 | @override 48 | Widget build(BuildContext context) { 49 | return Scaffold( 50 | body: Stack( 51 | fit: StackFit.expand, 52 | children: [ 53 | new Column( 54 | mainAxisAlignment: MainAxisAlignment.end, 55 | mainAxisSize: MainAxisSize.min, 56 | children: [ 57 | Padding( 58 | padding: EdgeInsets.only(bottom: 30.0), 59 | child: new Image.asset( 60 | 'assets/images/ic_powered_by.png', 61 | height: 25.0, 62 | fit: BoxFit.scaleDown, 63 | ), 64 | ) 65 | ], 66 | ), 67 | new Column( 68 | mainAxisAlignment: MainAxisAlignment.center, 69 | children: [ 70 | new Image.asset( 71 | 'assets/images/ic_flutter_devs_logo.png', 72 | width: animation.value * 250, 73 | height: animation.value * 250, 74 | ), 75 | ], 76 | ), 77 | ], 78 | ), 79 | ); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://www.dartlang.org/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.8" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.0.4" 18 | charcode: 19 | dependency: transitive 20 | description: 21 | name: charcode 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.1.2" 25 | collection: 26 | dependency: transitive 27 | description: 28 | name: collection 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.14.11" 32 | cupertino_icons: 33 | dependency: "direct main" 34 | description: 35 | name: cupertino_icons 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "0.1.2" 39 | flutter: 40 | dependency: "direct main" 41 | description: flutter 42 | source: sdk 43 | version: "0.0.0" 44 | flutter_localizations: 45 | dependency: "direct main" 46 | description: flutter 47 | source: sdk 48 | version: "0.0.0" 49 | flutter_test: 50 | dependency: "direct dev" 51 | description: flutter 52 | source: sdk 53 | version: "0.0.0" 54 | intl: 55 | dependency: transitive 56 | description: 57 | name: intl 58 | url: "https://pub.dartlang.org" 59 | source: hosted 60 | version: "0.15.7" 61 | matcher: 62 | dependency: transitive 63 | description: 64 | name: matcher 65 | url: "https://pub.dartlang.org" 66 | source: hosted 67 | version: "0.12.3+1" 68 | meta: 69 | dependency: transitive 70 | description: 71 | name: meta 72 | url: "https://pub.dartlang.org" 73 | source: hosted 74 | version: "1.1.6" 75 | path: 76 | dependency: transitive 77 | description: 78 | name: path 79 | url: "https://pub.dartlang.org" 80 | source: hosted 81 | version: "1.6.2" 82 | quiver: 83 | dependency: transitive 84 | description: 85 | name: quiver 86 | url: "https://pub.dartlang.org" 87 | source: hosted 88 | version: "2.0.1" 89 | shared_preferences: 90 | dependency: "direct main" 91 | description: 92 | name: shared_preferences 93 | url: "https://pub.dartlang.org" 94 | source: hosted 95 | version: "0.4.3" 96 | sky_engine: 97 | dependency: transitive 98 | description: flutter 99 | source: sdk 100 | version: "0.0.99" 101 | source_span: 102 | dependency: transitive 103 | description: 104 | name: source_span 105 | url: "https://pub.dartlang.org" 106 | source: hosted 107 | version: "1.4.1" 108 | stack_trace: 109 | dependency: transitive 110 | description: 111 | name: stack_trace 112 | url: "https://pub.dartlang.org" 113 | source: hosted 114 | version: "1.9.3" 115 | stream_channel: 116 | dependency: transitive 117 | description: 118 | name: stream_channel 119 | url: "https://pub.dartlang.org" 120 | source: hosted 121 | version: "1.6.8" 122 | string_scanner: 123 | dependency: transitive 124 | description: 125 | name: string_scanner 126 | url: "https://pub.dartlang.org" 127 | source: hosted 128 | version: "1.0.4" 129 | term_glyph: 130 | dependency: transitive 131 | description: 132 | name: term_glyph 133 | url: "https://pub.dartlang.org" 134 | source: hosted 135 | version: "1.0.1" 136 | test_api: 137 | dependency: transitive 138 | description: 139 | name: test_api 140 | url: "https://pub.dartlang.org" 141 | source: hosted 142 | version: "0.2.1" 143 | typed_data: 144 | dependency: transitive 145 | description: 146 | name: typed_data 147 | url: "https://pub.dartlang.org" 148 | source: hosted 149 | version: "1.1.6" 150 | vector_math: 151 | dependency: transitive 152 | description: 153 | name: vector_math 154 | url: "https://pub.dartlang.org" 155 | source: hosted 156 | version: "2.0.8" 157 | sdks: 158 | dart: ">=2.0.0 <3.0.0" 159 | flutter: ">=0.1.4 <2.0.0" 160 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_localization_app 2 | description: A new Flutter Localization application. 3 | 4 | version: 1.0.0+1 5 | 6 | environment: 7 | sdk: ">=2.0.0-dev.68.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | flutter_localizations: 13 | sdk: flutter 14 | 15 | cupertino_icons: ^0.1.2 16 | shared_preferences: ^0.4.2 17 | 18 | dev_dependencies: 19 | flutter_test: 20 | sdk: flutter 21 | 22 | flutter: 23 | uses-material-design: true 24 | 25 | assets: 26 | - assets/images/ic_flutter_devs_logo.png 27 | - assets/images/ic_powered_by.png 28 | - assets/images/ic_banner.png 29 | - assets/images/ic_banner.png 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /res/values/strings_en.arb: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /screens/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/screens/.DS_Store -------------------------------------------------------------------------------- /screens/android1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/screens/android1.jpg -------------------------------------------------------------------------------- /screens/android2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/screens/android2.jpg -------------------------------------------------------------------------------- /screens/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/screens/demo.gif -------------------------------------------------------------------------------- /screens/iphone1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/screens/iphone1.jpg -------------------------------------------------------------------------------- /screens/iphone2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-devs/flutter_localization_demo/89e0a09dd70511b3fed0e58a85ac7ef42ae128bd/screens/iphone2.jpg -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter 3 | // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to 4 | // find child widgets in the widget tree, read text, and verify that the values of widget properties 5 | // are correct. 6 | 7 | import 'package:flutter/material.dart'; 8 | import 'package:flutter_test/flutter_test.dart'; 9 | 10 | import 'package:flutter_localization_app/main.dart'; 11 | 12 | void main() { 13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 14 | // Build our app and trigger a frame. 15 | await tester.pumpWidget(new MyApp()); 16 | 17 | // Verify that our counter starts at 0. 18 | expect(find.text('0'), findsOneWidget); 19 | expect(find.text('1'), findsNothing); 20 | 21 | // Tap the '+' icon and trigger a frame. 22 | await tester.tap(find.byIcon(Icons.add)); 23 | await tester.pump(); 24 | 25 | // Verify that our counter has incremented. 26 | expect(find.text('0'), findsNothing); 27 | expect(find.text('1'), findsOneWidget); 28 | }); 29 | } 30 | --------------------------------------------------------------------------------