Flutter template Application to checkout for new projects. Check the docs/ folder for all the features and documentation.
- Click the
Use this template
button to create a new repository. - Remove the
LICENSE.md
file or update accordingly. - Checkout and open with Android Studio.
- Find and rename all instances of
com.levinriegner
with the company name, including Android folders. - Find and rename all instances of
fluttertemplate
andflutter_template
with the actual product name, including folders.
- Find and rename all instances of
- Setup Key Signing by following the CI instructions below.
- Create a new Firebase project and update the Google Services files.
- Create Android app for QA and Production environments.
- Create iOS app for QA and Production environments.
- Add SHA256 signing to Android apps
Use
./gradlew signingReport
to view the keys information. - Add ITC Team ID and Appstore App ID to iOS apps.
- Update or remove the Branch.io setup.
- Update or remove the DataDog setup.
- Clear the README file, keeping only the instructions below the
# FlutterTemplate
section.
❗️ Ensure that all template variables have been changed by searching
levinriegner
andtemplate
on the project.
FlutterTemplate Flutter Application. Add a description of what the app does.
Before you start, read this README and the docs/ to learn about the project and how to contribute.
-
Get the project's flutter version using fvm.
fvm install
❗️ Make sure to add fvm as an alias for
fvm flutter
in your shell configuration file (ie:~/.bash_profile
or~/.zprofile
). This will allow you to useflutter
directly instead offvm flutter
. See the fvm docs for more information. -
Get the project dependencies with the following commands:
flutter pub get
-
Generate the missing
*.*.dart
part files with the build_runner:flutter pub run build_runner build --delete-conflicting-outputs
During development, you can also run
flutter pub run build_runner watch
on a console tab to automatically re-run the build_runner when part files change.
Review the CONTRIBUTING.md file to learn about the development process.
Retrieve the Apple Signing Certificates inside the ios folder using the appstore connect API Key available in 1Password:
fastlane match development --readonly --api_key_path api_key.json --env qa
-
Create a new folder named
private
inside theandroid
directory. -
Add a new file named
keystore.properties
inside the new "private" folder containing the following lines (fill from 1Password):keystoreFile=../private/keystore.jks keystorePassword=XXXXXXXX keyAlias=YYYYYYY keyPassword=ZZZZZZ
-
Add the
keystore.jks
file to the folder.
This project is configured to work with Visual Studio Code.
You can find useful extensions for this project inside the .vscode/extensions.json file.
Useful shortcuts for Visual Studio Code:
- ⌘P: Open File.
- ⌘↑P: Open Command Palette.
- fnF5: Run and debug.
- ⌘.: Show code suggestions.
Saving a file on Visual Studio code will:
- Trigger a hot reload.
- Format the code using dart format.
- Autofix issues and warnings using flutter_lints.
- Sort imports and remove unused imports.
To create a new release use the GitHub Actions Internal
and Release
Flows.
New internal builds are sent every 2 weeks on Monday, following the end of the sprint.
- Checkout from
master
to a new branch namedinternal/a.b.c
. - Push to origin.
- Android: Build is uploaded to Firebase App Distribution.
- iOS: Build is uploaded to Testflight.
New production builds are sent for store review once the matching internal build has been approved by the QA team.
- Checkout from
internal/a.b.c
to a new branch namedrelease/a.b.c
. - Push to origin.
- Wait for the workflow to complete...
- iOS: Create a new release on the Appstore Connect portal, select the new build and submit for Review.
- Android: Navigate to the Production Track on the Google Play Console and submit the new build for Review.
Production builds will also be avaiable to testers for verification through the same distribution methods as the internal builds.
A new GitHub Release will be created for each release branch, with its correponding version tag.
The CHANGELOG.md file will also be updated with details from the Pull Requests on that version.
💡 You can use the GitHub CLI locally to list all the Pull Requests that were merged after a specific date. Find the datetime of last PR available in the last release branch and use
gh pr list --search "merged:>=2023-04-19T17:37:00+02:00 base:master sort:updated-desc"
to see all the PRs that followed on master.
If you need to upload a new build for the same internal release, first push the changes to master and then rebase/merge them on top of the internal branch.
Additional builds cannot be sent for the same production release. Simply create a new release branch with an increased version name.
- Switch to a new branch named
internal/a.b.c
orrelease/a.b.c
depending on the release type. - Execute the following commands to build the Flutter app for iOS:
- Get the dependencies:
flutter pub get && flutter pub run build_runner build --delete-conflicting-outputs
. - Build the Flutter app:
- Internal Build:
flutter build ios -t lib/main_qa.dart --flavor QA --release --no-codesign
- Production Build:
flutter build ios -t lib/main_prod.dart --flavor Production --release --no-codesign
- Internal Build:
- Get the dependencies:
- Open the ios project with XCode.
- Ensure the right Target (QA or Production) is selected and "Any iOS Device" is set for the Build.
- Run Product > Archive from the top menu.
- When the iOS Archive is completed, open the Archives screen from Window > Organizer if it doesn't open automatically.
- Select the newly created archive and tap the
Distribute App
button. - Keep tapping
Next
and finallyUpload
. - After the upload is completed, navigate to the Appstore Website and wait for the build to be processed.
- Once the processing is completed, submit the build to External testers or add any required Internal testers.
Try the following steps if you are having trouble running the project:
- Run Flutter Clean
flutter clean
to remove the project cache. Follow up with pub get and build_runner before building the app again. - Run
fvm install
to ensure you are using the correct version of the flutter sdk. - Run
flutter --version
and ensure the output version matches theflutterSdkVersion
in the fvm_config.json file. - Run Flutter Doctor
flutter doctor
to check if there are any issues with the flutter installation.
- Remove DerivedData folder
rm -rf ~/Library/Developer/Xcode/DerivedData/
. - Remove Pods folder
rm -rf ios/Pods
. - Update Pods repository
pod repo update
.
- Flutter Documentation.
- Flutter Learn.
- Flutter Youtube Channel.
- Bloc Library.
- Dart Language.
- Dart Style Conventions and Flutter Style Conventions.
- Flutter Template: The template used to create this project.