diff --git a/.gitignore b/.gitignore index ab30da8d..966f63a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,99 +1,6 @@ -*.gem -*.rbc -/.config -/.idea -/coverage/ -/InstalledFiles -/node-modules -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -# Used by dotenv library to load environment variables. -.env -.env.staging - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc - # Miscellaneous -*.class -*.log -*.pyc -*.swp .DS_Store -.atom/ -.buildlog/ -.history -.svn/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -.vscode/ - -# Flutter version manager related -.fvm/ - -# Flutter/Dart/Pub related -**/doc/api/ -**/ios/Flutter/.last_build_id -**/ios/.envfile -**/ios/Flutter/tmp.xcconfig -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.packages -.pub-cache/ -.pub/ -/build/ - -# Web related -lib/generated_plugin_registrant.dart - -# Symbolication related -app.*.symbols - -# Obfuscation related -app.*.map.json - -# Android Studio will place build artifacts here -/android/app/debug -/android/app/profile -/android/app/release # Python .venv/ - -# Flutter generated files -*.g.dart -*.gen.dart -*.config.dart -*.freezed.dart -*.mocks.dart +scripts/__pycache__/ diff --git a/.env.sample b/.template/.env.sample similarity index 100% rename from .env.sample rename to .template/.env.sample diff --git a/.template/.github/CODEOWNERS b/.template/.github/CODEOWNERS new file mode 100644 index 00000000..0c80cf2b --- /dev/null +++ b/.template/.github/CODEOWNERS @@ -0,0 +1,6 @@ +# Team +# @manh-t is the Team Lead +* @manh-t @doannimble @luongvo @markgravity + +# Engineering Leads +CODEOWNERS @nimblehq/engineering-leads diff --git a/.template/.github/ISSUE_TEMPLATE/bug_template.md b/.template/.github/ISSUE_TEMPLATE/bug_template.md new file mode 100644 index 00000000..5eb84c37 --- /dev/null +++ b/.template/.github/ISSUE_TEMPLATE/bug_template.md @@ -0,0 +1,20 @@ +--- +name: "Bug Report" +about: "You found something that is not working. Report it so that it can be fixed. 👷‍" +title: "Fix: " +labels: "type : bug" +--- + +## Issue + +Describe the issue you are facing. Show us the implementation: screenshots, gif, etc. + +## Expected + +Describe what should be the correct behaviour. + +## Steps to reproduce + +1. +2. +3. diff --git a/.template/.github/ISSUE_TEMPLATE/chore_template.md b/.template/.github/ISSUE_TEMPLATE/chore_template.md new file mode 100644 index 00000000..bb36ec26 --- /dev/null +++ b/.template/.github/ISSUE_TEMPLATE/chore_template.md @@ -0,0 +1,14 @@ +--- +name: "Chore" +about: "Open a Chore for minor update." +title: "Update " +labels: "type : chore" +--- + +## Why + +Describe the update details and why it's needed. + +## Who Benefits? + +Describe who will be the beneficiaries e.g. everyone, specific chapters, clients... diff --git a/.template/.github/ISSUE_TEMPLATE/feature_template.md b/.template/.github/ISSUE_TEMPLATE/feature_template.md new file mode 100644 index 00000000..5a26eb96 --- /dev/null +++ b/.template/.github/ISSUE_TEMPLATE/feature_template.md @@ -0,0 +1,14 @@ +--- +name: "Feature" +about: "Open a feature issue to add new functionalities." +title: "Add " +labels: "type : feature" +--- + +## Why + +Describe the big picture of the feature and why it's needed. + +## Who Benefits? + +Describe who will be the beneficiaries e.g. everyone, specific chapters, clients... diff --git a/.template/.github/ISSUE_TEMPLATE/story_template.md b/.template/.github/ISSUE_TEMPLATE/story_template.md new file mode 100644 index 00000000..9d5c1108 --- /dev/null +++ b/.template/.github/ISSUE_TEMPLATE/story_template.md @@ -0,0 +1,22 @@ +--- +name: "Story" +about: "Open a feature story" +title: "[Type] As a user, I can " +labels: "type : feature" +--- + +## Why + +Describe the idea of the user story as in what the motive of the user story is. + +## Acceptance Criteria + +List down how the user story will be tested and what criteria are necessary for the user story to be accepted. + +## Design + +(Optional) Add design screenshots or Figma links for UI/UX-related stories. + +## Resources + +(Optional) Add useful resources such as links to documentation, implementation ideas, or best practices. diff --git a/.template/.github/PULL_REQUEST_TEMPLATE.md b/.template/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..bf553ce5 --- /dev/null +++ b/.template/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +https://github.com/nimblehq/flutter_templates/issues/?? + +## What happened 👀 + +Describe the big picture of your changes here to communicate to the team why we should accept this pull request. + +## Insight 📝 + +Describe in details how to test the changes, which solution you tried but did not go with, referenced documentation is +welcome as well. + +## Proof Of Work 📹 + +Show us the implementation: screenshots, gif, etc. + + diff --git a/.template/.github/PULL_REQUEST_TEMPLATE/release_template.md b/.template/.github/PULL_REQUEST_TEMPLATE/release_template.md new file mode 100644 index 00000000..81bfc7c9 --- /dev/null +++ b/.template/.github/PULL_REQUEST_TEMPLATE/release_template.md @@ -0,0 +1,15 @@ +Link to the milestone on Github e.g. https://github.com/nimblehq/flutter_templates/milestone/41?closed=1 +or Link to the project management tool for the release + +## Features + +Provide the ID and title of the issue in the section for each type (feature, chore and bug). The link is optional. + +- [#1] As a user, I can log in or +- [[#1](https://github.com/nimblehq/flutter_templates/issues/1)] As a user, I can log in + +## Chores +- Same structure as in ## Feature + +## Bugs +- Same structure as in ## Feature diff --git a/.github/workflows/test.yml b/.template/.github/workflows/test.yml similarity index 100% rename from .github/workflows/test.yml rename to .template/.github/workflows/test.yml diff --git a/.template/.gitignore b/.template/.gitignore new file mode 100644 index 00000000..ab30da8d --- /dev/null +++ b/.template/.gitignore @@ -0,0 +1,99 @@ +*.gem +*.rbc +/.config +/.idea +/coverage/ +/InstalledFiles +/node-modules +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +# Used by dotenv library to load environment variables. +.env +.env.staging + +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ + +## Environment normalization: +/.bundle/ +/vendor/bundle +/lib/bundler/man/ + +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# Gemfile.lock +# .ruby-version +# .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc + +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +.vscode/ + +# Flutter version manager related +.fvm/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +**/ios/.envfile +**/ios/Flutter/tmp.xcconfig +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release + +# Python +.venv/ + +# Flutter generated files +*.g.dart +*.gen.dart +*.config.dart +*.freezed.dart +*.mocks.dart diff --git a/.metadata b/.template/.metadata similarity index 100% rename from .metadata rename to .template/.metadata diff --git a/.template/README.md b/.template/README.md new file mode 100644 index 00000000..602645f7 --- /dev/null +++ b/.template/README.md @@ -0,0 +1,70 @@ +# Flutter Templates + +All the templates that can be used to kick off a new Flutter application quickly. + +## Usage + +Clone the repository + +`git clone git@github.com:nimblehq/flutter_templates.git` + +## Prerequisite + +- Flutter 2.10.3 +- Flutter version manager (recommend): [fvm](https://fvm.app/) + +## Getting Started + +### Setup + +- Create these `.env` files in the root directory according to the flavors and add the required + environment variables into them. The example environment variable is in `.env.sample`. + + - Staging: `.env.staging` + + - Production: `.env` + +- Run code generator + + - `$ fvm flutter packages pub run build_runner build --delete-conflicting-outputs` + +### Run + +- Run the app with the desire app flavor: + + - Staging: `$ fvm flutter run --flavor staging` + + - Production: `$ fvm flutter run --flavor production` + +### Test + +- Run unit testing: + + - `$ fvm flutter test .` + +- Run integration testing: + + - `$ fvm flutter drive --driver=test_driver/integration_test.dart --target=integration_test/{test_file}.dart --flavor staging` + + - For example: + + `$ fvm flutter drive --driver=test_driver/integration_test.dart --target=integration_test/my_home_page_test.dart --flavor staging` + +## License + +This project is Copyright (c) 2014 and onwards. It is free software, +and may be redistributed under the terms specified in the [LICENSE] file. + +[LICENSE]: /LICENSE + +## About + +![Nimble](https://assets.nimblehq.co/logo/dark/logo-dark-text-160.png) + +This project is maintained and funded by Nimble. + +We love open source and do our part in sharing our work with the community! +See [our other projects][community] or [hire our team][hire] to help build your product. + +[community]: https://github.com/nimblehq +[hire]: https://nimblehq.co/ diff --git a/analysis_options.yaml b/.template/analysis_options.yaml similarity index 100% rename from analysis_options.yaml rename to .template/analysis_options.yaml diff --git a/android/.gitignore b/.template/android/.gitignore similarity index 100% rename from android/.gitignore rename to .template/android/.gitignore diff --git a/android/app/build.gradle b/.template/android/app/build.gradle similarity index 99% rename from android/app/build.gradle rename to .template/android/app/build.gradle index 68ad9824..39b79f66 100644 --- a/android/app/build.gradle +++ b/.template/android/app/build.gradle @@ -50,7 +50,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "co.nimblehq.flutter.template" - minSdkVersion 16 + minSdkVersion 23 targetSdkVersion 31 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/android/app/src/debug/AndroidManifest.xml b/.template/android/app/src/debug/AndroidManifest.xml similarity index 100% rename from android/app/src/debug/AndroidManifest.xml rename to .template/android/app/src/debug/AndroidManifest.xml diff --git a/android/app/src/main/AndroidManifest.xml b/.template/android/app/src/main/AndroidManifest.xml similarity index 100% rename from android/app/src/main/AndroidManifest.xml rename to .template/android/app/src/main/AndroidManifest.xml diff --git a/android/app/src/main/kotlin/co/nimblehq/flutter/template/MainActivity.kt b/.template/android/app/src/main/kotlin/co/nimblehq/flutter/template/MainActivity.kt similarity index 100% rename from android/app/src/main/kotlin/co/nimblehq/flutter/template/MainActivity.kt rename to .template/android/app/src/main/kotlin/co/nimblehq/flutter/template/MainActivity.kt diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/.template/android/app/src/main/res/drawable-v21/launch_background.xml similarity index 100% rename from android/app/src/main/res/drawable-v21/launch_background.xml rename to .template/android/app/src/main/res/drawable-v21/launch_background.xml diff --git a/android/app/src/main/res/drawable/launch_background.xml b/.template/android/app/src/main/res/drawable/launch_background.xml similarity index 100% rename from android/app/src/main/res/drawable/launch_background.xml rename to .template/android/app/src/main/res/drawable/launch_background.xml diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/.template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to .template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/.template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to .template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/.template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to .template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/.template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to .template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/.template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to .template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/android/app/src/main/res/values-night/styles.xml b/.template/android/app/src/main/res/values-night/styles.xml similarity index 100% rename from android/app/src/main/res/values-night/styles.xml rename to .template/android/app/src/main/res/values-night/styles.xml diff --git a/android/app/src/main/res/values/strings.xml b/.template/android/app/src/main/res/values/strings.xml similarity index 100% rename from android/app/src/main/res/values/strings.xml rename to .template/android/app/src/main/res/values/strings.xml diff --git a/android/app/src/main/res/values/styles.xml b/.template/android/app/src/main/res/values/styles.xml similarity index 100% rename from android/app/src/main/res/values/styles.xml rename to .template/android/app/src/main/res/values/styles.xml diff --git a/android/app/src/profile/AndroidManifest.xml b/.template/android/app/src/profile/AndroidManifest.xml similarity index 100% rename from android/app/src/profile/AndroidManifest.xml rename to .template/android/app/src/profile/AndroidManifest.xml diff --git a/android/app/src/staging/res/values/strings.xml b/.template/android/app/src/staging/res/values/strings.xml similarity index 100% rename from android/app/src/staging/res/values/strings.xml rename to .template/android/app/src/staging/res/values/strings.xml diff --git a/android/build.gradle b/.template/android/build.gradle similarity index 100% rename from android/build.gradle rename to .template/android/build.gradle diff --git a/android/gradle.properties b/.template/android/gradle.properties similarity index 100% rename from android/gradle.properties rename to .template/android/gradle.properties diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/.template/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from android/gradle/wrapper/gradle-wrapper.properties rename to .template/android/gradle/wrapper/gradle-wrapper.properties diff --git a/android/settings.gradle b/.template/android/settings.gradle similarity index 100% rename from android/settings.gradle rename to .template/android/settings.gradle diff --git a/assets/fonts/neuzeit.otf b/.template/assets/fonts/neuzeit.otf similarity index 100% rename from assets/fonts/neuzeit.otf rename to .template/assets/fonts/neuzeit.otf diff --git a/assets/images/nimble_logo.png b/.template/assets/images/nimble_logo.png similarity index 100% rename from assets/images/nimble_logo.png rename to .template/assets/images/nimble_logo.png diff --git a/build.yaml b/.template/build.yaml similarity index 100% rename from build.yaml rename to .template/build.yaml diff --git a/integration_test/my_home_page_test.dart b/.template/integration_test/my_home_page_test.dart similarity index 100% rename from integration_test/my_home_page_test.dart rename to .template/integration_test/my_home_page_test.dart diff --git a/integration_test/real_app_test.dart b/.template/integration_test/real_app_test.dart similarity index 100% rename from integration_test/real_app_test.dart rename to .template/integration_test/real_app_test.dart diff --git a/integration_test/utils/test_util.dart b/.template/integration_test/utils/test_util.dart similarity index 100% rename from integration_test/utils/test_util.dart rename to .template/integration_test/utils/test_util.dart diff --git a/ios/.gitignore b/.template/ios/.gitignore similarity index 100% rename from ios/.gitignore rename to .template/ios/.gitignore diff --git a/ios/Flutter/AppFrameworkInfo.plist b/.template/ios/Flutter/AppFrameworkInfo.plist similarity index 96% rename from ios/Flutter/AppFrameworkInfo.plist rename to .template/ios/Flutter/AppFrameworkInfo.plist index 9367d483..ded19e29 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/.template/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 8.0 + 10.0 diff --git a/ios/Flutter/Debug.xcconfig b/.template/ios/Flutter/Debug.xcconfig similarity index 100% rename from ios/Flutter/Debug.xcconfig rename to .template/ios/Flutter/Debug.xcconfig diff --git a/ios/Flutter/Release.xcconfig b/.template/ios/Flutter/Release.xcconfig similarity index 100% rename from ios/Flutter/Release.xcconfig rename to .template/ios/Flutter/Release.xcconfig diff --git a/ios/Podfile b/.template/ios/Podfile similarity index 100% rename from ios/Podfile rename to .template/ios/Podfile diff --git a/ios/Podfile.lock b/.template/ios/Podfile.lock similarity index 68% rename from ios/Podfile.lock rename to .template/ios/Podfile.lock index 9bb92397..9fe1b2e5 100644 --- a/ios/Podfile.lock +++ b/.template/ios/Podfile.lock @@ -2,12 +2,15 @@ PODS: - Flutter (1.0.0) - flutter_config (0.0.1): - Flutter + - integration_test (0.0.1): + - Flutter - package_info_plus (0.4.5): - Flutter DEPENDENCIES: - Flutter (from `Flutter`) - flutter_config (from `.symlinks/plugins/flutter_config/ios`) + - integration_test (from `.symlinks/plugins/integration_test/ios`) - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) EXTERNAL SOURCES: @@ -15,14 +18,17 @@ EXTERNAL SOURCES: :path: Flutter flutter_config: :path: ".symlinks/plugins/flutter_config/ios" + integration_test: + :path: ".symlinks/plugins/integration_test/ios" package_info_plus: :path: ".symlinks/plugins/package_info_plus/ios" SPEC CHECKSUMS: - Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c + Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a flutter_config: 2226c1df19c78fe34a05eb7f1363445f18e76fc1 + integration_test: a1e7d09bd98eca2fc37aefd79d4f41ad37bdbbe5 package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c -COCOAPODS: 1.10.2 +COCOAPODS: 1.11.3 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/.template/ios/Runner.xcodeproj/project.pbxproj similarity index 99% rename from ios/Runner.xcodeproj/project.pbxproj rename to .template/ios/Runner.xcodeproj/project.pbxproj index ff1c224f..f0fcd791 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/.template/ios/Runner.xcodeproj/project.pbxproj @@ -167,7 +167,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -370,6 +370,7 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -499,6 +500,7 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -522,6 +524,7 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -599,6 +602,7 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -677,6 +681,7 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -752,6 +757,7 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -826,6 +832,7 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -898,6 +905,7 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -970,6 +978,7 @@ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/.template/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to .template/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/.template/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to .template/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/.template/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to .template/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme b/.template/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme similarity index 100% rename from ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme rename to .template/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme b/.template/ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme similarity index 100% rename from ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme rename to .template/ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/.template/ios/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from ios/Runner.xcworkspace/contents.xcworkspacedata rename to .template/ios/Runner.xcworkspace/contents.xcworkspacedata diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/.template/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to .template/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/.template/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to .template/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/ios/Runner/AppDelegate.swift b/.template/ios/Runner/AppDelegate.swift similarity index 100% rename from ios/Runner/AppDelegate.swift rename to .template/ios/Runner/AppDelegate.swift diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/.template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to .template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/.template/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json similarity index 100% rename from ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json rename to .template/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/.template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png similarity index 100% rename from ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png rename to .template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/.template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png rename to .template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/.template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png similarity index 100% rename from ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png rename to .template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/.template/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md similarity index 100% rename from ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md rename to .template/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/.template/ios/Runner/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from ios/Runner/Base.lproj/LaunchScreen.storyboard rename to .template/ios/Runner/Base.lproj/LaunchScreen.storyboard diff --git a/ios/Runner/Base.lproj/Main.storyboard b/.template/ios/Runner/Base.lproj/Main.storyboard similarity index 100% rename from ios/Runner/Base.lproj/Main.storyboard rename to .template/ios/Runner/Base.lproj/Main.storyboard diff --git a/ios/Runner/Info.plist b/.template/ios/Runner/Info.plist similarity index 100% rename from ios/Runner/Info.plist rename to .template/ios/Runner/Info.plist diff --git a/ios/Runner/Runner-Bridging-Header.h b/.template/ios/Runner/Runner-Bridging-Header.h similarity index 100% rename from ios/Runner/Runner-Bridging-Header.h rename to .template/ios/Runner/Runner-Bridging-Header.h diff --git a/l10n.yaml b/.template/l10n.yaml similarity index 100% rename from l10n.yaml rename to .template/l10n.yaml diff --git a/lib/api/api_service.dart b/.template/lib/api/api_service.dart similarity index 100% rename from lib/api/api_service.dart rename to .template/lib/api/api_service.dart diff --git a/lib/api/exception/network_exceptions.dart b/.template/lib/api/exception/network_exceptions.dart similarity index 100% rename from lib/api/exception/network_exceptions.dart rename to .template/lib/api/exception/network_exceptions.dart diff --git a/lib/api/repository/credential_repository.dart b/.template/lib/api/repository/credential_repository.dart similarity index 100% rename from lib/api/repository/credential_repository.dart rename to .template/lib/api/repository/credential_repository.dart diff --git a/lib/di/interceptor/app_interceptor.dart b/.template/lib/di/interceptor/app_interceptor.dart similarity index 100% rename from lib/di/interceptor/app_interceptor.dart rename to .template/lib/di/interceptor/app_interceptor.dart diff --git a/lib/di/provider/dio_provider.dart b/.template/lib/di/provider/dio_provider.dart similarity index 100% rename from lib/di/provider/dio_provider.dart rename to .template/lib/di/provider/dio_provider.dart diff --git a/lib/env.dart b/.template/lib/env.dart similarity index 100% rename from lib/env.dart rename to .template/lib/env.dart diff --git a/lib/l10n/app_en.arb b/.template/lib/l10n/app_en.arb similarity index 100% rename from lib/l10n/app_en.arb rename to .template/lib/l10n/app_en.arb diff --git a/lib/l10n/app_th.arb b/.template/lib/l10n/app_th.arb similarity index 100% rename from lib/l10n/app_th.arb rename to .template/lib/l10n/app_th.arb diff --git a/lib/l10n/app_vi.arb b/.template/lib/l10n/app_vi.arb similarity index 100% rename from lib/l10n/app_vi.arb rename to .template/lib/l10n/app_vi.arb diff --git a/lib/main.dart b/.template/lib/main.dart similarity index 100% rename from lib/main.dart rename to .template/lib/main.dart diff --git a/lib/model/response/user_response.dart b/.template/lib/model/response/user_response.dart similarity index 100% rename from lib/model/response/user_response.dart rename to .template/lib/model/response/user_response.dart diff --git a/pubspec.lock b/.template/pubspec.lock similarity index 100% rename from pubspec.lock rename to .template/pubspec.lock diff --git a/pubspec.yaml b/.template/pubspec.yaml similarity index 99% rename from pubspec.yaml rename to .template/pubspec.yaml index bfb93387..9cbdf5df 100644 --- a/pubspec.yaml +++ b/.template/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.5.0+6 +version: 0.6.0+7 environment: sdk: ">=2.16.1 <3.0.0" diff --git a/test/api/repository/credential_repository_test.dart b/.template/test/api/repository/credential_repository_test.dart similarity index 100% rename from test/api/repository/credential_repository_test.dart rename to .template/test/api/repository/credential_repository_test.dart diff --git a/test/mocks/generate_mocks.dart b/.template/test/mocks/generate_mocks.dart similarity index 100% rename from test/mocks/generate_mocks.dart rename to .template/test/mocks/generate_mocks.dart diff --git a/test_driver/integration_test.dart b/.template/test_driver/integration_test.dart similarity index 100% rename from test_driver/integration_test.dart rename to .template/test_driver/integration_test.dart diff --git a/Makefile b/Makefile index 51201a90..9c904f57 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ PYTHON3 := $(shell command -v python3 2> /dev/null) VENV_ACTIVATE=$(VENV_NAME)/bin/activate PYTHON=$(VENV_NAME)/bin/python3 +PROJECT_PATH=$(PWD)/.template PACKAGE_NAME= PROJECT_NAME= APP_NAME= @@ -40,7 +41,7 @@ prepare-dev: $(PYTHON) -m pip install enquiries init: prepare-dev - $(PYTHON) ./scripts/setup.py --project_path $(PWD) --package_name "$(PACKAGE_NAME)" --project_name "$(PROJECT_NAME)" --app_name "$(APP_NAME)" --app_version "$(APP_VERSION)" --build_number "$(BUILD_NUMBER)" + $(PYTHON) ./scripts/setup.py --project_path "$(PROJECT_PATH)" --package_name "$(PACKAGE_NAME)" --project_name "$(PROJECT_NAME)" --app_name "$(APP_NAME)" --app_version "$(APP_VERSION)" --build_number "$(BUILD_NUMBER)" test: prepare-dev $(PYTHON) ./scripts/test.py diff --git a/README.md b/README.md index 6782a493..a472b7d5 100644 --- a/README.md +++ b/README.md @@ -8,48 +8,6 @@ Clone the repository `git clone git@github.com:nimblehq/flutter_templates.git` -## Prerequisite - -- Flutter 2.2 -- Flutter version manager (recommend): [fvm](https://fvm.app/) - -## Getting Started - -### Setup - -- Create these `.env` files in the root directory according to the flavors and add the required - environment variables into them. The example environment variable is in `.env.sample`. - - - Staging: `.env.staging` - - - Production: `.env` - -- Run code generator - - - `$ fvm flutter packages pub run build_runner build --delete-conflicting-outputs` - -### Run - -- Run the app with the desire app flavor: - - - Staging: `$ fvm flutter run --flavor staging` - - - Production: `$ fvm flutter run --flavor production` - -### Test - -- Run unit testing: - - - `$ fvm flutter test .` - -- Run integration testing: - - - `$ fvm flutter drive --driver=test_driver/integration_test.dart --target=integration_test/{test_file}.dart --flavor staging` - - - For example: - - `$ fvm flutter drive --driver=test_driver/integration_test.dart --target=integration_test/my_home_page_test.dart --flavor staging` - ## Use the template ### Setup a new project diff --git a/scripts/setup.py b/scripts/setup.py index 903d174c..4709419c 100644 --- a/scripts/setup.py +++ b/scripts/setup.py @@ -365,7 +365,7 @@ def handleParameters(): return parser.parse_args() -def validateParameters(project): +def validate_parameters(project): # Check the mandatory fields should not be empty if not project.new_package or not project.new_project_name or not project.new_app_name: print("❌ PACKAGE_NAME, PROJECT_NAME and APP_NAME are required. Please fill the missing variables and try again!") @@ -384,6 +384,19 @@ def validateParameters(project): f"❌ Invalid App Version or Build Number: {project.app_version}+{project.build_number} (needs to follow standard pattern `app_version+build_number`. Eg: `1.0+1` or `0.1.0+1`)") sys.exit() +def move_project_to_root(project): + cur_dir = os.getcwd() + shutil.copytree(project.project_path, cur_dir, copy_function=shutil.move, dirs_exist_ok=True) + +def clean_up(files: list[str]): + cur_dir = os.getcwd() + for file in files: + file_path = cur_dir + os.sep + file + if os.path.exists(file_path): + if (os.path.isdir(file_path)): + shutil.rmtree(file_path) + else: + os.remove(file_path) if __name__ == "__main__": args = handleParameters() @@ -396,7 +409,7 @@ def validateParameters(project): args.app_version, args.build_number ) - validateParameters(project) + validate_parameters(project) options = { 'none' : 'none', @@ -414,4 +427,9 @@ def validateParameters(project): ios.run() flutter = Flutter(project) flutter.run() - print("=> 🚀 Done! App is ready to be tested 🙌") + print('🤖 Generating project...') + # Remove the `.github` folder to avoid redundant workflow + clean_up(['.github']) + move_project_to_root(project) + clean_up(['.template', 'LICENSE', 'Makefile']) + print("=> 🚀 Done! Project is ready for the next development 🙌")