From fb8a5ecf4237f188507074c6b096da1bc56bde84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Irland?= Date: Wed, 23 Nov 2022 14:12:05 -0300 Subject: [PATCH] Update flavours - Firebase App Distribution Integration (#32) --- .github/workflows/flutter-ci.yml | 6 + Gemfile | 2 + Gemfile.lock | 67 ++++ README.md | 52 +-- analysis_options.yaml | 1 + android/.gitignore | 1 + android/.ruby-version | 1 + android/Gemfile | 8 +- android/Gemfile.lock | 223 +---------- android/app/build.gradle | 18 +- android/build.gradle | 3 + android/fastlane/.env.default | 0 android/fastlane/Pluginfile | 1 + android/fastlane/README.md | 8 + assets/environments/.env | 1 - assets/environments/development.env | 1 - fastlane/Fastfile | 20 +- fastlane/Pluginfile | 1 + ios/.gitignore | 14 + ios/.ruby-version | 1 + ios/Flutter/devDebug.xcconfig | 4 +- ios/Flutter/devProfile.xcconfig | 4 +- ios/Flutter/devRelease.xcconfig | 4 +- ios/Flutter/prodDebug.xcconfig | 4 +- ios/Flutter/prodProfile.xcconfig | 4 +- ios/Flutter/prodRelease.xcconfig | 4 +- ios/Flutter/stagingDebug.xcconfig | 6 - ios/Flutter/stagingProfile.xcconfig | 6 - ios/Flutter/stagingRelease.xcconfig | 6 - ios/Gemfile | 8 +- ios/Gemfile.lock | 287 +------------- ios/Podfile.lock | 31 ++ ios/Runner.xcodeproj/project.pbxproj | 361 ++++-------------- .../xcshareddata/xcschemes/dev.xcscheme | 2 +- .../xcshareddata/xcschemes/prod.xcscheme | 18 +- .../xcshareddata/xcschemes/staging.xcscheme | 71 ---- ios/Runner/Base.lproj/Main.storyboard | 13 +- ios/fastlane/Appfile | 5 +- ios/fastlane/Fastfile | 120 +++++- ios/fastlane/Pluginfile | 1 + ios/fastlane/README.md | 42 +- lib/core/common/config.dart | 112 +++++- .../extension/stream_future_extensions.dart | 4 +- lib/core/common/helper/env_helper.dart | 2 +- lib/core/common/logger.dart | 2 +- lib/core/di/di_provider.dart | 4 +- lib/core/di/di_repository_module.dart | 16 +- lib/core/di/di_utils_module.dart | 2 +- .../model/db/tip_amount_views_db_entity.dart | 2 +- .../model/extensions/stock_extensions.dart | 2 +- lib/core/model/extensions/tip_extension.dart | 2 +- lib/core/model/serializer/tip_serializer.dart | 4 +- lib/core/model/service/auth_models.dart | 2 +- .../responses/github_tree_response.dart | 2 +- .../service/responses/service_response.dart | 2 +- lib/core/repository/session_repository.dart | 10 +- lib/core/repository/tip_repository.dart | 14 +- lib/core/source/common/auth_interceptor.dart | 2 +- lib/core/source/common/http_service.dart | 6 +- lib/core/source/database.dart | 10 +- .../amount_views_local_source.dart | 2 +- .../local_source/auth_local_source.dart | 4 +- .../local_source/tips_local_source.dart | 2 +- .../remote_source/auth_remote_source.dart | 6 +- .../remote_source/tip_remote_source.dart | 14 +- lib/firebase_options.dart | 71 ++++ lib/gen/assets.gen.dart | 5 +- lib/main.dart | 19 +- lib/ui/app_router.dart | 19 +- lib/ui/catalog/catalog_screen.dart | 8 +- lib/ui/common/app_button.dart | 4 +- lib/ui/common/app_dialog.dart | 4 +- lib/ui/common/custom_scaffold_fab.dart | 8 +- lib/ui/common/fab.dart | 4 +- lib/ui/common/input_text.dart | 4 +- lib/ui/common/search_bar.dart | 4 +- .../display_list_favorites_tips_screen.dart | 6 +- lib/ui/favourites/favourites_tips_cubit.dart | 14 +- lib/ui/favourites/favourites_tips_screen.dart | 10 +- .../list_favourites_tips_screen.dart | 10 +- lib/ui/home/drawer.dart | 8 +- lib/ui/home/home_cubit.dart | 2 +- lib/ui/home/home_screen.dart | 20 +- lib/ui/main/main_cubit.dart | 8 +- lib/ui/main/main_screen.dart | 12 +- lib/ui/resources.dart | 2 +- .../error_handler/error_handler_cubit.dart | 2 +- lib/ui/section/section_router.dart | 6 +- lib/ui/theme/app_theme.dart | 6 +- lib/ui/tips/tips_cubit.dart | 17 +- lib/ui/tips/tips_screen.dart | 20 +- lib/ui/videos/videos.dart | 4 +- pubspec.lock | 23 +- pubspec.yaml | 27 +- scripts/checks.sh | 17 +- scripts/firebase_setup.sh | 6 + 96 files changed, 788 insertions(+), 1240 deletions(-) create mode 120000 android/.ruby-version mode change 100644 => 120000 android/Gemfile mode change 100644 => 120000 android/Gemfile.lock delete mode 100644 android/fastlane/.env.default delete mode 100644 assets/environments/development.env create mode 120000 ios/.ruby-version delete mode 100644 ios/Flutter/stagingDebug.xcconfig delete mode 100644 ios/Flutter/stagingProfile.xcconfig delete mode 100644 ios/Flutter/stagingRelease.xcconfig mode change 100644 => 120000 ios/Gemfile mode change 100644 => 120000 ios/Gemfile.lock delete mode 100644 ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme create mode 100644 lib/firebase_options.dart create mode 100755 scripts/firebase_setup.sh diff --git a/.github/workflows/flutter-ci.yml b/.github/workflows/flutter-ci.yml index e2b8f0c..15b59fb 100644 --- a/.github/workflows/flutter-ci.yml +++ b/.github/workflows/flutter-ci.yml @@ -27,6 +27,12 @@ jobs: key: ${{ runner.os }}-pub-cache - name: Install FVM && Flutter run: dart pub global activate fvm --verbose && fvm install --verbose && fvm use --force --verbose + - name: Create google-services.json + uses: timheuer/base64-to-file@v1.2 + with: + fileName: 'google-services.json' + fileDir: 'android/app/' + encodedString: ${{ secrets.ANDROID_GOOGLE_SERVICES_JSON_BASE_64 }} - name: Get dependencies uses: maierj/fastlane-action@v2.3.0 with: diff --git a/Gemfile b/Gemfile index cdd3a6b..28a69c8 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,8 @@ source "https://rubygems.org" +gem 'cocoapods' gem "fastlane" +gem 'fastlane-plugin-flutter_version' plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/Gemfile.lock b/Gemfile.lock index 60b4f8f..7d38ecd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,8 +3,16 @@ GEM specs: CFPropertyList (3.0.5) rexml + activesupport (5.2.8.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) addressable (2.8.1) public_suffix (>= 2.0.2, < 6.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) @@ -25,10 +33,48 @@ GEM aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.1.0) + cocoapods (1.10.2) + addressable (~> 2.6) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.10.2) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 1.4.0, < 2.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.6.6) + nap (~> 1.0) + ruby-macho (~> 1.4) + xcodeproj (>= 1.19.0, < 2.0) + cocoapods-core (1.10.2) + activesupport (> 5.0, < 6) + addressable (~> 2.6) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + public_suffix + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (1.6.3) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.2.0) colored (1.2) colored2 (3.1.2) commander (4.6.0) highline (~> 2.0.0) + concurrent-ruby (1.1.10) declarative (0.0.20) digest-crc (0.6.4) rake (>= 12.0.0, < 14.0.0) @@ -36,6 +82,9 @@ GEM unf (>= 0.0.5, < 1.0.0) dotenv (2.8.1) emoji_regex (3.2.3) + escape (0.0.4) + ethon (0.16.0) + ffi (>= 1.15.0) excon (0.93.0) faraday (1.10.2) faraday-em_http (~> 1.0) @@ -105,7 +154,11 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) + fastlane-plugin-firebase_app_distribution (0.3.7) fastlane-plugin-flutter_version (1.1.15) + ffi (1.15.5) + fourflusher (2.3.1) + fuzzy_match (2.0.4) gh_inspector (1.1.3) google-apis-androidpublisher_v3 (0.29.0) google-apis-core (>= 0.9.0, < 2.a) @@ -149,16 +202,22 @@ GEM http-cookie (1.0.5) domain_name (~> 0.5) httpclient (2.8.3) + i18n (1.12.0) + concurrent-ruby (~> 1.0) jmespath (1.6.1) json (2.6.2) jwt (2.5.0) memoist (0.16.2) mini_magick (4.11.0) mini_mime (1.1.2) + minitest (5.16.3) + molinillo (0.6.6) multi_json (1.15.0) multipart-post (2.0.0) nanaimo (0.3.0) + nap (1.1.0) naturally (2.2.1) + netrc (0.11.0) optparse (0.1.1) os (1.1.4) plist (3.6.0) @@ -171,6 +230,7 @@ GEM retriable (3.1.2) rexml (3.2.5) rouge (2.0.7) + ruby-macho (1.4.0) ruby2_keywords (0.0.5) rubyzip (2.3.2) security (0.1.3) @@ -185,11 +245,16 @@ GEM terminal-notifier (2.0.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) + thread_safe (0.3.6) trailblazer-option (0.1.2) tty-cursor (0.7.1) tty-screen (0.8.1) tty-spinner (0.9.3) tty-cursor (~> 0.7) + typhoeus (1.4.0) + ethon (>= 0.9.0) + tzinfo (1.2.10) + thread_safe (~> 0.1) uber (0.1.0) unf (0.1.4) unf_ext @@ -215,7 +280,9 @@ PLATFORMS x86_64-linux DEPENDENCIES + cocoapods fastlane + fastlane-plugin-firebase_app_distribution fastlane-plugin-flutter_version BUNDLED WITH diff --git a/README.md b/README.md index a17a205..b582787 100644 --- a/README.md +++ b/README.md @@ -29,55 +29,15 @@ These components are injected in the Cubits using [get_it][get_it]. ## Project Setup -The project setup is based on some plugins which generate the required native code. - -You can use [project_setup.sh](scripts/project_setup.sh) to reload all project setups. - -### Flavor setup: Project name, properties BundleId & Application id -This information is set using [flavorizr], a flutter utility to easily create flavors in your flutter application. -To change it go to `flavorizr` section in the [pubspec] file. - -For example, to add a new flavour, you can do something like: -```yaml -flavorizr: - flavors: - qa: - app: - name: 'My Project - QA' - android: - applicationId: 'com.xmartlabs.myproject.qa' - ios: - bundleId: 'com.xmartlabs.myproject.qa' -``` - -After a change is made, you need to regenerate your native files. -You can do that by executing `flutter pub run flutter_flavorizr`. - -More information in [flavorizr] page. - -### App icons - -Icons are generated using [flutter_launcher_icons] plugin. -To change it go to `flutter_icons` section in the [pubspec] file. - -After a change is made, you need to regenerate your native files. -You can do that by executing `flutter pub run flutter_launcher_icons:main`. +To run this project, you need to config the Firebase project. +You can do it by executing the following command: +```sh +./scripts/setup_firebase.sh path_to_config_folder +``` -### Splash screen - -Splash screen is generated using [flutter_native_splash]. -To change it go to `flutter_native_splash` section in the [pubspec] file. - -After a change is made, you need to regenerate your native files. -You can do that by executing `flutter pub run flutter_native_splash:create`. - -Although you can setup a bunch of features in this library, it doesn't provide a way to display animations. -If you need a more personalized splash screen, you can edit the native code or just remove this library. - -### Pre Push config +The config folder should contain the `google-services.json`, `GoogleService-Info-prod.plist` and `GoogleService-Info-dev.plist` files. -In order to setup pre-push hook you need to go to the root of the project and run `git config core.hooksPath .github/hooks` [flavorizr]: https://pub.dev/packages/flutter_flavorizr [flutter_launcher_icons]: https://pub.dev/packages/flutter_launcher_icons diff --git a/analysis_options.yaml b/analysis_options.yaml index dcde150..f9b5e3a 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -135,5 +135,6 @@ analyzer: - '**/*.gen.dart' - '**/*.gr.dart' - 'lib/generated_plugin_registrant.dart' + - 'lib/firebase_options_*.dart' errors: invalid_annotation_target: ignore diff --git a/android/.gitignore b/android/.gitignore index 6f56801..f8b57a0 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -11,3 +11,4 @@ GeneratedPluginRegistrant.java key.properties **/*.keystore **/*.jks +app/google-services.json diff --git a/android/.ruby-version b/android/.ruby-version new file mode 120000 index 0000000..5e66ef4 --- /dev/null +++ b/android/.ruby-version @@ -0,0 +1 @@ +../.ruby-version \ No newline at end of file diff --git a/android/Gemfile b/android/Gemfile deleted file mode 100644 index 4625f53..0000000 --- a/android/Gemfile +++ /dev/null @@ -1,7 +0,0 @@ -source "https://rubygems.org" - -gem "fastlane" -gem 'fastlane-plugin-flutter_version', '~> 1.0', '>= 1.0.1' - -plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') -eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/android/Gemfile b/android/Gemfile new file mode 120000 index 0000000..26cb2ad --- /dev/null +++ b/android/Gemfile @@ -0,0 +1 @@ +../Gemfile \ No newline at end of file diff --git a/android/Gemfile.lock b/android/Gemfile.lock deleted file mode 100644 index 63e3b5a..0000000 --- a/android/Gemfile.lock +++ /dev/null @@ -1,222 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (3.0.5) - rexml - addressable (2.8.1) - public_suffix (>= 2.0.2, < 6.0) - artifactory (3.0.15) - atomos (0.1.3) - aws-eventstream (1.2.0) - aws-partitions (1.633.0) - aws-sdk-core (3.151.0) - aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.525.0) - aws-sigv4 (~> 1.1) - jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.58.0) - aws-sdk-core (~> 3, >= 3.127.0) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.114.0) - aws-sdk-core (~> 3, >= 3.127.0) - aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.4) - aws-sigv4 (1.5.1) - aws-eventstream (~> 1, >= 1.0.2) - babosa (1.0.4) - claide (1.1.0) - colored (1.2) - colored2 (3.1.2) - commander (4.6.0) - highline (~> 2.0.0) - declarative (0.0.20) - digest-crc (0.6.4) - rake (>= 12.0.0, < 14.0.0) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - dotenv (2.8.1) - emoji_regex (3.2.3) - excon (0.92.4) - faraday (1.10.2) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - ruby2_keywords (>= 0.0.4) - faraday-cookie_jar (0.0.7) - faraday (>= 0.8.0) - http-cookie (~> 1.0.0) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-multipart (1.0.4) - multipart-post (~> 2) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) - faraday_middleware (1.2.0) - faraday (~> 1.0) - fastimage (2.2.6) - fastlane (2.210.1) - CFPropertyList (>= 2.3, < 4.0.0) - addressable (>= 2.8, < 3.0.0) - artifactory (~> 3.0) - aws-sdk-s3 (~> 1.0) - babosa (>= 1.0.3, < 2.0.0) - bundler (>= 1.12.0, < 3.0.0) - colored - commander (~> 4.6) - dotenv (>= 2.1.1, < 3.0.0) - emoji_regex (>= 0.1, < 4.0) - excon (>= 0.71.0, < 1.0.0) - faraday (~> 1.0) - faraday-cookie_jar (~> 0.0.6) - faraday_middleware (~> 1.0) - fastimage (>= 2.1.0, < 3.0.0) - gh_inspector (>= 1.1.2, < 2.0.0) - google-apis-androidpublisher_v3 (~> 0.3) - google-apis-playcustomapp_v1 (~> 0.1) - google-cloud-storage (~> 1.31) - highline (~> 2.0) - json (< 3.0.0) - jwt (>= 2.1.0, < 3) - mini_magick (>= 4.9.4, < 5.0.0) - multipart-post (~> 2.0.0) - naturally (~> 2.2) - optparse (~> 0.1.1) - plist (>= 3.1.0, < 4.0.0) - rubyzip (>= 2.0.0, < 3.0.0) - security (= 0.1.3) - simctl (~> 1.6.3) - terminal-notifier (>= 2.0.0, < 3.0.0) - terminal-table (>= 1.4.5, < 2.0.0) - tty-screen (>= 0.6.3, < 1.0.0) - tty-spinner (>= 0.8.0, < 1.0.0) - word_wrap (~> 1.0.0) - xcodeproj (>= 1.13.0, < 2.0.0) - xcpretty (~> 0.3.0) - xcpretty-travis-formatter (>= 0.0.3) - fastlane-plugin-firebase_app_distribution (0.3.6) - fastlane-plugin-flutter_version (1.1.15) - gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.27.0) - google-apis-core (>= 0.7.2, < 2.a) - google-apis-core (0.9.0) - addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.16.2, < 2.a) - httpclient (>= 2.8.1, < 3.a) - mini_mime (~> 1.0) - representable (~> 3.0) - retriable (>= 2.0, < 4.a) - rexml - webrick - google-apis-iamcredentials_v1 (0.14.0) - google-apis-core (>= 0.7.2, < 2.a) - google-apis-playcustomapp_v1 (0.10.0) - google-apis-core (>= 0.7, < 2.a) - google-apis-storage_v1 (0.17.0) - google-apis-core (>= 0.7, < 2.a) - google-cloud-core (1.6.0) - google-cloud-env (~> 1.0) - google-cloud-errors (~> 1.0) - google-cloud-env (1.6.0) - faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.3.0) - google-cloud-storage (1.42.0) - addressable (~> 2.8) - digest-crc (~> 0.4) - google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.17.0) - google-cloud-core (~> 1.6) - googleauth (>= 0.16.2, < 2.a) - mini_mime (~> 1.0) - googleauth (1.2.0) - faraday (>= 0.17.3, < 3.a) - jwt (>= 1.4, < 3.0) - memoist (~> 0.16) - multi_json (~> 1.11) - os (>= 0.9, < 2.0) - signet (>= 0.16, < 2.a) - highline (2.0.3) - http-cookie (1.0.5) - domain_name (~> 0.5) - httpclient (2.8.3) - jmespath (1.6.1) - json (2.6.2) - jwt (2.5.0) - memoist (0.16.2) - mini_magick (4.11.0) - mini_mime (1.1.2) - multi_json (1.15.0) - multipart-post (2.0.0) - nanaimo (0.3.0) - naturally (2.2.1) - optparse (0.1.1) - os (1.1.4) - plist (3.6.0) - public_suffix (5.0.0) - rake (13.0.6) - representable (3.2.0) - declarative (< 0.1.0) - trailblazer-option (>= 0.1.1, < 0.2.0) - uber (< 0.2.0) - retriable (3.1.2) - rexml (3.2.5) - rouge (2.0.7) - ruby2_keywords (0.0.5) - rubyzip (2.3.2) - security (0.1.3) - signet (0.17.0) - addressable (~> 2.8) - faraday (>= 0.17.5, < 3.a) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) - simctl (1.6.8) - CFPropertyList - naturally - terminal-notifier (2.0.0) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - trailblazer-option (0.1.2) - tty-cursor (0.7.1) - tty-screen (0.8.1) - tty-spinner (0.9.3) - tty-cursor (~> 0.7) - uber (0.1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) - unicode-display_width (1.8.0) - webrick (1.7.0) - word_wrap (1.0.0) - xcodeproj (1.22.0) - CFPropertyList (>= 2.3.3, < 4.0) - atomos (~> 0.1.3) - claide (>= 1.0.2, < 2.0) - colored2 (~> 3.1) - nanaimo (~> 0.3.0) - rexml (~> 3.2.4) - xcpretty (0.3.0) - rouge (~> 2.0.7) - xcpretty-travis-formatter (1.0.1) - xcpretty (~> 0.2, >= 0.0.7) - -PLATFORMS - universal-darwin-21 - -DEPENDENCIES - fastlane - fastlane-plugin-firebase_app_distribution - fastlane-plugin-flutter_version (~> 1.0, >= 1.0.1) - -BUNDLED WITH - 2.3.11 diff --git a/android/Gemfile.lock b/android/Gemfile.lock new file mode 120000 index 0000000..412e45f --- /dev/null +++ b/android/Gemfile.lock @@ -0,0 +1 @@ +../Gemfile.lock \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index d1e126b..45a727e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -24,6 +24,9 @@ if (flutterVersionName == null) { } apply plugin: 'com.android.application' +// START: FlutterFire Configuration +apply plugin: 'com.google.gms.google-services' +// END: FlutterFire Configuration apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" @@ -35,18 +38,13 @@ android { productFlavors { dev { dimension "flavor-type" - applicationId "com.xmartlabs.template.dev" - resValue "string", "app_name", "Template Dev" + applicationId "com.xmartlabs.fluttips.dev" + resValue "string", "app_name", "Fluttips Dev" } prod { dimension "flavor-type" - applicationId "com.xmartlabs.template" - resValue "string", "app_name", "Template" - } - staging { - dimension "flavor-type" - applicationId "com.xmartlabs.template.sta" - resValue "string", "app_name", "Template Sta" + applicationId "com.xmartlabs.fluttips" + resValue "string", "app_name", "Fluttips" } } @@ -68,7 +66,7 @@ android { } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.xmartlabs.flutter_template" + applicationId "com.xmartlabs.fluttips" minSdkVersion 21 targetSdkVersion 33 versionCode flutterVersionCode.toInteger() diff --git a/android/build.gradle b/android/build.gradle index 5f8f9a5..0b9541d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -7,6 +7,9 @@ buildscript { dependencies { classpath "com.android.tools.build:gradle:7.1.3" + // START: FlutterFire Configuration + classpath 'com.google.gms:google-services:4.3.10' + // END: FlutterFire Configuration classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/android/fastlane/.env.default b/android/fastlane/.env.default deleted file mode 100644 index e69de29..0000000 diff --git a/android/fastlane/Pluginfile b/android/fastlane/Pluginfile index b18539b..fa81426 100644 --- a/android/fastlane/Pluginfile +++ b/android/fastlane/Pluginfile @@ -2,4 +2,5 @@ # # Ensure this file is checked in to source control! +gem 'fastlane-plugin-flutter_version' gem 'fastlane-plugin-firebase_app_distribution' diff --git a/android/fastlane/README.md b/android/fastlane/README.md index 53ee9f6..ceddd3f 100644 --- a/android/fastlane/README.md +++ b/android/fastlane/README.md @@ -37,6 +37,14 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do **Lint: Check code format** +### lint_check_language_sorting + +```sh +[bundle exec] fastlane lint_check_language_sorting +``` + +**Lint: Check code format** + ### lint_analyze ```sh diff --git a/assets/environments/.env b/assets/environments/.env index 3f8d130..e69de29 100644 --- a/assets/environments/.env +++ b/assets/environments/.env @@ -1 +0,0 @@ -API_BASE_URL=https://api.github.com/repos/vandadnp/flutter-tips-and-tricks diff --git a/assets/environments/development.env b/assets/environments/development.env deleted file mode 100644 index 3f8d130..0000000 --- a/assets/environments/development.env +++ /dev/null @@ -1 +0,0 @@ -API_BASE_URL=https://api.github.com/repos/vandadnp/flutter-tips-and-tricks diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 5079437..911368a 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -1,8 +1,9 @@ opt_out_usage +fastlane_require 'dotenv' def compilation_envs - if File.file?('../.env') - Dotenv.parse('../.env') + if File.file?("#{root_path}/.env") + Dotenv.parse("#{root_path}/.env") .map { |key, value| "--dart-define=#{key}=#{value}" } .join(' ') else @@ -113,11 +114,22 @@ lane :build_flutter do |options| flavor = options[:flavor] || 'dev' config_param = config_only ? '--config-only' : '' + version_name = calculate_version_name( + include_git_version_suffix: options[:include_git_version_suffix] || false + ) + + export_method = options[:export_method] || '' + if !export_method.empty? + export_method = "--export-method #{export_method}" + end + + flutter_command(command: "build #{build_platform} #{build_type} --suppress-analytics #{sign_param} #{config_param} --flavor #{flavor} --dart-define=ENV=#{flavor} --build-name #{version_name} #{export_method} #{compilation_envs}") +end + +private_lane :calculate_version_name do |options| include_git_version_suffix = options[:include_git_version_suffix] || false version_suffix = include_git_version_suffix ? "-#{last_git_commit[:abbreviated_commit_hash]}" : '' version_name = flutter_version()["version_name"] + version_suffix - - flutter_command(command: "build #{build_platform} --suppress-analytics #{build_type} #{sign_param} #{config_param} --flavor #{flavor} --dart-define=ENV=#{flavor} --build-name #{version_name}") end private_lane :generate_snapshot_changelog do diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile index 9f455d1..fa81426 100644 --- a/fastlane/Pluginfile +++ b/fastlane/Pluginfile @@ -3,3 +3,4 @@ # Ensure this file is checked in to source control! gem 'fastlane-plugin-flutter_version' +gem 'fastlane-plugin-firebase_app_distribution' diff --git a/ios/.gitignore b/ios/.gitignore index 7a7f987..52c31a9 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -32,3 +32,17 @@ Runner/GeneratedPluginRegistrant.* !default.mode2v3 !default.pbxuser !default.perspectivev3 + +# Certificates & Profiles +*.certSigningRequest +*.cer +*.p12 +*.mobileprovision + +# Ipa +/Runner.app.dSYM.zip +/Runner.ipa + +# Firebase +**/GoogleService-Info*.plist +/firebase_app_id_file.json diff --git a/ios/.ruby-version b/ios/.ruby-version new file mode 120000 index 0000000..5e66ef4 --- /dev/null +++ b/ios/.ruby-version @@ -0,0 +1 @@ +../.ruby-version \ No newline at end of file diff --git a/ios/Flutter/devDebug.xcconfig b/ios/Flutter/devDebug.xcconfig index 0a7ecdd..cec5d6f 100644 --- a/ios/Flutter/devDebug.xcconfig +++ b/ios/Flutter/devDebug.xcconfig @@ -2,5 +2,5 @@ FLUTTER_TARGET=lib/main.dart ASSET_PREFIX=dev -BUNDLE_NAME=Template Dev -BUNDLE_DISPLAY_NAME=Template Dev +BUNDLE_NAME=Fluttips Dev +BUNDLE_DISPLAY_NAME=Fluttips Dev diff --git a/ios/Flutter/devProfile.xcconfig b/ios/Flutter/devProfile.xcconfig index 0a7ecdd..cec5d6f 100644 --- a/ios/Flutter/devProfile.xcconfig +++ b/ios/Flutter/devProfile.xcconfig @@ -2,5 +2,5 @@ FLUTTER_TARGET=lib/main.dart ASSET_PREFIX=dev -BUNDLE_NAME=Template Dev -BUNDLE_DISPLAY_NAME=Template Dev +BUNDLE_NAME=Fluttips Dev +BUNDLE_DISPLAY_NAME=Fluttips Dev diff --git a/ios/Flutter/devRelease.xcconfig b/ios/Flutter/devRelease.xcconfig index 0a7ecdd..cec5d6f 100644 --- a/ios/Flutter/devRelease.xcconfig +++ b/ios/Flutter/devRelease.xcconfig @@ -2,5 +2,5 @@ FLUTTER_TARGET=lib/main.dart ASSET_PREFIX=dev -BUNDLE_NAME=Template Dev -BUNDLE_DISPLAY_NAME=Template Dev +BUNDLE_NAME=Fluttips Dev +BUNDLE_DISPLAY_NAME=Fluttips Dev diff --git a/ios/Flutter/prodDebug.xcconfig b/ios/Flutter/prodDebug.xcconfig index a5a303e..9fa5e38 100644 --- a/ios/Flutter/prodDebug.xcconfig +++ b/ios/Flutter/prodDebug.xcconfig @@ -2,5 +2,5 @@ FLUTTER_TARGET=lib/main.dart ASSET_PREFIX=prod -BUNDLE_NAME=Template -BUNDLE_DISPLAY_NAME=Template +BUNDLE_NAME=Fluttips +BUNDLE_DISPLAY_NAME=Fluttips diff --git a/ios/Flutter/prodProfile.xcconfig b/ios/Flutter/prodProfile.xcconfig index a5a303e..9fa5e38 100644 --- a/ios/Flutter/prodProfile.xcconfig +++ b/ios/Flutter/prodProfile.xcconfig @@ -2,5 +2,5 @@ FLUTTER_TARGET=lib/main.dart ASSET_PREFIX=prod -BUNDLE_NAME=Template -BUNDLE_DISPLAY_NAME=Template +BUNDLE_NAME=Fluttips +BUNDLE_DISPLAY_NAME=Fluttips diff --git a/ios/Flutter/prodRelease.xcconfig b/ios/Flutter/prodRelease.xcconfig index a5a303e..9fa5e38 100644 --- a/ios/Flutter/prodRelease.xcconfig +++ b/ios/Flutter/prodRelease.xcconfig @@ -2,5 +2,5 @@ FLUTTER_TARGET=lib/main.dart ASSET_PREFIX=prod -BUNDLE_NAME=Template -BUNDLE_DISPLAY_NAME=Template +BUNDLE_NAME=Fluttips +BUNDLE_DISPLAY_NAME=Fluttips diff --git a/ios/Flutter/stagingDebug.xcconfig b/ios/Flutter/stagingDebug.xcconfig deleted file mode 100644 index 11dd610..0000000 --- a/ios/Flutter/stagingDebug.xcconfig +++ /dev/null @@ -1,6 +0,0 @@ -#include "Generated.xcconfig" - -FLUTTER_TARGET=lib/main.dart -ASSET_PREFIX=staging -BUNDLE_NAME=Template Sta -BUNDLE_DISPLAY_NAME=Template Sta diff --git a/ios/Flutter/stagingProfile.xcconfig b/ios/Flutter/stagingProfile.xcconfig deleted file mode 100644 index 11dd610..0000000 --- a/ios/Flutter/stagingProfile.xcconfig +++ /dev/null @@ -1,6 +0,0 @@ -#include "Generated.xcconfig" - -FLUTTER_TARGET=lib/main.dart -ASSET_PREFIX=staging -BUNDLE_NAME=Template Sta -BUNDLE_DISPLAY_NAME=Template Sta diff --git a/ios/Flutter/stagingRelease.xcconfig b/ios/Flutter/stagingRelease.xcconfig deleted file mode 100644 index 11dd610..0000000 --- a/ios/Flutter/stagingRelease.xcconfig +++ /dev/null @@ -1,6 +0,0 @@ -#include "Generated.xcconfig" - -FLUTTER_TARGET=lib/main.dart -ASSET_PREFIX=staging -BUNDLE_NAME=Template Sta -BUNDLE_DISPLAY_NAME=Template Sta diff --git a/ios/Gemfile b/ios/Gemfile deleted file mode 100644 index fac56af..0000000 --- a/ios/Gemfile +++ /dev/null @@ -1,7 +0,0 @@ -source "https://rubygems.org" - -gem "fastlane" -gem 'cocoapods' - -plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') -eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/ios/Gemfile b/ios/Gemfile new file mode 120000 index 0000000..26cb2ad --- /dev/null +++ b/ios/Gemfile @@ -0,0 +1 @@ +../Gemfile \ No newline at end of file diff --git a/ios/Gemfile.lock b/ios/Gemfile.lock deleted file mode 100644 index 736a7f1..0000000 --- a/ios/Gemfile.lock +++ /dev/null @@ -1,286 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (3.0.5) - rexml - activesupport (6.1.7) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - zeitwerk (~> 2.3) - addressable (2.8.1) - public_suffix (>= 2.0.2, < 6.0) - algoliasearch (1.27.5) - httpclient (~> 2.8, >= 2.8.3) - json (>= 1.5.1) - artifactory (3.0.15) - atomos (0.1.3) - aws-eventstream (1.2.0) - aws-partitions (1.628.0) - aws-sdk-core (3.144.0) - aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.525.0) - aws-sigv4 (~> 1.1) - jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.58.0) - aws-sdk-core (~> 3, >= 3.127.0) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.114.0) - aws-sdk-core (~> 3, >= 3.127.0) - aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.4) - aws-sigv4 (1.5.1) - aws-eventstream (~> 1, >= 1.0.2) - babosa (1.0.4) - claide (1.1.0) - cocoapods (1.11.3) - addressable (~> 2.8) - claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.11.3) - cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.4.0, < 2.0) - cocoapods-plugins (>= 1.0.0, < 2.0) - cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.4.0, < 2.0) - cocoapods-try (>= 1.1.0, < 2.0) - colored2 (~> 3.1) - escape (~> 0.0.4) - fourflusher (>= 2.3.0, < 3.0) - gh_inspector (~> 1.0) - molinillo (~> 0.8.0) - nap (~> 1.0) - ruby-macho (>= 1.0, < 3.0) - xcodeproj (>= 1.21.0, < 2.0) - cocoapods-core (1.11.3) - activesupport (>= 5.0, < 7) - addressable (~> 2.8) - algoliasearch (~> 1.0) - concurrent-ruby (~> 1.1) - fuzzy_match (~> 2.0.4) - nap (~> 1.0) - netrc (~> 0.11) - public_suffix (~> 4.0) - typhoeus (~> 1.0) - cocoapods-deintegrate (1.0.5) - cocoapods-downloader (1.6.3) - cocoapods-plugins (1.0.0) - nap - cocoapods-search (1.0.1) - cocoapods-trunk (1.6.0) - nap (>= 0.8, < 2.0) - netrc (~> 0.11) - cocoapods-try (1.2.0) - colored (1.2) - colored2 (3.1.2) - commander (4.6.0) - highline (~> 2.0.0) - concurrent-ruby (1.1.10) - declarative (0.0.20) - digest-crc (0.6.4) - rake (>= 12.0.0, < 14.0.0) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - dotenv (2.8.1) - emoji_regex (3.2.3) - escape (0.0.4) - ethon (0.15.0) - ffi (>= 1.15.0) - excon (0.92.4) - faraday (1.10.2) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - ruby2_keywords (>= 0.0.4) - faraday-cookie_jar (0.0.7) - faraday (>= 0.8.0) - http-cookie (~> 1.0.0) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-multipart (1.0.4) - multipart-post (~> 2) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) - faraday_middleware (1.2.0) - faraday (~> 1.0) - fastimage (2.2.6) - fastlane (2.209.1) - CFPropertyList (>= 2.3, < 4.0.0) - addressable (>= 2.8, < 3.0.0) - artifactory (~> 3.0) - aws-sdk-s3 (~> 1.0) - babosa (>= 1.0.3, < 2.0.0) - bundler (>= 1.12.0, < 3.0.0) - colored - commander (~> 4.6) - dotenv (>= 2.1.1, < 3.0.0) - emoji_regex (>= 0.1, < 4.0) - excon (>= 0.71.0, < 1.0.0) - faraday (~> 1.0) - faraday-cookie_jar (~> 0.0.6) - faraday_middleware (~> 1.0) - fastimage (>= 2.1.0, < 3.0.0) - gh_inspector (>= 1.1.2, < 2.0.0) - google-apis-androidpublisher_v3 (~> 0.3) - google-apis-playcustomapp_v1 (~> 0.1) - google-cloud-storage (~> 1.31) - highline (~> 2.0) - json (< 3.0.0) - jwt (>= 2.1.0, < 3) - mini_magick (>= 4.9.4, < 5.0.0) - multipart-post (~> 2.0.0) - naturally (~> 2.2) - optparse (~> 0.1.1) - plist (>= 3.1.0, < 4.0.0) - rubyzip (>= 2.0.0, < 3.0.0) - security (= 0.1.3) - simctl (~> 1.6.3) - terminal-notifier (>= 2.0.0, < 3.0.0) - terminal-table (>= 1.4.5, < 2.0.0) - tty-screen (>= 0.6.3, < 1.0.0) - tty-spinner (>= 0.8.0, < 1.0.0) - word_wrap (~> 1.0.0) - xcodeproj (>= 1.13.0, < 2.0.0) - xcpretty (~> 0.3.0) - xcpretty-travis-formatter (>= 0.0.3) - fastlane-plugin-flutter_version (1.1.15) - ffi (1.15.5) - fourflusher (2.3.1) - fuzzy_match (2.0.4) - gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.26.0) - google-apis-core (>= 0.7, < 2.a) - google-apis-core (0.7.0) - addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.16.2, < 2.a) - httpclient (>= 2.8.1, < 3.a) - mini_mime (~> 1.0) - representable (~> 3.0) - retriable (>= 2.0, < 4.a) - rexml - webrick - google-apis-iamcredentials_v1 (0.13.0) - google-apis-core (>= 0.7, < 2.a) - google-apis-playcustomapp_v1 (0.10.0) - google-apis-core (>= 0.7, < 2.a) - google-apis-storage_v1 (0.17.0) - google-apis-core (>= 0.7, < 2.a) - google-cloud-core (1.6.0) - google-cloud-env (~> 1.0) - google-cloud-errors (~> 1.0) - google-cloud-env (1.6.0) - faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.2.0) - google-cloud-storage (1.39.0) - addressable (~> 2.8) - digest-crc (~> 0.4) - google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.17.0) - google-cloud-core (~> 1.6) - googleauth (>= 0.16.2, < 2.a) - mini_mime (~> 1.0) - googleauth (1.2.0) - faraday (>= 0.17.3, < 3.a) - jwt (>= 1.4, < 3.0) - memoist (~> 0.16) - multi_json (~> 1.11) - os (>= 0.9, < 2.0) - signet (>= 0.16, < 2.a) - highline (2.0.3) - http-cookie (1.0.5) - domain_name (~> 0.5) - httpclient (2.8.3) - i18n (1.12.0) - concurrent-ruby (~> 1.0) - jmespath (1.6.1) - json (2.6.2) - jwt (2.5.0) - memoist (0.16.2) - mini_magick (4.11.0) - mini_mime (1.1.2) - minitest (5.16.3) - molinillo (0.8.0) - multi_json (1.15.0) - multipart-post (2.0.0) - nanaimo (0.3.0) - nap (1.1.0) - naturally (2.2.1) - netrc (0.11.0) - optparse (0.1.1) - os (1.1.4) - plist (3.6.0) - public_suffix (4.0.7) - rake (13.0.6) - representable (3.2.0) - declarative (< 0.1.0) - trailblazer-option (>= 0.1.1, < 0.2.0) - uber (< 0.2.0) - retriable (3.1.2) - rexml (3.2.5) - rouge (2.0.7) - ruby-macho (2.5.1) - ruby2_keywords (0.0.5) - rubyzip (2.3.2) - security (0.1.3) - signet (0.17.0) - addressable (~> 2.8) - faraday (>= 0.17.5, < 3.a) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) - simctl (1.6.8) - CFPropertyList - naturally - terminal-notifier (2.0.0) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - trailblazer-option (0.1.2) - tty-cursor (0.7.1) - tty-screen (0.8.1) - tty-spinner (0.9.3) - tty-cursor (~> 0.7) - typhoeus (1.4.0) - ethon (>= 0.9.0) - tzinfo (2.0.5) - concurrent-ruby (~> 1.0) - uber (0.1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) - unicode-display_width (1.8.0) - webrick (1.7.0) - word_wrap (1.0.0) - xcodeproj (1.22.0) - CFPropertyList (>= 2.3.3, < 4.0) - atomos (~> 0.1.3) - claide (>= 1.0.2, < 2.0) - colored2 (~> 3.1) - nanaimo (~> 0.3.0) - rexml (~> 3.2.4) - xcpretty (0.3.0) - rouge (~> 2.0.7) - xcpretty-travis-formatter (1.0.1) - xcpretty (~> 0.2, >= 0.0.7) - zeitwerk (2.6.0) - -PLATFORMS - universal-darwin-21 - -DEPENDENCIES - cocoapods - fastlane - fastlane-plugin-flutter_version - -BUNDLED WITH - 2.3.11 diff --git a/ios/Gemfile.lock b/ios/Gemfile.lock new file mode 120000 index 0000000..412e45f --- /dev/null +++ b/ios/Gemfile.lock @@ -0,0 +1 @@ +../Gemfile.lock \ No newline at end of file diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 2cae357..e8a06b6 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,4 +1,15 @@ PODS: + - Firebase/CoreOnly (10.1.0): + - FirebaseCore (= 10.1.0) + - firebase_core (2.2.0): + - Firebase/CoreOnly (= 10.1.0) + - Flutter + - FirebaseCore (10.1.0): + - FirebaseCoreInternal (~> 10.0) + - GoogleUtilities/Environment (~> 7.8) + - GoogleUtilities/Logger (~> 7.8) + - FirebaseCoreInternal (10.1.0): + - "GoogleUtilities/NSData+zlib (~> 7.8)" - Flutter (1.0.0) - flutter_native_splash (0.0.1): - Flutter @@ -9,8 +20,14 @@ PODS: - FMDB (2.7.5): - FMDB/standard (= 2.7.5) - FMDB/standard (2.7.5) + - GoogleUtilities/Environment (7.10.0): + - PromisesObjC (< 3.0, >= 1.2) + - GoogleUtilities/Logger (7.10.0): + - GoogleUtilities/Environment + - "GoogleUtilities/NSData+zlib (7.10.0)" - path_provider_ios (0.0.1): - Flutter + - PromisesObjC (2.1.1) - shared_preferences_ios (0.0.1): - Flutter - sqflite (0.0.2): @@ -18,6 +35,7 @@ PODS: - FMDB (>= 2.7.5) DEPENDENCIES: + - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - Flutter (from `Flutter`) - flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`) - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) @@ -28,9 +46,16 @@ DEPENDENCIES: SPEC REPOS: trunk: + - Firebase + - FirebaseCore + - FirebaseCoreInternal - FMDB + - GoogleUtilities + - PromisesObjC EXTERNAL SOURCES: + firebase_core: + :path: ".symlinks/plugins/firebase_core/ios" Flutter: :path: Flutter flutter_native_splash: @@ -47,12 +72,18 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/sqflite/ios" SPEC CHECKSUMS: + Firebase: 444b35a9c568a516666213c2f6cccd10cb12559f + firebase_core: d2242c6f318db1d0dcecfbfa491e943337b0d755 + FirebaseCore: 55e7ae35991ccca4db03ff8d8df6ed5f17a3e4c7 + FirebaseCoreInternal: 96d75228e10fd369564da51bd898414eb0f54df5 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec flutter_web_browser: 7bccaafbb0c5b8862afe7bcd158f15557109f61f FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a + GoogleUtilities: bad72cb363809015b1f7f19beb1f1cd23c589f95 path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 + PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 741f709..ff9ce85 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,11 +3,14 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 51; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 162402D72926C01800252288 /* GoogleService-Info-dev.plist in Resources */ = {isa = PBXBuildFile; fileRef = 162402D62926C01800252288 /* GoogleService-Info-dev.plist */; }; + 165268392922E06400EA841F /* BuildFile in Resources */ = {isa = PBXBuildFile; }; + 169164D72927C74B00A31368 /* GoogleService-Info-prod.plist in Resources */ = {isa = PBXBuildFile; fileRef = 169164D62927C74B00A31368 /* GoogleService-Info-prod.plist */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; @@ -30,9 +33,10 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 113F326E4F1DD43142CE6D30 /* stagingDebug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = stagingDebug.xcconfig; path = Flutter/stagingDebug.xcconfig; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 162402D62926C01800252288 /* GoogleService-Info-dev.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info-dev.plist"; sourceTree = ""; }; + 169164D62927C74B00A31368 /* GoogleService-Info-prod.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info-prod.plist"; sourceTree = ""; }; 19DE69E649E7835C8EA73D40 /* Pods-Runner.debug-dev.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug-dev.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug-dev.xcconfig"; sourceTree = ""; }; 2029D51775AFC771435DA155 /* Pods-Runner.profile-dev.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile-dev.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile-dev.xcconfig"; sourceTree = ""; }; 21BC3E4201BD6DDEC1196AA9 /* Pods-Runner.debug-prod.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug-prod.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug-prod.xcconfig"; sourceTree = ""; }; @@ -60,11 +64,9 @@ 9A82AAD70AD437D80A19FE2C /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BF41E84758AF984855B34375 /* devProfile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = devProfile.xcconfig; path = Flutter/devProfile.xcconfig; sourceTree = ""; }; CBF59D559BA9C729681A675A /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - D7BA5182467EB92CA3E895F1 /* stagingRelease.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = stagingRelease.xcconfig; path = Flutter/stagingRelease.xcconfig; sourceTree = ""; }; E5D8DD0A72BDC2D9AC4F6F09 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; E65075458592F9F001F344C1 /* Pods-Runner.profile-prod.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile-prod.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile-prod.xcconfig"; sourceTree = ""; }; ED9BFBD52F04E77F2174E192 /* devRelease.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = devRelease.xcconfig; path = Flutter/devRelease.xcconfig; sourceTree = ""; }; - FA08A5EF6F6A019FEADEFC1B /* stagingProfile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = stagingProfile.xcconfig; path = Flutter/stagingProfile.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -79,6 +81,23 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 162402D22926BF8F00252288 /* Resources */ = { + isa = PBXGroup; + children = ( + 162402D32926BFB700252288 /* Firebase */, + ); + path = Resources; + sourceTree = ""; + }; + 162402D32926BFB700252288 /* Firebase */ = { + isa = PBXGroup; + children = ( + 169164D62927C74B00A31368 /* GoogleService-Info-prod.plist */, + 162402D62926C01800252288 /* GoogleService-Info-dev.plist */, + ); + path = Firebase; + sourceTree = ""; + }; 4F5AE2277FAA80AD31FBBBAB /* Pods */ = { isa = PBXGroup; children = ( @@ -111,9 +130,6 @@ 5626E2C804EE32F56C2D8F06 /* prodDebug.xcconfig */, 6C37016DF19997B0AAD05FAF /* prodProfile.xcconfig */, 51B5A3EF356677109FE751EB /* prodRelease.xcconfig */, - 113F326E4F1DD43142CE6D30 /* stagingDebug.xcconfig */, - FA08A5EF6F6A019FEADEFC1B /* stagingProfile.xcconfig */, - D7BA5182467EB92CA3E895F1 /* stagingRelease.xcconfig */, ); name = Flutter; sourceTree = ""; @@ -140,6 +156,7 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( + 162402D22926BF8F00252288 /* Resources */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, @@ -175,6 +192,7 @@ 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, D5CF141EA3C039B9A80DF808 /* [CP] Embed Pods Frameworks */, + 162402D82926C0F800252288 /* Copy Firebase Files */, ); buildRules = ( ); @@ -225,14 +243,35 @@ files = ( 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 169164D72927C74B00A31368 /* GoogleService-Info-prod.plist in Resources */, + 165268392922E06400EA841F /* BuildFile in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + 162402D72926C01800252288 /* GoogleService-Info-dev.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 162402D82926C0F800252288 /* Copy Firebase Files */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Copy Firebase Files"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "PATH_TO_GOOGLE_PLISTS=\"${PROJECT_DIR}/Runner/Resources/Firebase\"\nexit 0\ncase \"${CONFIGURATION}\" in\n *\"dev\"*)\n cp -r \"$PATH_TO_GOOGLE_PLISTS/GoogleService-Info-dev.plist\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist\" ;;\n\n *\"prod\"*)\n cp -r \"$PATH_TO_GOOGLE_PLISTS/GoogleService-Info-prod.plist\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist\" ;;\n\n *)\n echo \"INVALID FILE\";;\nesac\n"; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -259,7 +298,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n"; }; D46D8183220C367CCE0B279B /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; @@ -338,6 +377,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 21BC3E4201BD6DDEC1196AA9 /* Pods-Runner.debug-prod.xcconfig */; buildSettings = { + DEVELOPMENT_TEAM = ""; PRODUCT_NAME = Runner; }; name = "Debug-prod"; @@ -346,6 +386,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = E65075458592F9F001F344C1 /* Pods-Runner.profile-prod.xcconfig */; buildSettings = { + DEVELOPMENT_TEAM = ""; PRODUCT_NAME = Runner; }; name = "Profile-prod"; @@ -354,6 +395,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 2B82596BB830AA758A68457E /* Pods-Runner.release-prod.xcconfig */; buildSettings = { + DEVELOPMENT_TEAM = ""; PRODUCT_NAME = Runner; }; name = "Release-prod"; @@ -417,7 +459,7 @@ "$(PROJECT_DIR)/Flutter", ); MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.template; + PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.fluttips; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -485,6 +527,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -557,7 +600,7 @@ "$(PROJECT_DIR)/Flutter", ); MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.template; + PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.fluttips; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; @@ -635,7 +678,7 @@ ); MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.template; + PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.fluttips; SDKROOT = iphoneos; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -759,6 +802,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -780,6 +824,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -859,7 +904,7 @@ ); MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.template.dev; + PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.fluttips.dev; SDKROOT = iphoneos; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -874,6 +919,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -888,101 +934,6 @@ }; name = "Debug-dev"; }; - EF77F549277A2ECA002382BD /* Debug-staging */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 113F326E4F1DD43142CE6D30 /* stagingDebug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.template.sta; - SDKROOT = iphoneos; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = "Debug-staging"; - }; - EF77F54A277A2ECA002382BD /* Debug-staging */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = "Debug-staging"; - }; EF77F54D277A2EE3002382BD /* Release-dev */ = { isa = XCBuildConfiguration; baseConfigurationReference = ED9BFBD52F04E77F2174E192 /* devRelease.xcconfig */; @@ -1042,7 +993,7 @@ "$(PROJECT_DIR)/Flutter", ); MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.template.dev; + PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.fluttips.dev; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; @@ -1060,7 +1011,10 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 6F2G55XL63; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -1068,103 +1022,14 @@ "@executable_path/Frameworks", ); PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = "Release-dev"; }; - EF77F54F277A2EEF002382BD /* Release-staging */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = D7BA5182467EB92CA3E895F1 /* stagingRelease.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.template.sta; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = "Release-staging"; - }; - EF77F550277A2EEF002382BD /* Release-staging */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = "Release-staging"; - }; EF77F551277A2EF9002382BD /* Profile-dev */ = { isa = XCBuildConfiguration; baseConfigurationReference = BF41E84758AF984855B34375 /* devProfile.xcconfig */; @@ -1224,7 +1089,7 @@ "$(PROJECT_DIR)/Flutter", ); MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.template.dev; + PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.fluttips.dev; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -1241,6 +1106,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -1254,95 +1120,6 @@ }; name = "Profile-dev"; }; - EF77F553277A2F00002382BD /* Profile-staging */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FA08A5EF6F6A019FEADEFC1B /* stagingProfile.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.template.sta; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = "Profile-staging"; - }; - EF77F554277A2F00002382BD /* Profile-staging */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = "Profile-staging"; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1350,13 +1127,10 @@ isa = XCConfigurationList; buildConfigurations = ( 97C147031CF9000F007C117D /* Debug */, - EF77F549277A2ECA002382BD /* Debug-staging */, EF77F547277A2EB9002382BD /* Debug-dev */, 97C147041CF9000F007C117D /* Release */, - EF77F54F277A2EEF002382BD /* Release-staging */, EF77F54D277A2EE3002382BD /* Release-dev */, 249021D3217E4FDB00AE95B9 /* Profile */, - EF77F553277A2F00002382BD /* Profile-staging */, EF77F551277A2EF9002382BD /* Profile-dev */, 6A4688566FA7E43E7902F706 /* Debug-prod */, 21BCA9812292A07E3CD79BE9 /* Profile-prod */, @@ -1369,13 +1143,10 @@ isa = XCConfigurationList; buildConfigurations = ( 97C147061CF9000F007C117D /* Debug */, - EF77F54A277A2ECA002382BD /* Debug-staging */, EF77F548277A2EB9002382BD /* Debug-dev */, 97C147071CF9000F007C117D /* Release */, - EF77F550277A2EEF002382BD /* Release-staging */, EF77F54E277A2EE3002382BD /* Release-dev */, 249021D4217E4FDB00AE95B9 /* Profile */, - EF77F554277A2F00002382BD /* Profile-staging */, EF77F552277A2EF9002382BD /* Profile-dev */, 166C1E4228CCF69700BF4C53 /* Debug-prod */, 166C1E4328CCF69700BF4C53 /* Profile-prod */, diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/dev.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/dev.xcscheme index 7f20854..5609c27 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/dev.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/dev.xcscheme @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard index f3c2851..9d4fa60 100644 --- a/ios/Runner/Base.lproj/Main.storyboard +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -1,8 +1,10 @@ - - + + + - + + @@ -14,13 +16,14 @@ - + - + + diff --git a/ios/fastlane/Appfile b/ios/fastlane/Appfile index 6a26f53..a42d398 100644 --- a/ios/fastlane/Appfile +++ b/ios/fastlane/Appfile @@ -1,3 +1,2 @@ -app_identifier("com.xmartlabs.template") # The bundle identifier of your app - -team_id(ENV['TEAM_ID']) # Developer Portal Team ID +app_identifier("com.xmartlabs.fluttips") +team_id(ENV['APPLE_TEAM_ID']) diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 3c2960a..9270b58 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -1,16 +1,29 @@ import "../../fastlane/Fastfile" +PLIST_FILE = 'export_options.plist' +PROD_ENV = 'prod' +DEV_ENV = 'dev' +DEFAULT_ENV = PROD_ENV +PROD_BUNDLE_ID = "com.xmartlabs.fluttips" +DEV_BUNDLE_ID = "#{PROD_BUNDLE_ID}.dev" + default_platform(:ios) -provisioning_name = 'FastlaneXL' +provisioning_name = 'fluttips_fastlane' platform :ios do + + desc "Creates a temporal keystore and import the distribution certificate" + desc "#### Envs\n" + + "* **`TEMP_KEYCHAIN_NAME`**: The temporal keychain name\n" + + "* **`TEMP_KEYCHAIN_PASSWORD`**: The temporal keychain password\n" + + "* **`DIST_CERTIFICATE_PATH`**: The distribution certificate file path.\n" + + "* **`DIST_CERTIFICATE_PASSWORD`**: The distribution certificate file password. If you are using a cert file this file is not necessary." lane :set_signing do safe_delete_keychain create_keychain( name: ENV['TEMP_KEYCHAIN_NAME'], password: ENV['TEMP_KEYCHAIN_PASSWORD'], - default_keychain: true, unlock: true, timeout: 3600, lock_when_sleeps: true @@ -23,43 +36,76 @@ platform :ios do ) end - private_lane :setup_provisioning do + desc "Gets or creates the provisioning profiles and setup the project to use manual signing." + desc "#### Envs:\n" + + "* **`APPLE_TEAM_ID`**: The apple team id" + private_lane :setup_provisioning do |options| + env = options[:env] || DEFAULT_ENV + app_identifier = options[:env] == DEV_ENV ? DEV_BUNDLE_ID : PROD_BUNDLE_ID + build_export_method = options[:build_export_method] || 'app-store' + adhoc = build_export_method == 'ad-hoc' + profile_type_name = adhoc ? 'AdHoc' : 'AppStore' + get_provisioning_profile( + adhoc: adhoc, team_id: ENV['APPLE_TEAM_ID'], - provisioning_name: provisioning_name, + force: true, + include_all_certificates: true, + provisioning_name: '#{provisioning_name}-#{profile_type_name}-#{env}', + app_identifier: app_identifier, ) update_code_signing_settings( use_automatic_signing: false, path: "Runner.xcodeproj", team_id: ENV['APPLE_TEAM_ID'], - build_configurations: "Release-prod", + build_configurations: "Release-#{env}", ) + update_project_team( + path: "Runner.xcodeproj", + teamid: ENV['APPLE_TEAM_ID'], + ) update_project_provisioning( xcodeproj: "Runner.xcodeproj", - build_configuration: "Release-prod", + build_configuration: "Release-#{env}", + profile: "./#{profile_type_name}_#{app_identifier}.mobileprovision", code_signing_identity: "Apple Distribution" ) end - private_lane :rollback_provisioning_setup do + private_lane :rollback_provisioning_setup do |options| + env = options[:env] || DEFAULT_ENV + update_project_team( + path: "Runner.xcodeproj", + teamid: '', + ) update_code_signing_settings( use_automatic_signing: true, path: "Runner.xcodeproj", team_id: ENV['APPLE_TEAM_ID'], - build_configurations: "Release-prod", + build_configurations: "Release-#{env}", profile_uuid: '', code_sign_identity: 'Apple Development', ) end - desc "Push a new beta build to TestFlight" - lane :publish_prod_testflight do |options| - sign_enabled = options[:setup_signing] || false + desc "Build deploy version" + desc "#### Envs:\n" + + "* **`env`**: Environment to build. Default 'prod'\n" + + "* **`build_export_method`**: Export metod to generate the ipa. Default 'app-store'.\n" + + "* **`setup_signing`**: if true, `set_signing` is called.\n" + + "* **`APPLE_TEAM_ID`**: The apple team id\n" + + "* **`APPSTORE_CONNECT_API_KEY_ID`**: The connect api key id\n" + + "* **`APPSTORE_CONNECT_API_KEY_ISSUER_ID`**: The connect api key issuer id\n" + + "* **`APPSTORE_CONNECT_API_KEY_BASE_64_CONTENT`**: The api key base64 content" + lane :generate_release_ipa do |options| + sign_enabled = options[:setup_signing] || true if sign_enabled set_signing end + env = options[:env] || DEFAULT_ENV + build_export_method = options[:build_export_method] || 'app-store' begin api_key = app_store_connect_api_key( key_id: ENV['APPSTORE_CONNECT_API_KEY_ID'], @@ -69,25 +115,61 @@ platform :ios do in_house: false, ) - setup_provisioning - - build_flutter(build_platform: 'ios', flavor: 'prod') + setup_provisioning( + env: env, + build_export_method: build_export_method, + ) + build_flutter( + build_platform: 'ipa', + build_type: 'release', + flavor: env, + include_git_version_suffix: true, + export_method: build_export_method, + ) + app_identifier = options[:env] == DEV_ENV ? DEV_BUNDLE_ID : PROD_BUNDLE_ID build_ios_app( clean: false, - scheme: 'prod', - silent: true, + scheme: env, export_team_id: ENV['APPLE_TEAM_ID'], - export_method: "app-store", + export_method: build_export_method, + export_options: { + compileBitcode: true, + uploadBitcode: true, + uploadSymbols: true, + signingStyle: "manual", + }, ) - upload_to_testflight(skip_waiting_for_build_processing: true) ensure - rollback_provisioning_setup + rollback_provisioning_setup(env: env) safe_delete_keychain end end + desc "Push a new beta build to TestFlight" + desc "#### Envs:\n" + + "* **`setup_signing`**: if true, `set_signing` is called.\n" + + "* **`APPLE_TEAM_ID`**: The apple team id\n" + + "* **`APPSTORE_CONNECT_API_KEY_ID`**: The connect api key id\n" + + "* **`APPSTORE_CONNECT_API_KEY_ISSUER_ID`**: The connect api key issuer id\n" + + "* **`APPSTORE_CONNECT_API_KEY_BASE_64_CONTENT`**: The api key base64 content" + lane :publish_dev_firebase do |options| + generate_release_ipa( + env: 'dev', + build_export_method: 'ad-hoc', + ) + + firebase_app_distribution( + app: ENV['FIREBASE_APP_ID_DEV'], + service_credentials_file: ENV["FIREBASE_SERVICE_ACCOUNT_FILE"], + testers: ENV["FIREBASE_TESTERS"], + groups: ENV["FIREBASE_TESTER_GROUPS"], + release_notes: generate_snapshot_changelog, + apk_path: "../Runner.ipa", + ) + end + private_lane :safe_delete_keychain do begin FastlaneCore::Helper.keychain_path(ENV['TEMP_KEYCHAIN_NAME']) diff --git a/ios/fastlane/Pluginfile b/ios/fastlane/Pluginfile index 9f455d1..fa81426 100644 --- a/ios/fastlane/Pluginfile +++ b/ios/fastlane/Pluginfile @@ -3,3 +3,4 @@ # Ensure this file is checked in to source control! gem 'fastlane-plugin-flutter_version' +gem 'fastlane-plugin-firebase_app_distribution' diff --git a/ios/fastlane/README.md b/ios/fastlane/README.md index 9ff5dfc..fc29f60 100644 --- a/ios/fastlane/README.md +++ b/ios/fastlane/README.md @@ -37,6 +37,14 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do **Lint: Check code format** +### lint_check_language_sorting + +```sh +[bundle exec] fastlane lint_check_language_sorting +``` + +**Lint: Check code format** + ### lint_analyze ```sh @@ -104,16 +112,46 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do [bundle exec] fastlane ios set_signing ``` +Creates a temporal keystore and import the distribution certificate +#### Envs +* **`TEMP_KEYCHAIN_NAME`**: The temporal keychain name +* **`TEMP_KEYCHAIN_PASSWORD`**: The temporal keychain password +* **`DIST_CERTIFICATE_PATH`**: The distribution certificate file path. +* **`DIST_CERTIFICATE_PASSWORD`**: The distribution certificate file password. If you are using a cert file this file is not necessary. -### ios publish_prod_testflight +### ios generate_release_ipa ```sh -[bundle exec] fastlane ios publish_prod_testflight +[bundle exec] fastlane ios generate_release_ipa +``` + +Build deploy version + +#### Envs: +* **`env`**: Environment to build. Default 'prod' +* **`build_export_method`**: Export metod to generate the ipa. Default 'app-store'. +* **`setup_signing`**: if true, `set_signing` is called. +* **`APPLE_TEAM_ID`**: The apple team id +* **`APPSTORE_CONNECT_API_KEY_ID`**: The connect api key id +* **`APPSTORE_CONNECT_API_KEY_ISSUER_ID`**: The connect api key issuer id +* **`APPSTORE_CONNECT_API_KEY_BASE_64_CONTENT`**: The api key base64 content + +### ios publish_dev_firebase + +```sh +[bundle exec] fastlane ios publish_dev_firebase ``` Push a new beta build to TestFlight +#### Envs: +* **`setup_signing`**: if true, `set_signing` is called. +* **`APPLE_TEAM_ID`**: The apple team id +* **`APPSTORE_CONNECT_API_KEY_ID`**: The connect api key id +* **`APPSTORE_CONNECT_API_KEY_ISSUER_ID`**: The connect api key issuer id +* **`APPSTORE_CONNECT_API_KEY_BASE_64_CONTENT`**: The api key base64 content + ---- This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. diff --git a/lib/core/common/config.dart b/lib/core/common/config.dart index a6db54f..ba80136 100644 --- a/lib/core/common/config.dart +++ b/lib/core/common/config.dart @@ -3,14 +3,14 @@ import 'dart:async'; import 'dart:math'; -import 'package:flutter_template/core/common/extension/string_extensions.dart'; -import 'package:flutter_template/core/common/helper/enum_helpers.dart'; -import 'package:flutter_template/core/common/helper/env_helper.dart'; -import 'package:flutter_template/gen/assets.gen.dart'; +import 'package:flutter/foundation.dart'; +import 'package:fluttips/core/common/extension/string_extensions.dart'; +import 'package:fluttips/core/common/helper/enum_helpers.dart'; +import 'package:fluttips/core/common/helper/env_helper.dart'; +import 'package:fluttips/gen/assets.gen.dart'; enum Environments { development, - staging, production, } @@ -18,11 +18,9 @@ extension EnviromentPath on Environments { String get fileName { switch (this) { case Environments.development: - return 'development'; - case Environments.staging: - return 'staging'; + return 'dev'; case Environments.production: - return 'production'; + return 'prod'; } } @@ -30,14 +28,28 @@ extension EnviromentPath on Environments { } abstract class Config { - static late String apiBaseUrl; static final num maxDatabaseIntValue = pow(2, 32) - 1; static const int durationAnimation = 150; - static String imageBaseUrl = + + static const apiBaseUrl = + 'https://api.github.com/repos/vandadnp/flutter-tips-and-tricks'; + static const String imageBaseUrl = 'https://raw.githubusercontent.com/vandadnp/flutter-tips-and-tricks/main/'; - static String prefixUrl = + static const String prefixUrl = 'https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/'; - static String gitHubTipsNameFolder = 'tipsandtricks/'; + static const String gitHubTipsNameFolder = 'tipsandtricks/'; + + static bool get debugMode => kDebugMode; + + static String? firebaseMessagingSenderId; + static String? firebaseProjectId; + static String? firebaseStorageBucket; + static String? firebaseIosApiKey; + static String? firebaseIosAppId; + static String? firebaseIosIosClientId; + static String? firebaseIosIosBundleId; + static String? firebaseAndroidApiKey; + static String? firebaseAndroidAppId; static final _environment = enumFromString( Environments.values, @@ -51,15 +63,83 @@ abstract class Config { } static void _initializeEnvVariables() { - apiBaseUrl = _EnvConfig.getEnvVariable(_EnvConfig.ENV_KEY_API_BASE_URL)!; + _initializeFirebaseEnvVariables(); + } + + static void _initializeFirebaseEnvVariables() { + firebaseProjectId = _EnvConfig.getEnvVariable( + _EnvConfig.ENV_KEY_FIREBASE_PROJECT_ID, + ); + firebaseMessagingSenderId = _EnvConfig.getEnvVariable( + _EnvConfig.ENV_KEY_FIREBASE_MESSAGE_SENDER_ID, + ); + firebaseStorageBucket = _EnvConfig.getEnvVariable( + _EnvConfig.ENV_KEY_FIREBASE_STORAGE_BUCKET, + ); + firebaseIosApiKey = _EnvConfig.getEnvVariable( + _EnvConfig.ENV_KEY_FIREBASE_IOS_API_KEY, + ); + firebaseIosAppId = _EnvConfig.getEnvVariable( + _EnvConfig.ENV_KEY_FIREBASE_IOS_APP_ID, + ); + firebaseIosIosClientId = _EnvConfig.getEnvVariable( + _EnvConfig.ENV_KEY_FIREBASE_IOS_IOS_CLIENT_ID, + ); + firebaseIosIosBundleId = _EnvConfig.getEnvVariable( + _EnvConfig.ENV_KEY_FIREBASE_IOS_IOS_BUNDLE_ID, + ); + firebaseAndroidApiKey = _EnvConfig.getEnvVariable( + _EnvConfig.ENV_KEY_FIREBASE_ANDROID_API_KEY, + ); + firebaseAndroidAppId = _EnvConfig.getEnvVariable( + _EnvConfig.ENV_KEY_FIREBASE_ANDROID_APP_ID, + ); } } abstract class _EnvConfig { - static const ENV_KEY_API_BASE_URL = 'API_BASE_URL'; + // Firebase Common + static const ENV_KEY_FIREBASE_PROJECT_ID = 'FIREBASE_PROJECT_ID'; + static const ENV_KEY_FIREBASE_MESSAGE_SENDER_ID = + 'FIREBASE_MESSAGE_SENDER_ID'; + static const ENV_KEY_FIREBASE_STORAGE_BUCKET = 'FIREBASE_STORAGE_BUCKET'; + + // Firebase IOs + static const ENV_KEY_FIREBASE_IOS_API_KEY = 'FIREBASE_IOS_API_KEY'; + static const ENV_KEY_FIREBASE_IOS_APP_ID = 'FIREBASE_IOS_APP_ID'; + static const ENV_KEY_FIREBASE_IOS_IOS_CLIENT_ID = + 'FIREBASE_IOS_IOS_CLIENT_ID'; + static const ENV_KEY_FIREBASE_IOS_IOS_BUNDLE_ID = + 'FIREBASE_IOS_IOS_BUNDLE_ID'; + + // Firebase Android + static const ENV_KEY_FIREBASE_ANDROID_API_KEY = 'FIREBASE_ANDROID_API_KEY'; + static const ENV_KEY_FIREBASE_ANDROID_APP_ID = 'FIREBASE_ANDROID_APP_ID'; static const systemEnv = { - ENV_KEY_API_BASE_URL: String.fromEnvironment(ENV_KEY_API_BASE_URL), + // Firebase Common + ENV_KEY_FIREBASE_PROJECT_ID: + String.fromEnvironment(ENV_KEY_FIREBASE_PROJECT_ID), + ENV_KEY_FIREBASE_MESSAGE_SENDER_ID: + String.fromEnvironment(ENV_KEY_FIREBASE_MESSAGE_SENDER_ID), + ENV_KEY_FIREBASE_STORAGE_BUCKET: + String.fromEnvironment(ENV_KEY_FIREBASE_STORAGE_BUCKET), + + // Firebase IOS + ENV_KEY_FIREBASE_IOS_API_KEY: + String.fromEnvironment(ENV_KEY_FIREBASE_IOS_API_KEY), + ENV_KEY_FIREBASE_IOS_APP_ID: + String.fromEnvironment(ENV_KEY_FIREBASE_IOS_APP_ID), + ENV_KEY_FIREBASE_IOS_IOS_CLIENT_ID: + String.fromEnvironment(ENV_KEY_FIREBASE_IOS_IOS_CLIENT_ID), + ENV_KEY_FIREBASE_IOS_IOS_BUNDLE_ID: + String.fromEnvironment(ENV_KEY_FIREBASE_IOS_IOS_BUNDLE_ID), + + // Firebase Android + ENV_KEY_FIREBASE_ANDROID_API_KEY: + String.fromEnvironment(ENV_KEY_FIREBASE_ANDROID_API_KEY), + ENV_KEY_FIREBASE_ANDROID_APP_ID: + String.fromEnvironment(ENV_KEY_FIREBASE_ANDROID_APP_ID), }; static final Map _envFileEnv = {}; diff --git a/lib/core/common/extension/stream_future_extensions.dart b/lib/core/common/extension/stream_future_extensions.dart index ee3a38d..34bbde8 100644 --- a/lib/core/common/extension/stream_future_extensions.dart +++ b/lib/core/common/extension/stream_future_extensions.dart @@ -1,5 +1,5 @@ -import 'package:flutter_template/core/common/logger.dart'; -import 'package:flutter_template/core/common/result.dart'; +import 'package:fluttips/core/common/logger.dart'; +import 'package:fluttips/core/common/result.dart'; import 'package:rxdart/rxdart.dart'; extension StreamExtensions on Stream { diff --git a/lib/core/common/helper/env_helper.dart b/lib/core/common/helper/env_helper.dart index 91599e9..c97937c 100644 --- a/lib/core/common/helper/env_helper.dart +++ b/lib/core/common/helper/env_helper.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'package:flutter_dotenv/flutter_dotenv.dart'; -import 'package:flutter_template/core/common/logger.dart'; +import 'package:fluttips/core/common/logger.dart'; Future> loadEnvs( String path, [ diff --git a/lib/core/common/logger.dart b/lib/core/common/logger.dart index f7b69ee..2878243 100644 --- a/lib/core/common/logger.dart +++ b/lib/core/common/logger.dart @@ -1,4 +1,4 @@ -import 'package:flutter_template/core/common/crash_report_tool.dart'; +import 'package:fluttips/core/common/crash_report_tool.dart'; import 'package:logger/logger.dart' as dart_log; import 'package:logger/logger.dart'; import 'package:stack_trace/stack_trace.dart'; diff --git a/lib/core/di/di_provider.dart b/lib/core/di/di_provider.dart index 2041c3f..fd3aa2f 100644 --- a/lib/core/di/di_provider.dart +++ b/lib/core/di/di_provider.dart @@ -1,5 +1,5 @@ -import 'package:flutter_template/core/di/di_repository_module.dart'; -import 'package:flutter_template/core/di/di_utils_module.dart'; +import 'package:fluttips/core/di/di_repository_module.dart'; +import 'package:fluttips/core/di/di_utils_module.dart'; import 'package:get_it/get_it.dart'; abstract class DiProvider { diff --git a/lib/core/di/di_repository_module.dart b/lib/core/di/di_repository_module.dart index b33308e..e2a5a7f 100644 --- a/lib/core/di/di_repository_module.dart +++ b/lib/core/di/di_repository_module.dart @@ -1,14 +1,14 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart'; -import 'package:flutter_template/core/repository/session_repository.dart'; -import 'package:flutter_template/core/repository/tip_repository.dart'; -import 'package:flutter_template/core/source/local_source/auth_local_source.dart'; -import 'package:flutter_template/core/source/remote_source/auth_remote_source.dart'; -import 'package:flutter_template/core/source/common/auth_interceptor.dart'; -import 'package:flutter_template/core/source/common/http_service.dart'; -import 'package:flutter_template/core/source/remote_source/tip_remote_source.dart'; +import 'package:fluttips/core/repository/session_repository.dart'; +import 'package:fluttips/core/repository/tip_repository.dart'; +import 'package:fluttips/core/source/local_source/auth_local_source.dart'; +import 'package:fluttips/core/source/remote_source/auth_remote_source.dart'; +import 'package:fluttips/core/source/common/auth_interceptor.dart'; +import 'package:fluttips/core/source/common/http_service.dart'; +import 'package:fluttips/core/source/remote_source/tip_remote_source.dart'; import 'package:get_it/get_it.dart'; -import 'package:flutter_template/core/source/database.dart'; +import 'package:fluttips/core/source/database.dart'; class RepositoryDiModule { RepositoryDiModule._privateConstructor(); diff --git a/lib/core/di/di_utils_module.dart b/lib/core/di/di_utils_module.dart index f96efcf..1ad23e1 100644 --- a/lib/core/di/di_utils_module.dart +++ b/lib/core/di/di_utils_module.dart @@ -1,4 +1,4 @@ -import 'package:flutter_template/ui/app_router.dart'; +import 'package:fluttips/ui/app_router.dart'; import 'package:get_it/get_it.dart'; class UtilsDiModule { diff --git a/lib/core/model/db/tip_amount_views_db_entity.dart b/lib/core/model/db/tip_amount_views_db_entity.dart index 7c8c1fb..d0dff24 100644 --- a/lib/core/model/db/tip_amount_views_db_entity.dart +++ b/lib/core/model/db/tip_amount_views_db_entity.dart @@ -1,5 +1,5 @@ import 'package:floor/floor.dart'; -import 'package:flutter_template/core/model/db/tip_db_entity.dart'; +import 'package:fluttips/core/model/db/tip_db_entity.dart'; @Entity( tableName: TipAmountViewsDbEntity.tableName, diff --git a/lib/core/model/extensions/stock_extensions.dart b/lib/core/model/extensions/stock_extensions.dart index e7b9d60..06a2ffa 100644 --- a/lib/core/model/extensions/stock_extensions.dart +++ b/lib/core/model/extensions/stock_extensions.dart @@ -1,6 +1,6 @@ import 'package:rxdart/rxdart.dart'; import 'package:stock/stock.dart'; -import 'package:flutter_template/core/common/result.dart'; +import 'package:fluttips/core/common/result.dart'; extension StockStreamExtensions on Stream> { Stream> flatMapToResult() => flatMap((response) async* { diff --git a/lib/core/model/extensions/tip_extension.dart b/lib/core/model/extensions/tip_extension.dart index 9ae0bbb..0e62cbe 100644 --- a/lib/core/model/extensions/tip_extension.dart +++ b/lib/core/model/extensions/tip_extension.dart @@ -1,4 +1,4 @@ -import 'package:flutter_template/core/model/tip.dart'; +import 'package:fluttips/core/model/tip.dart'; extension TipExtensions on Tip { bool get isFavourite => favouriteDate != null; diff --git a/lib/core/model/serializer/tip_serializer.dart b/lib/core/model/serializer/tip_serializer.dart index 021e358..2fe2d55 100644 --- a/lib/core/model/serializer/tip_serializer.dart +++ b/lib/core/model/serializer/tip_serializer.dart @@ -1,7 +1,7 @@ import 'package:stock/stock.dart'; -import 'package:flutter_template/core/model/db/tip_db_entity.dart'; -import 'package:flutter_template/core/model/tip.dart'; +import 'package:fluttips/core/model/db/tip_db_entity.dart'; +import 'package:fluttips/core/model/tip.dart'; class TipStockTypeMapper extends StockTypeMapper { @override diff --git a/lib/core/model/service/auth_models.dart b/lib/core/model/service/auth_models.dart index 7acbd9f..7772c8c 100644 --- a/lib/core/model/service/auth_models.dart +++ b/lib/core/model/service/auth_models.dart @@ -1,4 +1,4 @@ -import 'package:flutter_template/core/model/user.dart'; +import 'package:fluttips/core/model/user.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'auth_models.freezed.dart'; diff --git a/lib/core/model/service/responses/github_tree_response.dart b/lib/core/model/service/responses/github_tree_response.dart index 4649d9d..a2baa26 100644 --- a/lib/core/model/service/responses/github_tree_response.dart +++ b/lib/core/model/service/responses/github_tree_response.dart @@ -1,4 +1,4 @@ -import 'package:flutter_template/core/model/service/responses/github_file_response.dart'; +import 'package:fluttips/core/model/service/responses/github_file_response.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'github_tree_response.freezed.dart'; diff --git a/lib/core/model/service/responses/service_response.dart b/lib/core/model/service/responses/service_response.dart index 6198314..db3447f 100644 --- a/lib/core/model/service/responses/service_response.dart +++ b/lib/core/model/service/responses/service_response.dart @@ -1,4 +1,4 @@ -import 'package:flutter_template/core/common/network_exceptions.dart'; +import 'package:fluttips/core/common/network_exceptions.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'service_response.freezed.dart'; diff --git a/lib/core/repository/session_repository.dart b/lib/core/repository/session_repository.dart index 2f2504e..7a06ecb 100644 --- a/lib/core/repository/session_repository.dart +++ b/lib/core/repository/session_repository.dart @@ -1,11 +1,11 @@ import 'dart:async'; -import 'package:flutter_template/core/model/authentication_status.dart'; -import 'package:flutter_template/core/model/user.dart'; -import 'package:flutter_template/core/source/local_source/auth_local_source.dart'; -import 'package:flutter_template/core/source/remote_source/auth_remote_source.dart'; +import 'package:fluttips/core/model/authentication_status.dart'; +import 'package:fluttips/core/model/user.dart'; +import 'package:fluttips/core/source/local_source/auth_local_source.dart'; +import 'package:fluttips/core/source/remote_source/auth_remote_source.dart'; -import 'package:flutter_template/core/source/database.dart'; +import 'package:fluttips/core/source/database.dart'; class SessionRepository { final AuthLocalSource _authLocalSource; diff --git a/lib/core/repository/tip_repository.dart b/lib/core/repository/tip_repository.dart index 8f0e691..84f5a0f 100644 --- a/lib/core/repository/tip_repository.dart +++ b/lib/core/repository/tip_repository.dart @@ -1,12 +1,12 @@ import 'package:dartx/dartx.dart'; -import 'package:flutter_template/core/model/db/tip_amount_views_db_entity.dart'; -import 'package:flutter_template/core/model/tip.dart'; -import 'package:flutter_template/core/source/local_source/amount_views_local_source.dart'; -import 'package:flutter_template/core/source/remote_source/tip_remote_source.dart'; +import 'package:fluttips/core/model/db/tip_amount_views_db_entity.dart'; +import 'package:fluttips/core/model/tip.dart'; +import 'package:fluttips/core/source/local_source/amount_views_local_source.dart'; +import 'package:fluttips/core/source/remote_source/tip_remote_source.dart'; import 'package:stock/stock.dart'; -import 'package:flutter_template/core/source/local_source/tips_local_source.dart'; -import 'package:flutter_template/core/model/db/tip_db_entity.dart'; -import 'package:flutter_template/core/model/serializer/tip_serializer.dart'; +import 'package:fluttips/core/source/local_source/tips_local_source.dart'; +import 'package:fluttips/core/model/db/tip_db_entity.dart'; +import 'package:fluttips/core/model/serializer/tip_serializer.dart'; class TipRepository { //ignore: unused_field diff --git a/lib/core/source/common/auth_interceptor.dart b/lib/core/source/common/auth_interceptor.dart index 9e80ce9..f2aca8a 100644 --- a/lib/core/source/common/auth_interceptor.dart +++ b/lib/core/source/common/auth_interceptor.dart @@ -1,7 +1,7 @@ import 'dart:io'; import 'package:dio/dio.dart'; -import 'package:flutter_template/core/source/local_source/auth_local_source.dart'; +import 'package:fluttips/core/source/local_source/auth_local_source.dart'; class AuthInterceptor extends Interceptor { final AuthLocalSource _authLocalSource; diff --git a/lib/core/source/common/http_service.dart b/lib/core/source/common/http_service.dart index 5a68bb0..8c600b8 100644 --- a/lib/core/source/common/http_service.dart +++ b/lib/core/source/common/http_service.dart @@ -2,9 +2,9 @@ import 'dart:core'; import 'package:dio/dio.dart'; -import 'package:flutter_template/core/common/config.dart'; -import 'package:flutter_template/core/common/network_exceptions.dart'; -import 'package:flutter_template/core/model/service/responses/service_response.dart'; +import 'package:fluttips/core/common/config.dart'; +import 'package:fluttips/core/common/network_exceptions.dart'; +import 'package:fluttips/core/model/service/responses/service_response.dart'; abstract class HttpService { Future get( diff --git a/lib/core/source/database.dart b/lib/core/source/database.dart index 18e9953..30cb02c 100644 --- a/lib/core/source/database.dart +++ b/lib/core/source/database.dart @@ -1,12 +1,12 @@ import 'dart:async'; import 'package:floor/floor.dart'; -import 'package:flutter_template/core/model/db/tip_amount_views_db_entity.dart'; -import 'package:flutter_template/core/model/db/tip_db_entity.dart'; -import 'package:flutter_template/core/source/local_source/converters/date_time_converter.dart'; +import 'package:fluttips/core/model/db/tip_amount_views_db_entity.dart'; +import 'package:fluttips/core/model/db/tip_db_entity.dart'; +import 'package:fluttips/core/source/local_source/converters/date_time_converter.dart'; import 'package:sqflite/sqflite.dart' as sqflite; -import 'package:flutter_template/core/source/local_source/tips_local_source.dart'; +import 'package:fluttips/core/source/local_source/tips_local_source.dart'; -import 'package:flutter_template/core/source/local_source/amount_views_local_source.dart'; +import 'package:fluttips/core/source/local_source/amount_views_local_source.dart'; part 'database.g.dart'; diff --git a/lib/core/source/local_source/amount_views_local_source.dart b/lib/core/source/local_source/amount_views_local_source.dart index 377807d..c3c14ee 100644 --- a/lib/core/source/local_source/amount_views_local_source.dart +++ b/lib/core/source/local_source/amount_views_local_source.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'package:floor/floor.dart'; -import 'package:flutter_template/core/model/db/tip_amount_views_db_entity.dart'; +import 'package:fluttips/core/model/db/tip_amount_views_db_entity.dart'; @dao abstract class AmountViewsLocalSource { diff --git a/lib/core/source/local_source/auth_local_source.dart b/lib/core/source/local_source/auth_local_source.dart index edf3459..e011c74 100644 --- a/lib/core/source/local_source/auth_local_source.dart +++ b/lib/core/source/local_source/auth_local_source.dart @@ -1,8 +1,8 @@ import 'dart:convert'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; -import 'package:flutter_template/core/common/store/secure_storage_cached_source.dart'; -import 'package:flutter_template/core/model/user.dart'; +import 'package:fluttips/core/common/store/secure_storage_cached_source.dart'; +import 'package:fluttips/core/model/user.dart'; import 'package:stock/stock.dart'; class AuthLocalSource { diff --git a/lib/core/source/local_source/tips_local_source.dart b/lib/core/source/local_source/tips_local_source.dart index d22d09d..253173e 100644 --- a/lib/core/source/local_source/tips_local_source.dart +++ b/lib/core/source/local_source/tips_local_source.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:dartx/dartx.dart'; import 'package:floor/floor.dart'; -import 'package:flutter_template/core/model/db/tip_db_entity.dart'; +import 'package:fluttips/core/model/db/tip_db_entity.dart'; @dao abstract class TipsLocalSource { diff --git a/lib/core/source/remote_source/auth_remote_source.dart b/lib/core/source/remote_source/auth_remote_source.dart index bdd9b6f..bbdda6d 100644 --- a/lib/core/source/remote_source/auth_remote_source.dart +++ b/lib/core/source/remote_source/auth_remote_source.dart @@ -1,6 +1,6 @@ -import 'package:flutter_template/core/model/service/auth_models.dart'; -import 'package:flutter_template/core/model/service/responses/service_response.dart'; -import 'package:flutter_template/core/source/common/http_service.dart'; +import 'package:fluttips/core/model/service/auth_models.dart'; +import 'package:fluttips/core/model/service/responses/service_response.dart'; +import 'package:fluttips/core/source/common/http_service.dart'; class AuthRemoteSource { final HttpServiceDio _httpService; diff --git a/lib/core/source/remote_source/tip_remote_source.dart b/lib/core/source/remote_source/tip_remote_source.dart index 34197e9..fbaee78 100644 --- a/lib/core/source/remote_source/tip_remote_source.dart +++ b/lib/core/source/remote_source/tip_remote_source.dart @@ -1,13 +1,13 @@ import 'dart:math'; import 'package:dartx/dartx.dart'; -import 'package:flutter_template/core/model/service/responses/github_file_response.dart'; -import 'package:flutter_template/core/model/service/responses/service_response.dart'; -import 'package:flutter_template/core/model/tip.dart'; -import 'package:flutter_template/core/source/common/http_service.dart'; -import 'package:flutter_template/core/model/service/responses/github_tree_response.dart'; -import 'package:flutter_template/core/common/config.dart'; -import 'package:flutter_template/core/model/common/file_type.dart'; +import 'package:fluttips/core/model/service/responses/github_file_response.dart'; +import 'package:fluttips/core/model/service/responses/service_response.dart'; +import 'package:fluttips/core/model/tip.dart'; +import 'package:fluttips/core/source/common/http_service.dart'; +import 'package:fluttips/core/model/service/responses/github_tree_response.dart'; +import 'package:fluttips/core/common/config.dart'; +import 'package:fluttips/core/model/common/file_type.dart'; class TipRemoteSource { static const _urlGetGithubFiles = '/git/trees/main?recursive=All'; diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart new file mode 100644 index 0000000..2ad416f --- /dev/null +++ b/lib/firebase_options.dart @@ -0,0 +1,71 @@ +// File generated by FlutterFire CLI. +// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members +import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; +import 'package:flutter/foundation.dart' + show defaultTargetPlatform, kIsWeb, TargetPlatform; +import 'package:fluttips/core/common/config.dart'; + +/// Default [FirebaseOptions] for use with your Firebase apps. +/// +/// Example: +/// ```dart +/// import 'firebase_options.dart'; +/// // ... +/// await Firebase.initializeApp( +/// options: DefaultFirebaseOptions.currentPlatform, +/// ); +/// ``` +class DefaultFirebaseOptions { + static FirebaseOptions get currentPlatform { + if (kIsWeb) { + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for web - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + } + switch (defaultTargetPlatform) { + case TargetPlatform.android: + return android; + case TargetPlatform.iOS: + return ios; + case TargetPlatform.macOS: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for macos - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.windows: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for windows - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.linux: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for linux - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.fuchsia: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for fuchsia - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + } + } + + static FirebaseOptions android = FirebaseOptions( + apiKey: Config.firebaseAndroidApiKey!, + appId: Config.firebaseAndroidAppId!, + messagingSenderId: Config.firebaseMessagingSenderId!, + projectId: Config.firebaseProjectId!, + storageBucket: Config.firebaseStorageBucket!, + ); + + static FirebaseOptions ios = FirebaseOptions( + apiKey: Config.firebaseIosApiKey!, + appId: Config.firebaseIosAppId!, + messagingSenderId: Config.firebaseMessagingSenderId!, + projectId: Config.firebaseProjectId!, + storageBucket: Config.firebaseStorageBucket!, + iosClientId: Config.firebaseIosIosClientId!, + iosBundleId: Config.firebaseIosIosBundleId!, + ); +} diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index 49322c1..849ff6e 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -15,11 +15,8 @@ class $AssetsEnvironmentsGen { /// File path: assets/environments/.env String get env => 'assets/environments/.env'; - /// File path: assets/environments/development.env - String get development => 'assets/environments/development.env'; - /// List of all assets - List get values => [env, development]; + List get values => [env]; } class Assets { diff --git a/lib/main.dart b/lib/main.dart index 580166e..430f720 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,13 +1,15 @@ import 'dart:async'; +import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_native_splash/flutter_native_splash.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_template/core/common/config.dart'; -import 'package:flutter_template/core/common/logger.dart'; -import 'package:flutter_template/core/di/di_provider.dart'; -import 'package:flutter_template/ui/main/main_screen.dart'; +import 'package:fluttips/core/common/config.dart'; +import 'package:fluttips/core/common/logger.dart'; +import 'package:fluttips/core/di/di_provider.dart'; +import 'package:fluttips/firebase_options.dart'; +import 'package:fluttips/ui/main/main_screen.dart'; Future main() async { await runZonedGuarded( @@ -31,6 +33,7 @@ Future _initSdks() async { WidgetsFlutterBinding.ensureInitialized(); await Logger.init(); await Config.initialize(); + await _initFirebaseCore(); await Future.wait([ DiProvider.init(), @@ -38,6 +41,14 @@ Future _initSdks() async { ]); } +Future _initFirebaseCore() async { + if (!Config.debugMode) { + await Firebase.initializeApp( + options: DefaultFirebaseOptions.currentPlatform, + ); + } +} + // ignore: avoid-redundant-async Future _initFirebaseSdks() async { // TODO: Add Craslytics, Analytics and other sdks that the project needs diff --git a/lib/ui/app_router.dart b/lib/ui/app_router.dart index 6698443..0550ff9 100644 --- a/lib/ui/app_router.dart +++ b/lib/ui/app_router.dart @@ -1,15 +1,14 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/widgets.dart'; -import 'package:flutter_template/ui/catalog/catalog_screen.dart'; -import 'package:flutter_template/ui/favourites/list_favourites_tips_screen.dart'; -import 'package:flutter_template/ui/home/home_screen.dart'; -import 'package:flutter_template/ui/section/section_router.dart'; -import 'package:flutter_template/ui/tips/show_tips_type.dart'; -import 'package:flutter_template/ui/tips/tips_screen.dart'; -import 'package:flutter_template/ui/videos/videos.dart'; -import 'package:flutter_template/ui/favourites/favourites_tips_screen.dart'; - -import 'package:flutter_template/core/model/tip.dart'; +import 'package:fluttips/ui/catalog/catalog_screen.dart'; +import 'package:fluttips/ui/favourites/list_favourites_tips_screen.dart'; +import 'package:fluttips/ui/home/home_screen.dart'; +import 'package:fluttips/ui/section/section_router.dart'; +import 'package:fluttips/ui/tips/show_tips_type.dart'; +import 'package:fluttips/ui/tips/tips_screen.dart'; +import 'package:fluttips/ui/videos/videos.dart'; +import 'package:fluttips/ui/favourites/favourites_tips_screen.dart'; +import 'package:fluttips/core/model/tip.dart'; part 'app_router.gr.dart'; diff --git a/lib/ui/catalog/catalog_screen.dart b/lib/ui/catalog/catalog_screen.dart index f406368..e995d61 100644 --- a/lib/ui/catalog/catalog_screen.dart +++ b/lib/ui/catalog/catalog_screen.dart @@ -1,10 +1,10 @@ // ignore_for_file: avoid_print import 'package:flutter/material.dart'; -import 'package:flutter_template/ui/common/app_button.dart'; -import 'package:flutter_template/ui/common/app_dialog.dart'; -import 'package:flutter_template/ui/common/fab.dart'; -import 'package:flutter_template/ui/common/search_bar.dart'; +import 'package:fluttips/ui/common/app_button.dart'; +import 'package:fluttips/ui/common/app_dialog.dart'; +import 'package:fluttips/ui/common/fab.dart'; +import 'package:fluttips/ui/common/search_bar.dart'; class CatalogScreen extends StatefulWidget { const CatalogScreen({Key? key}) : super(key: key); diff --git a/lib/ui/common/app_button.dart b/lib/ui/common/app_button.dart index 7c10c71..5066db1 100644 --- a/lib/ui/common/app_button.dart +++ b/lib/ui/common/app_button.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_template/ui/common/context_extensions.dart'; -import 'package:flutter_template/ui/theme/app_theme.dart'; +import 'package:fluttips/ui/common/context_extensions.dart'; +import 'package:fluttips/ui/theme/app_theme.dart'; class AppButton extends StatelessWidget { final String text; diff --git a/lib/ui/common/app_dialog.dart b/lib/ui/common/app_dialog.dart index 4ee4ab5..debe576 100644 --- a/lib/ui/common/app_dialog.dart +++ b/lib/ui/common/app_dialog.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_template/ui/common/context_extensions.dart'; -import 'package:flutter_template/ui/theme/app_theme.dart'; +import 'package:fluttips/ui/common/context_extensions.dart'; +import 'package:fluttips/ui/theme/app_theme.dart'; class AppDialog extends StatelessWidget { final String title; diff --git a/lib/ui/common/custom_scaffold_fab.dart b/lib/ui/common/custom_scaffold_fab.dart index 2fc2e3d..f9d7241 100644 --- a/lib/ui/common/custom_scaffold_fab.dart +++ b/lib/ui/common/custom_scaffold_fab.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; -import 'package:flutter_template/ui/common/context_extensions.dart'; -import 'package:flutter_template/ui/theme/app_theme.dart'; -import 'package:flutter_template/ui/common/fab.dart'; +import 'package:fluttips/ui/common/context_extensions.dart'; +import 'package:fluttips/ui/theme/app_theme.dart'; +import 'package:fluttips/ui/common/fab.dart'; -import 'package:flutter_template/core/common/config.dart'; +import 'package:fluttips/core/common/config.dart'; class MainScaffoldWithFab extends StatelessWidget { final FabState state; diff --git a/lib/ui/common/fab.dart b/lib/ui/common/fab.dart index 70af069..655e327 100644 --- a/lib/ui/common/fab.dart +++ b/lib/ui/common/fab.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:flutter_template/ui/common/context_extensions.dart'; -import 'package:flutter_template/ui/theme/app_theme.dart'; +import 'package:fluttips/ui/common/context_extensions.dart'; +import 'package:fluttips/ui/theme/app_theme.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'fab.freezed.dart'; diff --git a/lib/ui/common/input_text.dart b/lib/ui/common/input_text.dart index eba84b7..819de6c 100644 --- a/lib/ui/common/input_text.dart +++ b/lib/ui/common/input_text.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_template/ui/common/context_extensions.dart'; -import 'package:flutter_template/ui/theme/app_theme.dart'; +import 'package:fluttips/ui/common/context_extensions.dart'; +import 'package:fluttips/ui/theme/app_theme.dart'; class InputText extends StatelessWidget { final TextEditingController controller; diff --git a/lib/ui/common/search_bar.dart b/lib/ui/common/search_bar.dart index 44670c0..87f28e3 100644 --- a/lib/ui/common/search_bar.dart +++ b/lib/ui/common/search_bar.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:flutter_template/ui/common/input_text.dart'; -import 'package:flutter_template/ui/common/context_extensions.dart'; +import 'package:fluttips/ui/common/input_text.dart'; +import 'package:fluttips/ui/common/context_extensions.dart'; class SearchBar extends StatelessWidget { final TextEditingController controller; diff --git a/lib/ui/favourites/display_list_favorites_tips_screen.dart b/lib/ui/favourites/display_list_favorites_tips_screen.dart index d3f9fa7..4127af0 100644 --- a/lib/ui/favourites/display_list_favorites_tips_screen.dart +++ b/lib/ui/favourites/display_list_favorites_tips_screen.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_template/ui/common/context_extensions.dart'; -import 'package:flutter_template/ui/theme/app_theme.dart'; -import 'package:flutter_template/core/model/tip.dart'; +import 'package:fluttips/ui/common/context_extensions.dart'; +import 'package:fluttips/ui/theme/app_theme.dart'; +import 'package:fluttips/core/model/tip.dart'; class DisplayListFavoritesTipsScreen extends StatelessWidget { final Tip tip; diff --git a/lib/ui/favourites/favourites_tips_cubit.dart b/lib/ui/favourites/favourites_tips_cubit.dart index 8ffc70e..12bde17 100644 --- a/lib/ui/favourites/favourites_tips_cubit.dart +++ b/lib/ui/favourites/favourites_tips_cubit.dart @@ -1,13 +1,13 @@ import 'dart:async'; import 'package:bloc/bloc.dart'; -import 'package:flutter_template/core/di/di_provider.dart'; -import 'package:flutter_template/core/model/extensions/stock_extensions.dart'; -import 'package:flutter_template/ui/app_router.dart'; -import 'package:flutter_template/ui/section/error_handler/error_handler_cubit.dart'; +import 'package:fluttips/core/di/di_provider.dart'; +import 'package:fluttips/core/model/extensions/stock_extensions.dart'; +import 'package:fluttips/ui/app_router.dart'; +import 'package:fluttips/ui/section/error_handler/error_handler_cubit.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:flutter_template/core/repository/tip_repository.dart'; -import 'package:flutter_template/core/model/tip.dart'; -import 'package:flutter_template/ui/tips/show_tips_type.dart'; +import 'package:fluttips/core/repository/tip_repository.dart'; +import 'package:fluttips/core/model/tip.dart'; +import 'package:fluttips/ui/tips/show_tips_type.dart'; part 'favourites_tips_cubit.freezed.dart'; diff --git a/lib/ui/favourites/favourites_tips_screen.dart b/lib/ui/favourites/favourites_tips_screen.dart index 820430a..e405880 100644 --- a/lib/ui/favourites/favourites_tips_screen.dart +++ b/lib/ui/favourites/favourites_tips_screen.dart @@ -1,12 +1,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_template/ui/common/context_extensions.dart'; -import 'package:flutter_template/ui/section/error_handler/error_handler_cubit.dart'; -import 'package:flutter_template/ui/favourites/favourites_tips_cubit.dart'; -import 'package:flutter_template/ui/theme/app_theme.dart'; +import 'package:fluttips/ui/common/context_extensions.dart'; +import 'package:fluttips/ui/section/error_handler/error_handler_cubit.dart'; +import 'package:fluttips/ui/favourites/favourites_tips_cubit.dart'; +import 'package:fluttips/ui/theme/app_theme.dart'; -import 'package:flutter_template/ui/favourites/display_list_favorites_tips_screen.dart'; +import 'package:fluttips/ui/favourites/display_list_favorites_tips_screen.dart'; class FavouritesTipsScreen extends StatelessWidget { const FavouritesTipsScreen({Key? key}) : super(key: key); diff --git a/lib/ui/favourites/list_favourites_tips_screen.dart b/lib/ui/favourites/list_favourites_tips_screen.dart index 652d5fc..10b43fd 100644 --- a/lib/ui/favourites/list_favourites_tips_screen.dart +++ b/lib/ui/favourites/list_favourites_tips_screen.dart @@ -1,10 +1,10 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_template/ui/common/context_extensions.dart'; -import 'package:flutter_template/ui/theme/app_theme.dart'; -import 'package:flutter_template/ui/tips/tips_screen.dart'; -import 'package:flutter_template/ui/tips/show_tips_type.dart'; -import 'package:flutter_template/core/model/tip.dart'; +import 'package:fluttips/ui/common/context_extensions.dart'; +import 'package:fluttips/ui/theme/app_theme.dart'; +import 'package:fluttips/ui/tips/tips_screen.dart'; +import 'package:fluttips/ui/tips/show_tips_type.dart'; +import 'package:fluttips/core/model/tip.dart'; class ListFavouritesTipsScreen extends StatelessWidget { final ShowTipsType showTipType; diff --git a/lib/ui/home/drawer.dart b/lib/ui/home/drawer.dart index 4c1d6e1..586b1ff 100644 --- a/lib/ui/home/drawer.dart +++ b/lib/ui/home/drawer.dart @@ -1,10 +1,10 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_template/ui/common/context_extensions.dart'; -import 'package:flutter_template/ui/theme/app_theme.dart'; -import 'package:flutter_template/ui/app_router.dart'; -import 'package:flutter_template/ui/tips/show_tips_type.dart'; +import 'package:fluttips/ui/common/context_extensions.dart'; +import 'package:fluttips/ui/theme/app_theme.dart'; +import 'package:fluttips/ui/app_router.dart'; +import 'package:fluttips/ui/tips/show_tips_type.dart'; class AppDrawer extends StatelessWidget { final TabsRouter _tabsController; diff --git a/lib/ui/home/home_cubit.dart b/lib/ui/home/home_cubit.dart index 941d45f..350451f 100644 --- a/lib/ui/home/home_cubit.dart +++ b/lib/ui/home/home_cubit.dart @@ -1,7 +1,7 @@ import 'package:bloc/bloc.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:flutter_template/ui/section/error_handler/error_handler_cubit.dart'; +import 'package:fluttips/ui/section/error_handler/error_handler_cubit.dart'; part 'home_cubit.freezed.dart'; diff --git a/lib/ui/home/home_screen.dart b/lib/ui/home/home_screen.dart index b212f94..4575807 100644 --- a/lib/ui/home/home_screen.dart +++ b/lib/ui/home/home_screen.dart @@ -1,18 +1,14 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:flutter_template/ui/common/context_extensions.dart'; -import 'package:flutter_template/ui/theme/app_theme.dart'; -import 'package:flutter_template/ui/home/drawer.dart'; - -import 'package:flutter_template/ui/common/fab.dart'; -import 'package:flutter_template/ui/home/home_cubit.dart'; - -import 'package:flutter_template/ui/section/error_handler/error_handler_cubit.dart'; - -import 'package:flutter_template/ui/section/global_ui/global_ui_cubit.dart'; - -import 'package:flutter_template/core/common/config.dart'; +import 'package:fluttips/ui/common/context_extensions.dart'; +import 'package:fluttips/ui/theme/app_theme.dart'; +import 'package:fluttips/ui/home/drawer.dart'; +import 'package:fluttips/ui/common/fab.dart'; +import 'package:fluttips/ui/home/home_cubit.dart'; +import 'package:fluttips/ui/section/error_handler/error_handler_cubit.dart'; +import 'package:fluttips/ui/section/global_ui/global_ui_cubit.dart'; +import 'package:fluttips/core/common/config.dart'; class HomeScreen extends StatelessWidget { const HomeScreen({ diff --git a/lib/ui/main/main_cubit.dart b/lib/ui/main/main_cubit.dart index d562e76..78573e6 100644 --- a/lib/ui/main/main_cubit.dart +++ b/lib/ui/main/main_cubit.dart @@ -1,10 +1,10 @@ import 'dart:async'; import 'package:bloc/bloc.dart'; -import 'package:flutter_template/core/common/extension/stream_future_extensions.dart'; -import 'package:flutter_template/core/di/di_provider.dart'; -import 'package:flutter_template/core/model/authentication_status.dart'; -import 'package:flutter_template/core/repository/session_repository.dart'; +import 'package:fluttips/core/common/extension/stream_future_extensions.dart'; +import 'package:fluttips/core/di/di_provider.dart'; +import 'package:fluttips/core/model/authentication_status.dart'; +import 'package:fluttips/core/repository/session_repository.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'main_cubit.freezed.dart'; diff --git a/lib/ui/main/main_screen.dart b/lib/ui/main/main_screen.dart index 83a24db..241a618 100644 --- a/lib/ui/main/main_screen.dart +++ b/lib/ui/main/main_screen.dart @@ -3,12 +3,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:flutter_template/core/di/di_provider.dart'; -import 'package:flutter_template/core/model/authentication_status.dart'; -import 'package:flutter_template/ui/app_router.dart'; -import 'package:flutter_template/ui/main/main_cubit.dart'; -import 'package:flutter_template/ui/resources.dart'; -import 'package:flutter_template/ui/theme/app_theme.dart'; +import 'package:fluttips/core/di/di_provider.dart'; +import 'package:fluttips/core/model/authentication_status.dart'; +import 'package:fluttips/ui/app_router.dart'; +import 'package:fluttips/ui/main/main_cubit.dart'; +import 'package:fluttips/ui/resources.dart'; +import 'package:fluttips/ui/theme/app_theme.dart'; class MainScreen extends StatelessWidget { const MainScreen({Key? key}) : super(key: key); diff --git a/lib/ui/resources.dart b/lib/ui/resources.dart index a099363..4ab7786 100644 --- a/lib/ui/resources.dart +++ b/lib/ui/resources.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:flutter_template/ui/common/context_extensions.dart'; +import 'package:fluttips/ui/common/context_extensions.dart'; abstract class Resources { /// Returns the app localizations diff --git a/lib/ui/section/error_handler/error_handler_cubit.dart b/lib/ui/section/error_handler/error_handler_cubit.dart index 498b036..d61efed 100644 --- a/lib/ui/section/error_handler/error_handler_cubit.dart +++ b/lib/ui/section/error_handler/error_handler_cubit.dart @@ -1,7 +1,7 @@ import 'package:bloc/bloc.dart'; import 'package:dio/dio.dart'; import 'package:flutter/foundation.dart'; -import 'package:flutter_template/ui/section/error_handler/general_error.dart'; +import 'package:fluttips/ui/section/error_handler/general_error.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'error_handler_cubit.freezed.dart'; diff --git a/lib/ui/section/section_router.dart b/lib/ui/section/section_router.dart index e88085d..3a789e8 100644 --- a/lib/ui/section/section_router.dart +++ b/lib/ui/section/section_router.dart @@ -1,10 +1,10 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:flutter_template/ui/common/context_extensions.dart'; -import 'package:flutter_template/ui/section/error_handler/error_handler_cubit.dart'; +import 'package:fluttips/ui/common/context_extensions.dart'; +import 'package:fluttips/ui/section/error_handler/error_handler_cubit.dart'; -import 'package:flutter_template/ui/section/global_ui/global_ui_cubit.dart'; +import 'package:fluttips/ui/section/global_ui/global_ui_cubit.dart'; class SectionRouter extends StatelessWidget { const SectionRouter({super.key}); diff --git a/lib/ui/theme/app_theme.dart b/lib/ui/theme/app_theme.dart index 52921bc..872519e 100644 --- a/lib/ui/theme/app_theme.dart +++ b/lib/ui/theme/app_theme.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:flutter_template/ui/theme/app_colors.dart'; -import 'package:flutter_template/ui/theme/dimensions.dart'; -import 'package:flutter_template/ui/theme/text_styles.dart'; +import 'package:fluttips/ui/theme/app_colors.dart'; +import 'package:fluttips/ui/theme/dimensions.dart'; +import 'package:fluttips/ui/theme/text_styles.dart'; late AppColors _colors; late AppDimens _dimensions; diff --git a/lib/ui/tips/tips_cubit.dart b/lib/ui/tips/tips_cubit.dart index 1ebc6ed..0ba0449 100644 --- a/lib/ui/tips/tips_cubit.dart +++ b/lib/ui/tips/tips_cubit.dart @@ -2,17 +2,16 @@ import 'dart:async'; import 'package:bloc/bloc.dart'; import 'package:dartx/dartx.dart'; -import 'package:flutter_template/core/di/di_provider.dart'; -import 'package:flutter_template/core/model/extensions/stock_extensions.dart'; -import 'package:flutter_template/core/model/extensions/tip_extension.dart'; -import 'package:flutter_template/ui/section/error_handler/error_handler_cubit.dart'; -import 'package:flutter_template/ui/tips/show_tips_type.dart'; +import 'package:fluttips/core/di/di_provider.dart'; +import 'package:fluttips/core/model/extensions/stock_extensions.dart'; +import 'package:fluttips/core/model/extensions/tip_extension.dart'; +import 'package:fluttips/ui/section/error_handler/error_handler_cubit.dart'; +import 'package:fluttips/ui/tips/show_tips_type.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:flutter_template/core/repository/tip_repository.dart'; -import 'package:flutter_template/core/model/tip.dart'; +import 'package:fluttips/core/repository/tip_repository.dart'; +import 'package:fluttips/core/model/tip.dart'; import 'package:rxdart/rxdart.dart'; - -import 'package:flutter_template/ui/common/fab.dart'; +import 'package:fluttips/ui/common/fab.dart'; part 'tips_cubit.freezed.dart'; diff --git a/lib/ui/tips/tips_screen.dart b/lib/ui/tips/tips_screen.dart index 2ff53fa..30e0d43 100644 --- a/lib/ui/tips/tips_screen.dart +++ b/lib/ui/tips/tips_screen.dart @@ -1,16 +1,16 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_template/core/model/extensions/tip_extension.dart'; -import 'package:flutter_template/ui/common/context_extensions.dart'; -import 'package:flutter_template/ui/section/error_handler/error_handler_cubit.dart'; -import 'package:flutter_template/ui/section/global_ui/global_ui_cubit.dart'; -import 'package:flutter_template/ui/theme/app_theme.dart'; -import 'package:flutter_template/ui/tips/show_tips_type.dart'; -import 'package:flutter_template/ui/tips/tips_cubit.dart'; -import 'package:flutter_template/ui/common/custom_scaffold_fab.dart'; -import 'package:flutter_template/ui/common/fab.dart'; -import 'package:flutter_template/core/model/tip.dart'; +import 'package:fluttips/core/model/extensions/tip_extension.dart'; +import 'package:fluttips/ui/common/context_extensions.dart'; +import 'package:fluttips/ui/section/error_handler/error_handler_cubit.dart'; +import 'package:fluttips/ui/section/global_ui/global_ui_cubit.dart'; +import 'package:fluttips/ui/theme/app_theme.dart'; +import 'package:fluttips/ui/tips/show_tips_type.dart'; +import 'package:fluttips/ui/tips/tips_cubit.dart'; +import 'package:fluttips/ui/common/custom_scaffold_fab.dart'; +import 'package:fluttips/ui/common/fab.dart'; +import 'package:fluttips/core/model/tip.dart'; import 'package:photo_view/photo_view.dart'; import 'package:photo_view/photo_view_gallery.dart'; diff --git a/lib/ui/videos/videos.dart b/lib/ui/videos/videos.dart index 6a299e1..a20db1f 100644 --- a/lib/ui/videos/videos.dart +++ b/lib/ui/videos/videos.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:flutter_template/ui/common/context_extensions.dart'; -import 'package:flutter_template/ui/theme/app_theme.dart'; +import 'package:fluttips/ui/common/context_extensions.dart'; +import 'package:fluttips/ui/theme/app_theme.dart'; class VideosScreen extends StatelessWidget { const VideosScreen({Key? key}) : super(key: key); diff --git a/pubspec.lock b/pubspec.lock index 3b0265b..3d793de 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -337,6 +337,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.1" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.5.2" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" fixnum: dependency: transitive description: @@ -818,7 +839,7 @@ packages: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.3" pointycastle: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 8dc966e..22c5873 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,9 +1,9 @@ -name: flutter_template +name: fluttips description: A new Flutter project. publish_to: 'none' -version: 1.0.0+1 +version: 0.0.1+1 environment: sdk: ">=2.18.0 <3.0.0" @@ -27,6 +27,7 @@ dependencies: dartx: 1.1.0 dio: 4.0.6 # networking equatable: 2.0.5 + firebase_core: 2.2.0 floor: 1.3.0 flutter_bloc: 8.1.1 flutter_dotenv: 5.0.2 @@ -75,31 +76,21 @@ flavorizr: flavors: dev: app: - name: 'Template Dev' + name: 'Fluttips Dev' android: - applicationId: 'com.xmartlabs.template.dev' + applicationId: 'com.xmartlabs.fluttips.dev' ios: - bundleId: 'com.xmartlabs.template.dev' + bundleId: 'com.xmartlabs.fluttips.dev' variables: FLUTTER_TARGET: value: 'lib/main.dart' prod: app: - name: 'Template' + name: 'Fluttips' android: - applicationId: 'com.xmartlabs.template' + applicationId: 'com.xmartlabs.fluttips' ios: - bundleId: 'com.xmartlabs.template' - variables: - FLUTTER_TARGET: - value: 'lib/main.dart' - staging: - app: - name: 'Template Sta' - android: - applicationId: 'com.xmartlabs.template.sta' - ios: - bundleId: 'com.xmartlabs.template.sta' + bundleId: 'com.xmartlabs.fluttips' variables: FLUTTER_TARGET: value: 'lib/main.dart' diff --git a/scripts/checks.sh b/scripts/checks.sh index c6c889b..29af7e1 100755 --- a/scripts/checks.sh +++ b/scripts/checks.sh @@ -1,22 +1,23 @@ #!/bin/bash -RED='\033[0;31m' +error () { + echo -e "\033[0;31m$1" + exit 1 +} echo ':: Sorting translation files ::' fvm flutter pub run arb_utils sort lib/l10n/intl_en.arb; echo ':: Check code format ::' -fvm flutter format --set-exit-if-changed . || { - echo -e "${RED}Invalid format" ; exit 1; -} +fvm flutter format --set-exit-if-changed . || error "Invalid format" echo ':: Run linter ::' -fvm flutter analyze . || { echo -e "${RED}Linter error" ; exit 1; } +fvm flutter analyze . || error "Linter error" result=$(fvm flutter pub run dart_code_metrics:metrics analyze lib --fatal-style --fatal-performance --fatal-warnings) echo "$result" -[[ $result == '✔ no issues found!' ]] || { echo -e "${RED}Linter error" ; exit 1; } +[[ $result == '✔ no issues found!' ]] || error "Linter error" -fvm flutter pub run dart_code_metrics:metrics check-unused-code lib --fatal-unused || { echo -e "${RED}Linter error" ; exit 1; } +fvm flutter pub run dart_code_metrics:metrics check-unused-code lib --fatal-unused || error "Linter error" -fvm flutter pub run dart_code_metrics:metrics check-unused-files lib --fatal-unused || { echo -e "${RED}Linter error" ; exit 1; } +fvm flutter pub run dart_code_metrics:metrics check-unused-files lib --fatal-unused || error "Linter error" diff --git a/scripts/firebase_setup.sh b/scripts/firebase_setup.sh new file mode 100755 index 0000000..a9ba7f0 --- /dev/null +++ b/scripts/firebase_setup.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +cp $1/google-services.json android/app/ +mkdir -p ios/Runner/Resources/Firebase +cp $1/GoogleService-Info-dev.plist ios/Runner/Resources/Firebase/ +cp $1/GoogleService-Info-prod.plist ios/Runner/Resources/Firebase/