Skip to content

Commit

Permalink
Update flavours - Firebase App Distribution Integration (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirland authored Nov 23, 2022
1 parent 946da21 commit fb8a5ec
Show file tree
Hide file tree
Showing 96 changed files with 788 additions and 1,240 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/flutter-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
fileName: 'google-services.json'
fileDir: 'android/app/'
encodedString: ${{ secrets.ANDROID_GOOGLE_SERVICES_JSON_BASE_64 }}
- name: Get dependencies
uses: maierj/[email protected]
with:
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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)
67 changes: 67 additions & 0 deletions Gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 6 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,6 @@ analyzer:
- '**/*.gen.dart'
- '**/*.gr.dart'
- 'lib/generated_plugin_registrant.dart'
- 'lib/firebase_options_*.dart'
errors:
invalid_annotation_target: ignore
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ GeneratedPluginRegistrant.java
key.properties
**/*.keystore
**/*.jks
app/google-services.json
1 change: 1 addition & 0 deletions android/.ruby-version
7 changes: 0 additions & 7 deletions android/Gemfile

This file was deleted.

1 change: 1 addition & 0 deletions android/Gemfile
Loading

0 comments on commit fb8a5ec

Please sign in to comment.