├── .github └── workflows │ └── flutter_web.yml ├── README.md ├── flutter_intl_example ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── flutter_intl_example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── 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 │ │ └── Runner-Bridging-Header.h ├── lib │ ├── generated │ │ ├── intl │ │ │ ├── messages_all.dart │ │ │ ├── messages_en.dart │ │ │ ├── messages_es.dart │ │ │ └── messages_es_CO.dart │ │ └── l10n.dart │ ├── l10n │ │ ├── intl_en.arb │ │ ├── intl_es.arb │ │ └── intl_es_CO.arb │ ├── main.dart │ ├── style │ │ ├── constants.dart │ │ └── theme.dart │ └── widgets │ │ ├── expansion_list_card.dart │ │ ├── home_scaffold.dart │ │ ├── notifications_card.dart │ │ ├── text_card.dart │ │ └── widgets.dart ├── pubspec.lock ├── pubspec.yaml └── web │ ├── favicon.png │ ├── icons │ ├── Icon-192.png │ └── Icon-512.png │ ├── index.html │ └── manifest.json ├── flutter_intl_with_flutter_bloc_example ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── flutter_intl_example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── 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 │ │ └── Runner-Bridging-Header.h ├── lib │ ├── blocs │ │ └── preferences_bloc.dart │ ├── generated │ │ ├── intl │ │ │ ├── messages_all.dart │ │ │ ├── messages_en.dart │ │ │ ├── messages_es.dart │ │ │ └── messages_es_CO.dart │ │ └── l10n.dart │ ├── l10n │ │ ├── intl_en.arb │ │ ├── intl_es.arb │ │ └── intl_es_CO.arb │ ├── main.dart │ ├── repositories │ │ ├── preferences_repository.dart │ │ └── preferences_repository_impl.dart │ ├── style │ │ ├── constants.dart │ │ └── theme.dart │ └── widgets │ │ ├── expansion_list_card.dart │ │ ├── home_scaffold.dart │ │ ├── notifications_card.dart │ │ ├── text_card.dart │ │ └── widgets.dart ├── pubspec.lock ├── pubspec.yaml └── web │ ├── favicon.png │ ├── icons │ ├── Icon-192.png │ └── Icon-512.png │ ├── index.html │ └── manifest.json └── start ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── flutter_intl_example │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── 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 │ └── Runner-Bridging-Header.h ├── lib ├── main.dart ├── style │ ├── constants.dart │ └── theme.dart └── widgets │ ├── expansion_list_card.dart │ ├── home_scaffold.dart │ ├── notifications_card.dart │ ├── text_card.dart │ └── widgets.dart ├── pubspec.lock ├── pubspec.yaml └── web ├── favicon.png ├── icons ├── Icon-192.png └── Icon-512.png ├── index.html └── manifest.json /.github/workflows/flutter_web.yml: -------------------------------------------------------------------------------- 1 | name: Flutter Web 2 | on: 3 | push: 4 | branches: 5 | - master 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | 11 | env: 12 | working-directory: ./flutter_intl_with_flutter_bloc_example 13 | 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v2 17 | 18 | - name: Setup Flutter 19 | uses: subosito/flutter-action@v1 20 | with: 21 | channel: 'dev' 22 | 23 | - name: Enable Flutter web 24 | run: flutter config --enable-web 25 | working-directory: ${{ env.working-directory }} 26 | 27 | - name: Install dependencies 28 | run: flutter packages get 29 | working-directory: ${{ env.working-directory }} 30 | 31 | - name: Build web 32 | run: flutter build web 33 | working-directory: ${{ env.working-directory }} 34 | 35 | - name: Deploy 36 | uses: peaceiris/actions-gh-pages@v3 37 | with: 38 | github_token: ${{ secrets.GITHUB_TOKEN }} 39 | publish_dir: ./flutter_intl_with_flutter_bloc_example/build/web -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter_intl_example 2 | 3 | 🔥🚀 I teach you how to Internationalize and localize your Flutter App easily using [Flutter Intl](https://marketplace.visualstudio.com/items?itemName=localizely.flutter-intl) extension for VS Code and [Flutter Intl](https://plugins.jetbrains.com/plugin/13666-flutter-intl) plugin for IntelliJ / Android Studio. 4 | 5 | 🔥🚀 Also I teach you how to change the language and locale from the App using [provider](https://pub.dev/packages/provider) package and [flutter_bloc](https://pub.dev/packages/flutter_bloc) package. 6 | 7 | ### 🖥️ Demo: https://giancarlocode.github.io/flutter_intl_example/#/ 8 | 9 | ## Tutorials 10 | ### 📚 Flutter Intl: https://www.youtube.com/watch?v=icTT6xUYHow 11 | ### 📚 Flutter Intl With Flutter Bloc: https://www.youtube.com/watch?v=ZoA01U9XLyw -------------------------------------------------------------------------------- /flutter_intl_example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Symbolication related 37 | app.*.symbols 38 | 39 | # Obfuscation related 40 | app.*.map.json 41 | 42 | # Exceptions to above rules. 43 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 44 | -------------------------------------------------------------------------------- /flutter_intl_example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 2294d75bfa8d067ba90230c0fc2268f3636d7584 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /flutter_intl_example/README.md: -------------------------------------------------------------------------------- 1 | # flutter_intl_example 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /flutter_intl_example/analysis_options.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/analysis_options.yaml -------------------------------------------------------------------------------- /flutter_intl_example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /flutter_intl_example/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 plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.flutter_intl_example" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /flutter_intl_example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter_intl_example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /flutter_intl_example/android/app/src/main/kotlin/com/example/flutter_intl_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutter_intl_example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /flutter_intl_example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /flutter_intl_example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_intl_example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_intl_example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_intl_example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_intl_example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_intl_example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /flutter_intl_example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter_intl_example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /flutter_intl_example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /flutter_intl_example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /flutter_intl_example/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 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /flutter_intl_example/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 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /flutter_intl_example/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 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /flutter_intl_example/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. -------------------------------------------------------------------------------- /flutter_intl_example/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 | -------------------------------------------------------------------------------- /flutter_intl_example/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 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_intl_example 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 | -------------------------------------------------------------------------------- /flutter_intl_example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /flutter_intl_example/lib/generated/intl/messages_all.dart: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT. This is code generated via package:intl/generate_localized.dart 2 | // This is a library that looks up messages for specific locales by 3 | // delegating to the appropriate library. 4 | 5 | // Ignore issues from commonly used lints in this file. 6 | // ignore_for_file:implementation_imports, file_names, unnecessary_new 7 | // ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering 8 | // ignore_for_file:argument_type_not_assignable, invalid_assignment 9 | // ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases 10 | // ignore_for_file:comment_references 11 | 12 | import 'dart:async'; 13 | 14 | import 'package:intl/intl.dart'; 15 | import 'package:intl/message_lookup_by_library.dart'; 16 | import 'package:intl/src/intl_helpers.dart'; 17 | 18 | import 'messages_en.dart' as messages_en; 19 | import 'messages_es.dart' as messages_es; 20 | import 'messages_es_CO.dart' as messages_es_co; 21 | 22 | typedef Future LibraryLoader(); 23 | Map _deferredLibraries = { 24 | 'en': () => new Future.value(null), 25 | 'es': () => new Future.value(null), 26 | 'es_CO': () => new Future.value(null), 27 | }; 28 | 29 | MessageLookupByLibrary _findExact(String localeName) { 30 | switch (localeName) { 31 | case 'en': 32 | return messages_en.messages; 33 | case 'es': 34 | return messages_es.messages; 35 | case 'es_CO': 36 | return messages_es_co.messages; 37 | default: 38 | return null; 39 | } 40 | } 41 | 42 | /// User programs should call this before using [localeName] for messages. 43 | Future initializeMessages(String localeName) async { 44 | var availableLocale = Intl.verifiedLocale( 45 | localeName, 46 | (locale) => _deferredLibraries[locale] != null, 47 | onFailure: (_) => null); 48 | if (availableLocale == null) { 49 | return new Future.value(false); 50 | } 51 | var lib = _deferredLibraries[availableLocale]; 52 | await (lib == null ? new Future.value(false) : lib()); 53 | initializeInternalMessageLookup(() => new CompositeMessageLookup()); 54 | messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor); 55 | return new Future.value(true); 56 | } 57 | 58 | bool _messagesExistFor(String locale) { 59 | try { 60 | return _findExact(locale) != null; 61 | } catch (e) { 62 | return false; 63 | } 64 | } 65 | 66 | MessageLookupByLibrary _findGeneratedMessagesFor(String locale) { 67 | var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor, 68 | onFailure: (_) => null); 69 | if (actualLocale == null) return null; 70 | return _findExact(actualLocale); 71 | } 72 | -------------------------------------------------------------------------------- /flutter_intl_example/lib/generated/intl/messages_en.dart: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT. This is code generated via package:intl/generate_localized.dart 2 | // This is a library that provides messages for a en locale. All the 3 | // messages from the main program should be duplicated here with the same 4 | // function name. 5 | 6 | // Ignore issues from commonly used lints in this file. 7 | // ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new 8 | // ignore_for_file:prefer_single_quotes,comment_references, directives_ordering 9 | // ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases 10 | // ignore_for_file:unused_import, file_names 11 | 12 | import 'package:intl/intl.dart'; 13 | import 'package:intl/message_lookup_by_library.dart'; 14 | 15 | final messages = new MessageLookup(); 16 | 17 | typedef String MessageIfAbsent(String messageStr, List args); 18 | 19 | class MessageLookup extends MessageLookupByLibrary { 20 | String get localeName => 'en'; 21 | 22 | static m0(name) => "Welcome ${name}"; 23 | 24 | static m1(firstName, lastName) => "My name is ${lastName}, ${firstName} ${lastName}"; 25 | 26 | static m2(howMany) => "${Intl.plural(howMany, one: 'You have 1 notification', other: 'You have ${howMany} notifications')}"; 27 | 28 | final messages = _notInlinedMessages(_notInlinedMessages); 29 | static _notInlinedMessages(_) => { 30 | "simpleText" : MessageLookupByLibrary.simpleMessage("Hello world"), 31 | "textWithPlaceholder" : m0, 32 | "textWithPlaceholders" : m1, 33 | "textWithPlural" : m2 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /flutter_intl_example/lib/generated/intl/messages_es.dart: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT. This is code generated via package:intl/generate_localized.dart 2 | // This is a library that provides messages for a es locale. All the 3 | // messages from the main program should be duplicated here with the same 4 | // function name. 5 | 6 | // Ignore issues from commonly used lints in this file. 7 | // ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new 8 | // ignore_for_file:prefer_single_quotes,comment_references, directives_ordering 9 | // ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases 10 | // ignore_for_file:unused_import, file_names 11 | 12 | import 'package:intl/intl.dart'; 13 | import 'package:intl/message_lookup_by_library.dart'; 14 | 15 | final messages = new MessageLookup(); 16 | 17 | typedef String MessageIfAbsent(String messageStr, List args); 18 | 19 | class MessageLookup extends MessageLookupByLibrary { 20 | String get localeName => 'es'; 21 | 22 | static m0(name) => "Bienvenido ${name}"; 23 | 24 | static m1(firstName, lastName) => "Mi nombre es ${lastName}, ${firstName} ${lastName}"; 25 | 26 | static m2(howMany) => "${Intl.plural(howMany, one: 'Tienes 1 notificación', other: 'Tienes ${howMany} notificaciones')}"; 27 | 28 | final messages = _notInlinedMessages(_notInlinedMessages); 29 | static _notInlinedMessages(_) => { 30 | "simpleText" : MessageLookupByLibrary.simpleMessage("Hola mundo"), 31 | "textWithPlaceholder" : m0, 32 | "textWithPlaceholders" : m1, 33 | "textWithPlural" : m2 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /flutter_intl_example/lib/generated/intl/messages_es_CO.dart: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT. This is code generated via package:intl/generate_localized.dart 2 | // This is a library that provides messages for a es_CO locale. All the 3 | // messages from the main program should be duplicated here with the same 4 | // function name. 5 | 6 | // Ignore issues from commonly used lints in this file. 7 | // ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new 8 | // ignore_for_file:prefer_single_quotes,comment_references, directives_ordering 9 | // ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases 10 | // ignore_for_file:unused_import, file_names 11 | 12 | import 'package:intl/intl.dart'; 13 | import 'package:intl/message_lookup_by_library.dart'; 14 | 15 | final messages = new MessageLookup(); 16 | 17 | typedef String MessageIfAbsent(String messageStr, List args); 18 | 19 | class MessageLookup extends MessageLookupByLibrary { 20 | String get localeName => 'es_CO'; 21 | 22 | static m0(name) => "Bienvenido ${name}"; 23 | 24 | static m1(firstName, lastName) => "Mi nombre es ${lastName}, ${firstName} ${lastName}"; 25 | 26 | static m2(howMany) => "${Intl.plural(howMany, one: 'Tienes 1 notificación', other: 'Tienes ${howMany} notificaciones')}"; 27 | 28 | final messages = _notInlinedMessages(_notInlinedMessages); 29 | static _notInlinedMessages(_) => { 30 | "simpleText" : MessageLookupByLibrary.simpleMessage("Hola mundo colombiano"), 31 | "textWithPlaceholder" : m0, 32 | "textWithPlaceholders" : m1, 33 | "textWithPlural" : m2 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /flutter_intl_example/lib/generated/l10n.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | import 'package:flutter/material.dart'; 3 | import 'package:intl/intl.dart'; 4 | import 'intl/messages_all.dart'; 5 | 6 | // ************************************************************************** 7 | // Generator: Flutter Intl IDE plugin 8 | // Made by Localizely 9 | // ************************************************************************** 10 | 11 | class S { 12 | S(); 13 | 14 | static const AppLocalizationDelegate delegate = 15 | AppLocalizationDelegate(); 16 | 17 | static Future load(Locale locale) { 18 | final String name = (locale.countryCode?.isEmpty ?? false) ? locale.languageCode : locale.toString(); 19 | final String localeName = Intl.canonicalizedLocale(name); 20 | return initializeMessages(localeName).then((_) { 21 | Intl.defaultLocale = localeName; 22 | return S(); 23 | }); 24 | } 25 | 26 | static S of(BuildContext context) { 27 | return Localizations.of(context, S); 28 | } 29 | 30 | String get simpleText { 31 | return Intl.message( 32 | 'Hello world', 33 | name: 'simpleText', 34 | desc: '', 35 | args: [], 36 | ); 37 | } 38 | 39 | String textWithPlaceholder(Object name) { 40 | return Intl.message( 41 | 'Welcome $name', 42 | name: 'textWithPlaceholder', 43 | desc: '', 44 | args: [name], 45 | ); 46 | } 47 | 48 | String textWithPlaceholders(Object firstName, Object lastName) { 49 | return Intl.message( 50 | 'My name is $lastName, $firstName $lastName', 51 | name: 'textWithPlaceholders', 52 | desc: '', 53 | args: [firstName, lastName], 54 | ); 55 | } 56 | 57 | String textWithPlural(num howMany) { 58 | return Intl.plural( 59 | howMany, 60 | one: 'You have 1 notification', 61 | other: 'You have $howMany notifications', 62 | name: 'textWithPlural', 63 | desc: '', 64 | args: [howMany], 65 | ); 66 | } 67 | } 68 | 69 | class AppLocalizationDelegate extends LocalizationsDelegate { 70 | const AppLocalizationDelegate(); 71 | 72 | List get supportedLocales { 73 | return const [ 74 | Locale.fromSubtags(languageCode: 'en'), Locale.fromSubtags(languageCode: 'es'), Locale.fromSubtags(languageCode: 'es', countryCode: 'CO'), 75 | ]; 76 | } 77 | 78 | @override 79 | bool isSupported(Locale locale) => _isSupported(locale); 80 | @override 81 | Future load(Locale locale) => S.load(locale); 82 | @override 83 | bool shouldReload(AppLocalizationDelegate old) => false; 84 | 85 | bool _isSupported(Locale locale) { 86 | if (locale != null) { 87 | for (Locale supportedLocale in supportedLocales) { 88 | if (supportedLocale.languageCode == locale.languageCode) { 89 | return true; 90 | } 91 | } 92 | } 93 | return false; 94 | } 95 | } -------------------------------------------------------------------------------- /flutter_intl_example/lib/l10n/intl_en.arb: -------------------------------------------------------------------------------- 1 | { 2 | "simpleText": "Hello world", 3 | "textWithPlaceholder": "Welcome {name}", 4 | "textWithPlaceholders": "My name is {lastName}, {firstName} {lastName}", 5 | "@textWithPlaceholders": { 6 | "placeholders": { 7 | "firstName": {}, 8 | "lastName": {} 9 | } 10 | }, 11 | "textWithPlural": "{howMany, plural, one{You have 1 notification} other{You have {howMany} notifications}}" 12 | } -------------------------------------------------------------------------------- /flutter_intl_example/lib/l10n/intl_es.arb: -------------------------------------------------------------------------------- 1 | { 2 | "simpleText": "Hola mundo", 3 | "textWithPlaceholder": "Bienvenido {name}", 4 | "textWithPlaceholders": "Mi nombre es {lastName}, {firstName} {lastName}", 5 | "@textWithPlaceholders": { 6 | "placeholders": { 7 | "firstName": {}, 8 | "lastName": {} 9 | } 10 | }, 11 | "textWithPlural": "{howMany, plural, one{Tienes 1 notificación} other{Tienes {howMany} notificaciones}}" 12 | } -------------------------------------------------------------------------------- /flutter_intl_example/lib/l10n/intl_es_CO.arb: -------------------------------------------------------------------------------- 1 | { 2 | "simpleText": "Hola mundo colombiano", 3 | "textWithPlaceholder": "Bienvenido {name}", 4 | "textWithPlaceholders": "Mi nombre es {lastName}, {firstName} {lastName}", 5 | "@textWithPlaceholders": { 6 | "placeholders": { 7 | "firstName": {}, 8 | "lastName": {} 9 | } 10 | }, 11 | "textWithPlural": "{howMany, plural, one{Tienes 1 notificación} other{Tienes {howMany} notificaciones}}" 12 | } -------------------------------------------------------------------------------- /flutter_intl_example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_intl_example/style/theme.dart'; 3 | import 'package:flutter_intl_example/widgets/widgets.dart'; 4 | import 'package:flutter_localizations/flutter_localizations.dart'; 5 | import 'package:flutter_intl_example/generated/l10n.dart'; 6 | 7 | void main() { 8 | runApp(App()); 9 | } 10 | 11 | class App extends StatelessWidget { 12 | @override 13 | Widget build(BuildContext context) { 14 | return MaterialApp( 15 | debugShowCheckedModeBanner: false, 16 | theme: theme, 17 | home: HomePage(), 18 | title: 'Flutter Intl Example', 19 | localizationsDelegates: [ 20 | GlobalMaterialLocalizations.delegate, 21 | GlobalWidgetsLocalizations.delegate, 22 | GlobalCupertinoLocalizations.delegate, 23 | S.delegate, 24 | ], 25 | supportedLocales: S.delegate.supportedLocales, 26 | ); 27 | } 28 | } 29 | 30 | class HomePage extends StatefulWidget { 31 | HomePage({Key key}) : super(key: key); 32 | 33 | @override 34 | _HomePageState createState() => _HomePageState(); 35 | } 36 | 37 | class _HomePageState extends State { 38 | String _firstName = 'Giancarlo'; 39 | 40 | String _lastName = 'Code'; 41 | 42 | int _notifications = 0; 43 | 44 | _resetNotifications() => setState(() => _notifications = 0); 45 | 46 | _incrementNotifications() => setState(() => _notifications++); 47 | 48 | _decrementNotifications() => setState(() { 49 | if (_notifications > 0) _notifications--; 50 | }); 51 | 52 | @override 53 | Widget build(BuildContext context) { 54 | return HomeScaffold( 55 | cards: [ 56 | TextCard( 57 | text: S.of(context).simpleText, 58 | ), 59 | TextCard( 60 | text: S.of(context).textWithPlaceholder(_firstName), 61 | ), 62 | TextCard( 63 | text: S.of(context).textWithPlaceholders(_firstName, _lastName), 64 | ), 65 | NotificationsCard( 66 | text: S.of(context).textWithPlural(_notifications), 67 | onReset: _resetNotifications, 68 | onDecrement: _decrementNotifications, 69 | onIncrement: _incrementNotifications, 70 | ), 71 | ], 72 | ); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /flutter_intl_example/lib/style/constants.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const kCardMaxWidth = 350.0; 4 | 5 | final kScaffoldBackgroundGradient = LinearGradient( 6 | begin: Alignment.topRight, 7 | end: Alignment.bottomLeft, 8 | stops: [0.1, 0.5, 0.8], 9 | colors: [ 10 | Colors.blue[600], 11 | Colors.blue[500], 12 | Colors.blue[400], 13 | ], 14 | ); 15 | -------------------------------------------------------------------------------- /flutter_intl_example/lib/style/theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | final theme = ThemeData( 4 | toggleButtonsTheme: ToggleButtonsThemeData( 5 | borderColor: Colors.black54, 6 | selectedBorderColor: Colors.black54, 7 | color: Colors.black87, 8 | ), 9 | ); 10 | -------------------------------------------------------------------------------- /flutter_intl_example/lib/widgets/home_scaffold.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_intl_example/style/constants.dart'; 3 | 4 | class HomeScaffold extends StatelessWidget { 5 | const HomeScaffold({ 6 | Key key, 7 | @required this.cards, 8 | }) : super(key: key); 9 | 10 | final List cards; 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Container( 15 | decoration: BoxDecoration( 16 | gradient: kScaffoldBackgroundGradient, 17 | ), 18 | child: Scaffold( 19 | backgroundColor: Colors.transparent, 20 | body: Center( 21 | child: SingleChildScrollView( 22 | child: SafeArea( 23 | child: Container( 24 | padding: const EdgeInsets.symmetric( 25 | vertical: 24.0, 26 | horizontal: 16.0, 27 | ), 28 | child: Column( 29 | mainAxisAlignment: MainAxisAlignment.center, 30 | children: cards, 31 | ), 32 | ), 33 | ), 34 | ), 35 | ), 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /flutter_intl_example/lib/widgets/notifications_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_intl_example/widgets/text_card.dart'; 3 | 4 | class NotificationsCard extends StatelessWidget { 5 | const NotificationsCard({ 6 | Key key, 7 | @required this.text, 8 | @required this.onReset, 9 | @required this.onDecrement, 10 | @required this.onIncrement, 11 | }) : super(key: key); 12 | 13 | final String text; 14 | final VoidCallback onReset; 15 | final VoidCallback onDecrement; 16 | final VoidCallback onIncrement; 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return TextCard( 21 | text: text, 22 | bottom: Row( 23 | mainAxisSize: MainAxisSize.min, 24 | children: [ 25 | IconButton( 26 | icon: Icon(Icons.replay), 27 | onPressed: onReset, 28 | ), 29 | IconButton( 30 | icon: Icon(Icons.remove), 31 | onPressed: onDecrement, 32 | ), 33 | IconButton( 34 | icon: Icon(Icons.add), 35 | onPressed: onIncrement, 36 | ), 37 | ], 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /flutter_intl_example/lib/widgets/text_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_intl_example/style/constants.dart'; 3 | 4 | class TextCard extends StatelessWidget { 5 | const TextCard({ 6 | Key key, 7 | @required this.text, 8 | this.bottom, 9 | }) : super(key: key); 10 | 11 | final String text; 12 | final Widget bottom; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return LayoutBuilder( 17 | builder: (BuildContext context, BoxConstraints constraints) { 18 | return Card( 19 | margin: const EdgeInsets.symmetric(vertical: 6.0), 20 | child: Container( 21 | padding: const EdgeInsets.all(12.0), 22 | width: constraints.maxWidth >= kCardMaxWidth 23 | ? kCardMaxWidth 24 | : constraints.maxWidth, 25 | child: Column( 26 | mainAxisSize: MainAxisSize.min, 27 | children: [ 28 | Text( 29 | text, 30 | style: TextStyle(fontSize: 18.0), 31 | textAlign: TextAlign.center, 32 | ), 33 | if (bottom != null) 34 | Padding( 35 | padding: const EdgeInsets.only(top: 12.0, bottom: 2.0), 36 | child: bottom, 37 | ), 38 | ], 39 | ), 40 | ), 41 | ); 42 | }, 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /flutter_intl_example/lib/widgets/widgets.dart: -------------------------------------------------------------------------------- 1 | export 'expansion_list_card.dart'; 2 | export 'home_scaffold.dart'; 3 | export 'text_card.dart'; 4 | export 'notifications_card.dart'; 5 | -------------------------------------------------------------------------------- /flutter_intl_example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.11" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.4.0" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.0.5" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.2" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.14.11" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.3" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_localizations: 66 | dependency: "direct main" 67 | description: flutter 68 | source: sdk 69 | version: "0.0.0" 70 | flutter_test: 71 | dependency: "direct dev" 72 | description: flutter 73 | source: sdk 74 | version: "0.0.0" 75 | image: 76 | dependency: transitive 77 | description: 78 | name: image 79 | url: "https://pub.dartlang.org" 80 | source: hosted 81 | version: "2.1.4" 82 | intl: 83 | dependency: transitive 84 | description: 85 | name: intl 86 | url: "https://pub.dartlang.org" 87 | source: hosted 88 | version: "0.16.0" 89 | matcher: 90 | dependency: transitive 91 | description: 92 | name: matcher 93 | url: "https://pub.dartlang.org" 94 | source: hosted 95 | version: "0.12.6" 96 | meta: 97 | dependency: transitive 98 | description: 99 | name: meta 100 | url: "https://pub.dartlang.org" 101 | source: hosted 102 | version: "1.1.8" 103 | path: 104 | dependency: transitive 105 | description: 106 | name: path 107 | url: "https://pub.dartlang.org" 108 | source: hosted 109 | version: "1.6.4" 110 | pedantic: 111 | dependency: transitive 112 | description: 113 | name: pedantic 114 | url: "https://pub.dartlang.org" 115 | source: hosted 116 | version: "1.8.0+1" 117 | petitparser: 118 | dependency: transitive 119 | description: 120 | name: petitparser 121 | url: "https://pub.dartlang.org" 122 | source: hosted 123 | version: "2.4.0" 124 | quiver: 125 | dependency: transitive 126 | description: 127 | name: quiver 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "2.0.5" 131 | sky_engine: 132 | dependency: transitive 133 | description: flutter 134 | source: sdk 135 | version: "0.0.99" 136 | source_span: 137 | dependency: transitive 138 | description: 139 | name: source_span 140 | url: "https://pub.dartlang.org" 141 | source: hosted 142 | version: "1.5.5" 143 | stack_trace: 144 | dependency: transitive 145 | description: 146 | name: stack_trace 147 | url: "https://pub.dartlang.org" 148 | source: hosted 149 | version: "1.9.3" 150 | stream_channel: 151 | dependency: transitive 152 | description: 153 | name: stream_channel 154 | url: "https://pub.dartlang.org" 155 | source: hosted 156 | version: "2.0.0" 157 | string_scanner: 158 | dependency: transitive 159 | description: 160 | name: string_scanner 161 | url: "https://pub.dartlang.org" 162 | source: hosted 163 | version: "1.0.5" 164 | term_glyph: 165 | dependency: transitive 166 | description: 167 | name: term_glyph 168 | url: "https://pub.dartlang.org" 169 | source: hosted 170 | version: "1.1.0" 171 | test_api: 172 | dependency: transitive 173 | description: 174 | name: test_api 175 | url: "https://pub.dartlang.org" 176 | source: hosted 177 | version: "0.2.11" 178 | typed_data: 179 | dependency: transitive 180 | description: 181 | name: typed_data 182 | url: "https://pub.dartlang.org" 183 | source: hosted 184 | version: "1.1.6" 185 | vector_math: 186 | dependency: transitive 187 | description: 188 | name: vector_math 189 | url: "https://pub.dartlang.org" 190 | source: hosted 191 | version: "2.0.8" 192 | xml: 193 | dependency: transitive 194 | description: 195 | name: xml 196 | url: "https://pub.dartlang.org" 197 | source: hosted 198 | version: "3.5.0" 199 | sdks: 200 | dart: ">=2.6.0 <3.0.0" 201 | -------------------------------------------------------------------------------- /flutter_intl_example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_intl_example 2 | description: Flutter intl example 3 | 4 | version: 1.0.0+1 5 | 6 | environment: 7 | sdk: ">=2.6.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | flutter_localizations: 13 | sdk: flutter 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | 19 | flutter: 20 | uses-material-design: true 21 | 22 | flutter_intl: 23 | enabled: true 24 | 25 | # Optional 26 | # Default: en 27 | # [_ 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /flutter_intl_example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutter_intl_example", 3 | "short_name": "flutter_intl_example", 4 | "start_url": ".", 5 | "display": "minimal-ui", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Symbolication related 37 | app.*.symbols 38 | 39 | # Obfuscation related 40 | app.*.map.json 41 | 42 | # Exceptions to above rules. 43 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 44 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 2294d75bfa8d067ba90230c0fc2268f3636d7584 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/README.md: -------------------------------------------------------------------------------- 1 | # flutter_intl_example 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/analysis_options.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/analysis_options.yaml -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/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 plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.flutter_intl_example" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/android/app/src/main/kotlin/com/example/flutter_intl_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutter_intl_example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/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 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/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 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/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 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/flutter_intl_with_flutter_bloc_example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/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. -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/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 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/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 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_intl_example 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 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/blocs/preferences_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | import 'package:meta/meta.dart'; 3 | import 'package:equatable/equatable.dart'; 4 | import 'package:flutter_bloc/flutter_bloc.dart'; 5 | import 'package:flutter_intl_example/repositories/preferences_repository.dart'; 6 | 7 | abstract class PreferencesEvent extends Equatable {} 8 | 9 | class ChangeLocale extends PreferencesEvent { 10 | final Locale locale; 11 | 12 | ChangeLocale(this.locale); 13 | 14 | @override 15 | List get props => [locale]; 16 | } 17 | 18 | class PreferencesState extends Equatable { 19 | final Locale locale; 20 | 21 | PreferencesState({@required this.locale}); 22 | 23 | @override 24 | List get props => [locale]; 25 | } 26 | 27 | class PreferencesBloc extends Bloc { 28 | final PreferencesRepository _preferencesRepository; 29 | final PreferencesState _initialState; 30 | 31 | PreferencesBloc({ 32 | @required PreferencesRepository preferencesRepository, 33 | @required Locale initialLocale, 34 | }) : assert(preferencesRepository != null), 35 | _preferencesRepository = preferencesRepository, 36 | _initialState = PreferencesState(locale: initialLocale); 37 | 38 | @override 39 | PreferencesState get initialState => _initialState; 40 | 41 | @override 42 | Stream mapEventToState( 43 | PreferencesEvent event, 44 | ) async* { 45 | if (event is ChangeLocale) { 46 | await _preferencesRepository.saveLocale(event.locale); 47 | yield PreferencesState(locale: event.locale); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/generated/intl/messages_all.dart: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT. This is code generated via package:intl/generate_localized.dart 2 | // This is a library that looks up messages for specific locales by 3 | // delegating to the appropriate library. 4 | 5 | // Ignore issues from commonly used lints in this file. 6 | // ignore_for_file:implementation_imports, file_names, unnecessary_new 7 | // ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering 8 | // ignore_for_file:argument_type_not_assignable, invalid_assignment 9 | // ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases 10 | // ignore_for_file:comment_references 11 | 12 | import 'dart:async'; 13 | 14 | import 'package:intl/intl.dart'; 15 | import 'package:intl/message_lookup_by_library.dart'; 16 | import 'package:intl/src/intl_helpers.dart'; 17 | 18 | import 'messages_en.dart' as messages_en; 19 | import 'messages_es.dart' as messages_es; 20 | import 'messages_es_CO.dart' as messages_es_co; 21 | 22 | typedef Future LibraryLoader(); 23 | Map _deferredLibraries = { 24 | 'en': () => new Future.value(null), 25 | 'es': () => new Future.value(null), 26 | 'es_CO': () => new Future.value(null), 27 | }; 28 | 29 | MessageLookupByLibrary _findExact(String localeName) { 30 | switch (localeName) { 31 | case 'en': 32 | return messages_en.messages; 33 | case 'es': 34 | return messages_es.messages; 35 | case 'es_CO': 36 | return messages_es_co.messages; 37 | default: 38 | return null; 39 | } 40 | } 41 | 42 | /// User programs should call this before using [localeName] for messages. 43 | Future initializeMessages(String localeName) async { 44 | var availableLocale = Intl.verifiedLocale( 45 | localeName, 46 | (locale) => _deferredLibraries[locale] != null, 47 | onFailure: (_) => null); 48 | if (availableLocale == null) { 49 | return new Future.value(false); 50 | } 51 | var lib = _deferredLibraries[availableLocale]; 52 | await (lib == null ? new Future.value(false) : lib()); 53 | initializeInternalMessageLookup(() => new CompositeMessageLookup()); 54 | messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor); 55 | return new Future.value(true); 56 | } 57 | 58 | bool _messagesExistFor(String locale) { 59 | try { 60 | return _findExact(locale) != null; 61 | } catch (e) { 62 | return false; 63 | } 64 | } 65 | 66 | MessageLookupByLibrary _findGeneratedMessagesFor(String locale) { 67 | var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor, 68 | onFailure: (_) => null); 69 | if (actualLocale == null) return null; 70 | return _findExact(actualLocale); 71 | } 72 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/generated/intl/messages_en.dart: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT. This is code generated via package:intl/generate_localized.dart 2 | // This is a library that provides messages for a en locale. All the 3 | // messages from the main program should be duplicated here with the same 4 | // function name. 5 | 6 | // Ignore issues from commonly used lints in this file. 7 | // ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new 8 | // ignore_for_file:prefer_single_quotes,comment_references, directives_ordering 9 | // ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases 10 | // ignore_for_file:unused_import, file_names 11 | 12 | import 'package:intl/intl.dart'; 13 | import 'package:intl/message_lookup_by_library.dart'; 14 | 15 | final messages = new MessageLookup(); 16 | 17 | typedef String MessageIfAbsent(String messageStr, List args); 18 | 19 | class MessageLookup extends MessageLookupByLibrary { 20 | String get localeName => 'en'; 21 | 22 | static m0(name) => "Welcome ${name}"; 23 | 24 | static m1(firstName, lastName) => "My name is ${lastName}, ${firstName} ${lastName}"; 25 | 26 | static m2(howMany) => "${Intl.plural(howMany, one: 'You have 1 notification', other: 'You have ${howMany} notifications')}"; 27 | 28 | final messages = _notInlinedMessages(_notInlinedMessages); 29 | static _notInlinedMessages(_) => { 30 | "language" : MessageLookupByLibrary.simpleMessage("Language"), 31 | "simpleText" : MessageLookupByLibrary.simpleMessage("Hello world"), 32 | "systemLanguage" : MessageLookupByLibrary.simpleMessage("System language"), 33 | "textWithPlaceholder" : m0, 34 | "textWithPlaceholders" : m1, 35 | "textWithPlural" : m2 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/generated/intl/messages_es.dart: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT. This is code generated via package:intl/generate_localized.dart 2 | // This is a library that provides messages for a es locale. All the 3 | // messages from the main program should be duplicated here with the same 4 | // function name. 5 | 6 | // Ignore issues from commonly used lints in this file. 7 | // ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new 8 | // ignore_for_file:prefer_single_quotes,comment_references, directives_ordering 9 | // ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases 10 | // ignore_for_file:unused_import, file_names 11 | 12 | import 'package:intl/intl.dart'; 13 | import 'package:intl/message_lookup_by_library.dart'; 14 | 15 | final messages = new MessageLookup(); 16 | 17 | typedef String MessageIfAbsent(String messageStr, List args); 18 | 19 | class MessageLookup extends MessageLookupByLibrary { 20 | String get localeName => 'es'; 21 | 22 | static m0(name) => "Bienvenido ${name}"; 23 | 24 | static m1(firstName, lastName) => "Mi nombre es ${lastName}, ${firstName} ${lastName}"; 25 | 26 | static m2(howMany) => "${Intl.plural(howMany, one: 'Tienes 1 notificación', other: 'Tienes ${howMany} notificaciones')}"; 27 | 28 | final messages = _notInlinedMessages(_notInlinedMessages); 29 | static _notInlinedMessages(_) => { 30 | "language" : MessageLookupByLibrary.simpleMessage("Idioma"), 31 | "simpleText" : MessageLookupByLibrary.simpleMessage("Hola mundo"), 32 | "systemLanguage" : MessageLookupByLibrary.simpleMessage("Idioma del sistema"), 33 | "textWithPlaceholder" : m0, 34 | "textWithPlaceholders" : m1, 35 | "textWithPlural" : m2 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/generated/intl/messages_es_CO.dart: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT. This is code generated via package:intl/generate_localized.dart 2 | // This is a library that provides messages for a es_CO locale. All the 3 | // messages from the main program should be duplicated here with the same 4 | // function name. 5 | 6 | // Ignore issues from commonly used lints in this file. 7 | // ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new 8 | // ignore_for_file:prefer_single_quotes,comment_references, directives_ordering 9 | // ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases 10 | // ignore_for_file:unused_import, file_names 11 | 12 | import 'package:intl/intl.dart'; 13 | import 'package:intl/message_lookup_by_library.dart'; 14 | 15 | final messages = new MessageLookup(); 16 | 17 | typedef String MessageIfAbsent(String messageStr, List args); 18 | 19 | class MessageLookup extends MessageLookupByLibrary { 20 | String get localeName => 'es_CO'; 21 | 22 | static m0(name) => "Bienvenido ${name}"; 23 | 24 | static m1(firstName, lastName) => "Mi nombre es ${lastName}, ${firstName} ${lastName}"; 25 | 26 | static m2(howMany) => "${Intl.plural(howMany, one: 'Tienes 1 notificación', other: 'Tienes ${howMany} notificaciones')}"; 27 | 28 | final messages = _notInlinedMessages(_notInlinedMessages); 29 | static _notInlinedMessages(_) => { 30 | "language" : MessageLookupByLibrary.simpleMessage("Idioma"), 31 | "simpleText" : MessageLookupByLibrary.simpleMessage("Hola mundo colombiano"), 32 | "systemLanguage" : MessageLookupByLibrary.simpleMessage("Idioma del sistema"), 33 | "textWithPlaceholder" : m0, 34 | "textWithPlaceholders" : m1, 35 | "textWithPlural" : m2 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/generated/l10n.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | import 'package:flutter/material.dart'; 3 | import 'package:intl/intl.dart'; 4 | import 'intl/messages_all.dart'; 5 | 6 | // ************************************************************************** 7 | // Generator: Flutter Intl IDE plugin 8 | // Made by Localizely 9 | // ************************************************************************** 10 | 11 | class S { 12 | S(); 13 | 14 | static const AppLocalizationDelegate delegate = 15 | AppLocalizationDelegate(); 16 | 17 | static Future load(Locale locale) { 18 | final String name = (locale.countryCode?.isEmpty ?? false) ? locale.languageCode : locale.toString(); 19 | final String localeName = Intl.canonicalizedLocale(name); 20 | return initializeMessages(localeName).then((_) { 21 | Intl.defaultLocale = localeName; 22 | return S(); 23 | }); 24 | } 25 | 26 | static S of(BuildContext context) { 27 | return Localizations.of(context, S); 28 | } 29 | 30 | String get simpleText { 31 | return Intl.message( 32 | 'Hello world', 33 | name: 'simpleText', 34 | desc: '', 35 | args: [], 36 | ); 37 | } 38 | 39 | String textWithPlaceholder(Object name) { 40 | return Intl.message( 41 | 'Welcome $name', 42 | name: 'textWithPlaceholder', 43 | desc: '', 44 | args: [name], 45 | ); 46 | } 47 | 48 | String textWithPlaceholders(Object firstName, Object lastName) { 49 | return Intl.message( 50 | 'My name is $lastName, $firstName $lastName', 51 | name: 'textWithPlaceholders', 52 | desc: '', 53 | args: [firstName, lastName], 54 | ); 55 | } 56 | 57 | String textWithPlural(num howMany) { 58 | return Intl.plural( 59 | howMany, 60 | one: 'You have 1 notification', 61 | other: 'You have $howMany notifications', 62 | name: 'textWithPlural', 63 | desc: '', 64 | args: [howMany], 65 | ); 66 | } 67 | 68 | String get language { 69 | return Intl.message( 70 | 'Language', 71 | name: 'language', 72 | desc: '', 73 | args: [], 74 | ); 75 | } 76 | 77 | String get systemLanguage { 78 | return Intl.message( 79 | 'System language', 80 | name: 'systemLanguage', 81 | desc: '', 82 | args: [], 83 | ); 84 | } 85 | } 86 | 87 | class AppLocalizationDelegate extends LocalizationsDelegate { 88 | const AppLocalizationDelegate(); 89 | 90 | List get supportedLocales { 91 | return const [ 92 | Locale.fromSubtags(languageCode: 'en'), Locale.fromSubtags(languageCode: 'es'), Locale.fromSubtags(languageCode: 'es', countryCode: 'CO'), 93 | ]; 94 | } 95 | 96 | @override 97 | bool isSupported(Locale locale) => _isSupported(locale); 98 | @override 99 | Future load(Locale locale) => S.load(locale); 100 | @override 101 | bool shouldReload(AppLocalizationDelegate old) => false; 102 | 103 | bool _isSupported(Locale locale) { 104 | if (locale != null) { 105 | for (Locale supportedLocale in supportedLocales) { 106 | if (supportedLocale.languageCode == locale.languageCode) { 107 | return true; 108 | } 109 | } 110 | } 111 | return false; 112 | } 113 | } -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/l10n/intl_en.arb: -------------------------------------------------------------------------------- 1 | { 2 | "simpleText": "Hello world", 3 | "textWithPlaceholder": "Welcome {name}", 4 | "textWithPlaceholders": "My name is {lastName}, {firstName} {lastName}", 5 | "@textWithPlaceholders": { 6 | "placeholders": { 7 | "firstName": {}, 8 | "lastName": {} 9 | } 10 | }, 11 | "textWithPlural": "{howMany, plural, one{You have 1 notification} other{You have {howMany} notifications}}", 12 | "language": "Language", 13 | "systemLanguage": "System language" 14 | } -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/l10n/intl_es.arb: -------------------------------------------------------------------------------- 1 | { 2 | "simpleText": "Hola mundo", 3 | "textWithPlaceholder": "Bienvenido {name}", 4 | "textWithPlaceholders": "Mi nombre es {lastName}, {firstName} {lastName}", 5 | "@textWithPlaceholders": { 6 | "placeholders": { 7 | "firstName": {}, 8 | "lastName": {} 9 | } 10 | }, 11 | "textWithPlural": "{howMany, plural, one{Tienes 1 notificación} other{Tienes {howMany} notificaciones}}", 12 | "language": "Idioma", 13 | "systemLanguage": "Idioma del sistema" 14 | } -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/l10n/intl_es_CO.arb: -------------------------------------------------------------------------------- 1 | { 2 | "simpleText": "Hola mundo colombiano", 3 | "textWithPlaceholder": "Bienvenido {name}", 4 | "textWithPlaceholders": "Mi nombre es {lastName}, {firstName} {lastName}", 5 | "@textWithPlaceholders": { 6 | "placeholders": { 7 | "firstName": {}, 8 | "lastName": {} 9 | } 10 | }, 11 | "textWithPlural": "{howMany, plural, one{Tienes 1 notificación} other{Tienes {howMany} notificaciones}}", 12 | "language": "Idioma", 13 | "systemLanguage": "Idioma del sistema" 14 | } -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_intl_example/style/theme.dart'; 3 | import 'package:flutter_intl_example/widgets/widgets.dart'; 4 | import 'package:flutter_localizations/flutter_localizations.dart'; 5 | import 'package:flutter_intl_example/generated/l10n.dart'; 6 | import 'package:flutter_bloc/flutter_bloc.dart'; 7 | import 'package:flutter_intl_example/blocs/preferences_bloc.dart'; 8 | import 'package:flutter_intl_example/repositories/preferences_repository_impl.dart'; 9 | import 'package:flutter_localized_locales/flutter_localized_locales.dart'; 10 | 11 | void main() async { 12 | WidgetsFlutterBinding.ensureInitialized(); 13 | 14 | final preferencesRepository = PreferencesRepositoryImpl(); 15 | 16 | final preferencesBloc = PreferencesBloc( 17 | preferencesRepository: preferencesRepository, 18 | initialLocale: await preferencesRepository.locale, 19 | ); 20 | 21 | runApp( 22 | BlocProvider( 23 | create: (context) => preferencesBloc, 24 | child: App(), 25 | ), 26 | ); 27 | } 28 | 29 | class App extends StatelessWidget { 30 | @override 31 | Widget build(BuildContext context) { 32 | return BlocBuilder( 33 | builder: (context, state) { 34 | return MaterialApp( 35 | debugShowCheckedModeBanner: false, 36 | theme: theme, 37 | home: HomePage(), 38 | title: 'Flutter Intl Example', 39 | localizationsDelegates: [ 40 | GlobalMaterialLocalizations.delegate, 41 | GlobalWidgetsLocalizations.delegate, 42 | GlobalCupertinoLocalizations.delegate, 43 | S.delegate, 44 | LocaleNamesLocalizationsDelegate(), 45 | ], 46 | supportedLocales: S.delegate.supportedLocales, 47 | locale: state.locale, 48 | ); 49 | }, 50 | ); 51 | } 52 | } 53 | 54 | class HomePage extends StatefulWidget { 55 | HomePage({Key key}) : super(key: key); 56 | 57 | @override 58 | _HomePageState createState() => _HomePageState(); 59 | } 60 | 61 | class _HomePageState extends State { 62 | String _firstName = 'Giancarlo'; 63 | 64 | String _lastName = 'Code'; 65 | 66 | int _notifications = 0; 67 | 68 | _resetNotifications() => setState(() => _notifications = 0); 69 | 70 | _incrementNotifications() => setState(() => _notifications++); 71 | 72 | _decrementNotifications() => setState(() { 73 | if (_notifications > 0) _notifications--; 74 | }); 75 | 76 | @override 77 | Widget build(BuildContext context) { 78 | return HomeScaffold( 79 | cards: [ 80 | LanguageCard(), 81 | TextCard( 82 | text: S.of(context).simpleText, 83 | ), 84 | TextCard( 85 | text: S.of(context).textWithPlaceholder(_firstName), 86 | ), 87 | TextCard( 88 | text: S.of(context).textWithPlaceholders(_firstName, _lastName), 89 | ), 90 | NotificationsCard( 91 | text: S.of(context).textWithPlural(_notifications), 92 | onReset: _resetNotifications, 93 | onDecrement: _decrementNotifications, 94 | onIncrement: _incrementNotifications, 95 | ), 96 | ], 97 | ); 98 | } 99 | } 100 | 101 | class LanguageCard extends StatelessWidget { 102 | const LanguageCard({Key key}) : super(key: key); 103 | 104 | String _localizeLocale(BuildContext context, Locale locale) { 105 | if (locale == null) { 106 | return S.of(context).systemLanguage; 107 | } else { 108 | final localeString = LocaleNames.of(context).nameOf(locale.toString()); 109 | return localeString[0].toUpperCase() + localeString.substring(1); 110 | } 111 | } 112 | 113 | @override 114 | Widget build(BuildContext context) { 115 | final preferencesBloc = context.bloc(); 116 | 117 | return ExpansionListCard( 118 | title: S.of(context).language, 119 | subTitle: _localizeLocale(context, preferencesBloc.state.locale), 120 | leading: Icon(Icons.language, size: 48), 121 | items: [ 122 | null, 123 | ...S.delegate.supportedLocales, 124 | ], 125 | itemBuilder: (locale) { 126 | return ExpansionCardItem( 127 | text: _localizeLocale(context, locale), 128 | onTap: () => preferencesBloc.add(ChangeLocale(locale)), 129 | ); 130 | }, 131 | ); 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/repositories/preferences_repository.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | abstract class PreferencesRepository { 4 | Future saveLocale(Locale locale); 5 | 6 | Future get locale; 7 | } 8 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/repositories/preferences_repository_impl.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | import 'package:flutter_intl_example/repositories/preferences_repository.dart'; 3 | import 'package:shared_preferences/shared_preferences.dart'; 4 | 5 | class PreferencesRepositoryImpl implements PreferencesRepository { 6 | static const String _localeLanguageCodeKey = 'localeLanguageCode'; 7 | static const String _localeScriptCodeKey = 'localeScriptCode'; 8 | static const String _localeCountryCodeKey = 'localeCountryCode'; 9 | 10 | @override 11 | Future saveLocale(Locale locale) async { 12 | final prefs = await SharedPreferences.getInstance(); 13 | 14 | await prefs.setString(_localeLanguageCodeKey, locale?.languageCode); 15 | await prefs.setString(_localeScriptCodeKey, locale?.scriptCode); 16 | await prefs.setString(_localeCountryCodeKey, locale?.countryCode); 17 | } 18 | 19 | @override 20 | Future get locale async { 21 | final prefs = await SharedPreferences.getInstance(); 22 | 23 | final languageCode = prefs.getString(_localeLanguageCodeKey); 24 | final scriptCode = prefs.getString(_localeScriptCodeKey); 25 | final countryCode = prefs.getString(_localeCountryCodeKey); 26 | 27 | if (languageCode != null) { 28 | return Locale.fromSubtags( 29 | languageCode: languageCode, 30 | scriptCode: scriptCode, 31 | countryCode: countryCode, 32 | ); 33 | } 34 | 35 | return null; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/style/constants.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const kCardMaxWidth = 350.0; 4 | 5 | final kScaffoldBackgroundGradient = LinearGradient( 6 | begin: Alignment.topRight, 7 | end: Alignment.bottomLeft, 8 | stops: [0.1, 0.5, 0.8], 9 | colors: [ 10 | Colors.blue[600], 11 | Colors.blue[500], 12 | Colors.blue[400], 13 | ], 14 | ); 15 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/style/theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | final theme = ThemeData( 4 | toggleButtonsTheme: ToggleButtonsThemeData( 5 | borderColor: Colors.black54, 6 | selectedBorderColor: Colors.black54, 7 | color: Colors.black87, 8 | ), 9 | ); 10 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/widgets/home_scaffold.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_intl_example/style/constants.dart'; 3 | 4 | class HomeScaffold extends StatelessWidget { 5 | const HomeScaffold({ 6 | Key key, 7 | @required this.cards, 8 | }) : super(key: key); 9 | 10 | final List cards; 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Container( 15 | decoration: BoxDecoration( 16 | gradient: kScaffoldBackgroundGradient, 17 | ), 18 | child: Scaffold( 19 | backgroundColor: Colors.transparent, 20 | body: Center( 21 | child: SingleChildScrollView( 22 | child: SafeArea( 23 | child: Container( 24 | padding: const EdgeInsets.symmetric( 25 | vertical: 24.0, 26 | horizontal: 16.0, 27 | ), 28 | child: Column( 29 | mainAxisAlignment: MainAxisAlignment.center, 30 | children: cards, 31 | ), 32 | ), 33 | ), 34 | ), 35 | ), 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/widgets/notifications_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_intl_example/widgets/text_card.dart'; 3 | 4 | class NotificationsCard extends StatelessWidget { 5 | const NotificationsCard({ 6 | Key key, 7 | @required this.text, 8 | @required this.onReset, 9 | @required this.onDecrement, 10 | @required this.onIncrement, 11 | }) : super(key: key); 12 | 13 | final String text; 14 | final VoidCallback onReset; 15 | final VoidCallback onDecrement; 16 | final VoidCallback onIncrement; 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return TextCard( 21 | text: text, 22 | bottom: Row( 23 | mainAxisSize: MainAxisSize.min, 24 | children: [ 25 | IconButton( 26 | icon: Icon(Icons.replay), 27 | onPressed: onReset, 28 | ), 29 | IconButton( 30 | icon: Icon(Icons.remove), 31 | onPressed: onDecrement, 32 | ), 33 | IconButton( 34 | icon: Icon(Icons.add), 35 | onPressed: onIncrement, 36 | ), 37 | ], 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/widgets/text_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_intl_example/style/constants.dart'; 3 | 4 | class TextCard extends StatelessWidget { 5 | const TextCard({ 6 | Key key, 7 | @required this.text, 8 | this.bottom, 9 | }) : super(key: key); 10 | 11 | final String text; 12 | final Widget bottom; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return LayoutBuilder( 17 | builder: (BuildContext context, BoxConstraints constraints) { 18 | return Card( 19 | margin: const EdgeInsets.symmetric(vertical: 6.0), 20 | child: Container( 21 | padding: const EdgeInsets.all(12.0), 22 | width: constraints.maxWidth >= kCardMaxWidth 23 | ? kCardMaxWidth 24 | : constraints.maxWidth, 25 | child: Column( 26 | mainAxisSize: MainAxisSize.min, 27 | children: [ 28 | Text( 29 | text, 30 | style: TextStyle(fontSize: 18.0), 31 | textAlign: TextAlign.center, 32 | ), 33 | if (bottom != null) 34 | Padding( 35 | padding: const EdgeInsets.only(top: 12.0, bottom: 2.0), 36 | child: bottom, 37 | ), 38 | ], 39 | ), 40 | ), 41 | ); 42 | }, 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/lib/widgets/widgets.dart: -------------------------------------------------------------------------------- 1 | export 'expansion_list_card.dart'; 2 | export 'home_scaffold.dart'; 3 | export 'text_card.dart'; 4 | export 'notifications_card.dart'; 5 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.11" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.4.0" 25 | bloc: 26 | dependency: transitive 27 | description: 28 | name: bloc 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "3.0.0" 32 | boolean_selector: 33 | dependency: transitive 34 | description: 35 | name: boolean_selector 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.0.5" 39 | charcode: 40 | dependency: transitive 41 | description: 42 | name: charcode 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.1.2" 46 | collection: 47 | dependency: transitive 48 | description: 49 | name: collection 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.14.11" 53 | convert: 54 | dependency: transitive 55 | description: 56 | name: convert 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.1" 60 | crypto: 61 | dependency: transitive 62 | description: 63 | name: crypto 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.1.3" 67 | equatable: 68 | dependency: "direct main" 69 | description: 70 | name: equatable 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.1.1" 74 | flutter: 75 | dependency: "direct main" 76 | description: flutter 77 | source: sdk 78 | version: "0.0.0" 79 | flutter_bloc: 80 | dependency: "direct main" 81 | description: 82 | name: flutter_bloc 83 | url: "https://pub.dartlang.org" 84 | source: hosted 85 | version: "3.2.0" 86 | flutter_localizations: 87 | dependency: "direct main" 88 | description: flutter 89 | source: sdk 90 | version: "0.0.0" 91 | flutter_localized_locales: 92 | dependency: "direct main" 93 | description: 94 | name: flutter_localized_locales 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "1.1.1" 98 | flutter_test: 99 | dependency: "direct dev" 100 | description: flutter 101 | source: sdk 102 | version: "0.0.0" 103 | flutter_web_plugins: 104 | dependency: transitive 105 | description: flutter 106 | source: sdk 107 | version: "0.0.0" 108 | image: 109 | dependency: transitive 110 | description: 111 | name: image 112 | url: "https://pub.dartlang.org" 113 | source: hosted 114 | version: "2.1.4" 115 | intl: 116 | dependency: transitive 117 | description: 118 | name: intl 119 | url: "https://pub.dartlang.org" 120 | source: hosted 121 | version: "0.16.0" 122 | matcher: 123 | dependency: transitive 124 | description: 125 | name: matcher 126 | url: "https://pub.dartlang.org" 127 | source: hosted 128 | version: "0.12.6" 129 | meta: 130 | dependency: transitive 131 | description: 132 | name: meta 133 | url: "https://pub.dartlang.org" 134 | source: hosted 135 | version: "1.1.8" 136 | nested: 137 | dependency: transitive 138 | description: 139 | name: nested 140 | url: "https://pub.dartlang.org" 141 | source: hosted 142 | version: "0.0.4" 143 | path: 144 | dependency: transitive 145 | description: 146 | name: path 147 | url: "https://pub.dartlang.org" 148 | source: hosted 149 | version: "1.6.4" 150 | pedantic: 151 | dependency: transitive 152 | description: 153 | name: pedantic 154 | url: "https://pub.dartlang.org" 155 | source: hosted 156 | version: "1.8.0+1" 157 | petitparser: 158 | dependency: transitive 159 | description: 160 | name: petitparser 161 | url: "https://pub.dartlang.org" 162 | source: hosted 163 | version: "2.4.0" 164 | provider: 165 | dependency: transitive 166 | description: 167 | name: provider 168 | url: "https://pub.dartlang.org" 169 | source: hosted 170 | version: "4.0.4" 171 | quiver: 172 | dependency: transitive 173 | description: 174 | name: quiver 175 | url: "https://pub.dartlang.org" 176 | source: hosted 177 | version: "2.0.5" 178 | rxdart: 179 | dependency: transitive 180 | description: 181 | name: rxdart 182 | url: "https://pub.dartlang.org" 183 | source: hosted 184 | version: "0.23.1" 185 | shared_preferences: 186 | dependency: "direct main" 187 | description: 188 | name: shared_preferences 189 | url: "https://pub.dartlang.org" 190 | source: hosted 191 | version: "0.5.6+3" 192 | shared_preferences_macos: 193 | dependency: transitive 194 | description: 195 | name: shared_preferences_macos 196 | url: "https://pub.dartlang.org" 197 | source: hosted 198 | version: "0.0.1+6" 199 | shared_preferences_platform_interface: 200 | dependency: transitive 201 | description: 202 | name: shared_preferences_platform_interface 203 | url: "https://pub.dartlang.org" 204 | source: hosted 205 | version: "1.0.3" 206 | shared_preferences_web: 207 | dependency: transitive 208 | description: 209 | name: shared_preferences_web 210 | url: "https://pub.dartlang.org" 211 | source: hosted 212 | version: "0.1.2+4" 213 | sky_engine: 214 | dependency: transitive 215 | description: flutter 216 | source: sdk 217 | version: "0.0.99" 218 | source_span: 219 | dependency: transitive 220 | description: 221 | name: source_span 222 | url: "https://pub.dartlang.org" 223 | source: hosted 224 | version: "1.5.5" 225 | stack_trace: 226 | dependency: transitive 227 | description: 228 | name: stack_trace 229 | url: "https://pub.dartlang.org" 230 | source: hosted 231 | version: "1.9.3" 232 | stream_channel: 233 | dependency: transitive 234 | description: 235 | name: stream_channel 236 | url: "https://pub.dartlang.org" 237 | source: hosted 238 | version: "2.0.0" 239 | string_scanner: 240 | dependency: transitive 241 | description: 242 | name: string_scanner 243 | url: "https://pub.dartlang.org" 244 | source: hosted 245 | version: "1.0.5" 246 | term_glyph: 247 | dependency: transitive 248 | description: 249 | name: term_glyph 250 | url: "https://pub.dartlang.org" 251 | source: hosted 252 | version: "1.1.0" 253 | test_api: 254 | dependency: transitive 255 | description: 256 | name: test_api 257 | url: "https://pub.dartlang.org" 258 | source: hosted 259 | version: "0.2.11" 260 | typed_data: 261 | dependency: transitive 262 | description: 263 | name: typed_data 264 | url: "https://pub.dartlang.org" 265 | source: hosted 266 | version: "1.1.6" 267 | vector_math: 268 | dependency: transitive 269 | description: 270 | name: vector_math 271 | url: "https://pub.dartlang.org" 272 | source: hosted 273 | version: "2.0.8" 274 | xml: 275 | dependency: transitive 276 | description: 277 | name: xml 278 | url: "https://pub.dartlang.org" 279 | source: hosted 280 | version: "3.5.0" 281 | sdks: 282 | dart: ">=2.6.0 <3.0.0" 283 | flutter: ">=1.12.13+hotfix.4 <2.0.0" 284 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_intl_example 2 | description: Flutter intl example 3 | 4 | version: 1.0.0+1 5 | 6 | environment: 7 | sdk: ">=2.6.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | flutter_localizations: 13 | sdk: flutter 14 | flutter_bloc: ^3.2.0 15 | equatable: ^1.1.1 16 | shared_preferences: ^0.5.6+3 17 | flutter_localized_locales: ^1.1.1 18 | 19 | dev_dependencies: 20 | flutter_test: 21 | sdk: flutter 22 | 23 | flutter: 24 | uses-material-design: true 25 | 26 | flutter_intl: 27 | enabled: true 28 | 29 | # Optional 30 | # Default: en 31 | # [_ 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /flutter_intl_with_flutter_bloc_example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutter_intl_example", 3 | "short_name": "flutter_intl_example", 4 | "start_url": ".", 5 | "display": "minimal-ui", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /start/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Symbolication related 37 | app.*.symbols 38 | 39 | # Obfuscation related 40 | app.*.map.json 41 | 42 | # Exceptions to above rules. 43 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 44 | -------------------------------------------------------------------------------- /start/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 2294d75bfa8d067ba90230c0fc2268f3636d7584 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /start/README.md: -------------------------------------------------------------------------------- 1 | # flutter_intl_example 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /start/analysis_options.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/analysis_options.yaml -------------------------------------------------------------------------------- /start/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /start/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 plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.flutter_intl_example" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /start/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /start/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /start/android/app/src/main/kotlin/com/example/flutter_intl_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutter_intl_example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /start/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /start/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /start/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /start/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /start/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /start/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /start/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /start/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /start/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /start/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /start/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /start/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 | -------------------------------------------------------------------------------- /start/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /start/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /start/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /start/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /start/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /start/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /start/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /start/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /start/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /start/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /start/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /start/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /start/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 | -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /start/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 | -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /start/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /start/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. -------------------------------------------------------------------------------- /start/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 | -------------------------------------------------------------------------------- /start/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 | -------------------------------------------------------------------------------- /start/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_intl_example 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 | -------------------------------------------------------------------------------- /start/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /start/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_intl_example/style/theme.dart'; 3 | import 'package:flutter_intl_example/widgets/widgets.dart'; 4 | 5 | void main() { 6 | runApp(App()); 7 | } 8 | 9 | class App extends StatelessWidget { 10 | @override 11 | Widget build(BuildContext context) { 12 | return MaterialApp( 13 | debugShowCheckedModeBanner: false, 14 | theme: theme, 15 | home: HomePage(), 16 | title: 'Flutter Intl Example', 17 | ); 18 | } 19 | } 20 | 21 | class HomePage extends StatefulWidget { 22 | HomePage({Key key}) : super(key: key); 23 | 24 | @override 25 | _HomePageState createState() => _HomePageState(); 26 | } 27 | 28 | class _HomePageState extends State { 29 | String _firstName = 'Giancarlo'; 30 | 31 | String _lastName = 'Code'; 32 | 33 | int _notifications = 0; 34 | 35 | _resetNotifications() => setState(() => _notifications = 0); 36 | 37 | _incrementNotifications() => setState(() => _notifications++); 38 | 39 | _decrementNotifications() => setState(() { 40 | if (_notifications > 0) _notifications--; 41 | }); 42 | 43 | @override 44 | Widget build(BuildContext context) { 45 | return HomeScaffold( 46 | cards: [ 47 | TextCard( 48 | text: 'Hello world', 49 | ), 50 | TextCard( 51 | text: 'Welcome $_firstName', 52 | ), 53 | TextCard( 54 | text: 'My name is $_lastName, $_firstName $_lastName', 55 | ), 56 | NotificationsCard( 57 | text: 'You have $_notifications notifications', 58 | onReset: _resetNotifications, 59 | onDecrement: _decrementNotifications, 60 | onIncrement: _incrementNotifications, 61 | ), 62 | ], 63 | ); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /start/lib/style/constants.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const kCardMaxWidth = 350.0; 4 | 5 | final kScaffoldBackgroundGradient = LinearGradient( 6 | begin: Alignment.topRight, 7 | end: Alignment.bottomLeft, 8 | stops: [0.1, 0.5, 0.8], 9 | colors: [ 10 | Colors.blue[600], 11 | Colors.blue[500], 12 | Colors.blue[400], 13 | ], 14 | ); 15 | -------------------------------------------------------------------------------- /start/lib/style/theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | final theme = ThemeData( 4 | toggleButtonsTheme: ToggleButtonsThemeData( 5 | borderColor: Colors.black54, 6 | selectedBorderColor: Colors.black54, 7 | color: Colors.black87, 8 | ), 9 | ); 10 | -------------------------------------------------------------------------------- /start/lib/widgets/home_scaffold.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_intl_example/style/constants.dart'; 3 | 4 | class HomeScaffold extends StatelessWidget { 5 | const HomeScaffold({ 6 | Key key, 7 | @required this.cards, 8 | }) : super(key: key); 9 | 10 | final List cards; 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Container( 15 | decoration: BoxDecoration( 16 | gradient: kScaffoldBackgroundGradient, 17 | ), 18 | child: Scaffold( 19 | backgroundColor: Colors.transparent, 20 | body: Center( 21 | child: SingleChildScrollView( 22 | child: SafeArea( 23 | child: Container( 24 | padding: const EdgeInsets.symmetric( 25 | vertical: 24.0, 26 | horizontal: 16.0, 27 | ), 28 | child: Column( 29 | mainAxisAlignment: MainAxisAlignment.center, 30 | children: cards, 31 | ), 32 | ), 33 | ), 34 | ), 35 | ), 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /start/lib/widgets/notifications_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_intl_example/widgets/text_card.dart'; 3 | 4 | class NotificationsCard extends StatelessWidget { 5 | const NotificationsCard({ 6 | Key key, 7 | @required this.text, 8 | @required this.onReset, 9 | @required this.onDecrement, 10 | @required this.onIncrement, 11 | }) : super(key: key); 12 | 13 | final String text; 14 | final VoidCallback onReset; 15 | final VoidCallback onDecrement; 16 | final VoidCallback onIncrement; 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return TextCard( 21 | text: text, 22 | bottom: Row( 23 | mainAxisSize: MainAxisSize.min, 24 | children: [ 25 | IconButton( 26 | icon: Icon(Icons.replay), 27 | onPressed: onReset, 28 | ), 29 | IconButton( 30 | icon: Icon(Icons.remove), 31 | onPressed: onDecrement, 32 | ), 33 | IconButton( 34 | icon: Icon(Icons.add), 35 | onPressed: onIncrement, 36 | ), 37 | ], 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /start/lib/widgets/text_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_intl_example/style/constants.dart'; 3 | 4 | class TextCard extends StatelessWidget { 5 | const TextCard({ 6 | Key key, 7 | @required this.text, 8 | this.bottom, 9 | }) : super(key: key); 10 | 11 | final String text; 12 | final Widget bottom; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return LayoutBuilder( 17 | builder: (BuildContext context, BoxConstraints constraints) { 18 | return Card( 19 | margin: const EdgeInsets.symmetric(vertical: 6.0), 20 | child: Container( 21 | padding: const EdgeInsets.all(12.0), 22 | width: constraints.maxWidth >= kCardMaxWidth 23 | ? kCardMaxWidth 24 | : constraints.maxWidth, 25 | child: Column( 26 | mainAxisSize: MainAxisSize.min, 27 | children: [ 28 | Text( 29 | text, 30 | style: TextStyle(fontSize: 18.0), 31 | textAlign: TextAlign.center, 32 | ), 33 | if (bottom != null) 34 | Padding( 35 | padding: const EdgeInsets.only(top: 12.0, bottom: 2.0), 36 | child: bottom, 37 | ), 38 | ], 39 | ), 40 | ), 41 | ); 42 | }, 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /start/lib/widgets/widgets.dart: -------------------------------------------------------------------------------- 1 | export 'expansion_list_card.dart'; 2 | export 'home_scaffold.dart'; 3 | export 'text_card.dart'; 4 | export 'notifications_card.dart'; 5 | -------------------------------------------------------------------------------- /start/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.11" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.4.0" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.0.5" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.2" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.14.11" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.3" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_test: 66 | dependency: "direct dev" 67 | description: flutter 68 | source: sdk 69 | version: "0.0.0" 70 | image: 71 | dependency: transitive 72 | description: 73 | name: image 74 | url: "https://pub.dartlang.org" 75 | source: hosted 76 | version: "2.1.4" 77 | matcher: 78 | dependency: transitive 79 | description: 80 | name: matcher 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "0.12.6" 84 | meta: 85 | dependency: transitive 86 | description: 87 | name: meta 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "1.1.8" 91 | path: 92 | dependency: transitive 93 | description: 94 | name: path 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "1.6.4" 98 | petitparser: 99 | dependency: transitive 100 | description: 101 | name: petitparser 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "2.4.0" 105 | quiver: 106 | dependency: transitive 107 | description: 108 | name: quiver 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "2.0.5" 112 | sky_engine: 113 | dependency: transitive 114 | description: flutter 115 | source: sdk 116 | version: "0.0.99" 117 | source_span: 118 | dependency: transitive 119 | description: 120 | name: source_span 121 | url: "https://pub.dartlang.org" 122 | source: hosted 123 | version: "1.5.5" 124 | stack_trace: 125 | dependency: transitive 126 | description: 127 | name: stack_trace 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "1.9.3" 131 | stream_channel: 132 | dependency: transitive 133 | description: 134 | name: stream_channel 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "2.0.0" 138 | string_scanner: 139 | dependency: transitive 140 | description: 141 | name: string_scanner 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "1.0.5" 145 | term_glyph: 146 | dependency: transitive 147 | description: 148 | name: term_glyph 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.1.0" 152 | test_api: 153 | dependency: transitive 154 | description: 155 | name: test_api 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "0.2.15" 159 | typed_data: 160 | dependency: transitive 161 | description: 162 | name: typed_data 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.1.6" 166 | vector_math: 167 | dependency: transitive 168 | description: 169 | name: vector_math 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "2.0.8" 173 | xml: 174 | dependency: transitive 175 | description: 176 | name: xml 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "3.5.0" 180 | sdks: 181 | dart: ">=2.6.0 <3.0.0" 182 | -------------------------------------------------------------------------------- /start/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_intl_example 2 | description: Flutter intl example 3 | 4 | version: 1.0.0+1 5 | 6 | environment: 7 | sdk: ">=2.6.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | 13 | dev_dependencies: 14 | flutter_test: 15 | sdk: flutter 16 | 17 | flutter: 18 | uses-material-design: true -------------------------------------------------------------------------------- /start/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/web/favicon.png -------------------------------------------------------------------------------- /start/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/web/icons/Icon-192.png -------------------------------------------------------------------------------- /start/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiancarloCode/flutter_intl_example/336134f14e5680470cf3bfd659a4f319899a7c04/start/web/icons/Icon-512.png -------------------------------------------------------------------------------- /start/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | flutter_intl_example 18 | 19 | 20 | 21 | 24 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /start/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutter_intl_example", 3 | "short_name": "flutter_intl_example", 4 | "start_url": ".", 5 | "display": "minimal-ui", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | --------------------------------------------------------------------------------