Skip to content

Companion app for the Flutter in Production course

License

Notifications You must be signed in to change notification settings

fabiancrx/flutter_ship_app

 
 

Repository files navigation

Flutter Ship App

This is the companion app for my course about Flutter in production.

You can preview the app here:

Cloning the repo

git clone https://github.com/bizz84/flutter_ship_app
cd flutter_ship_app
flutter pub get

On certain lessons, I’ll ask you to checkout a specific branch so you can easily switch to the latest code. Example:

git switch m05-starter

Multiple flavors

The app uses three separate flavors: dev, stg, and prod. These are already configured if you grab the latest code.

Configuring Firebase with FlutterFire CLI

The project uses Firebase Analytics and Remote Config. As such, it needs to be configured with the FlutterFire CLI as shown in this lesson.

To make life easier, run the flutterfire-config.sh script for each flavor:

./flutterfire-config.sh dev
# Follow steps in interactive prompt
./flutterfire-config.sh stg
# Follow steps in interactive prompt
./flutterfire-config.sh prod
# Follow steps in interactive prompt

Setting the Sentry and Mixpanel keys

This project uses some .env files to store the Sentry and Mixpanel keys. Before you can run the app, create these empty files:

  • .env.dev
  • .env.stg
  • .env.prod

Upon startup, the app will read the SENTRY_DSN and MIXPANEL_PROJECT_TOKEN from these files using --dart-define-from-file.

If those values are missing or empty, the app will still run, but won't be sending data to Sentry and Mixpanel.

To configure them correctly, you need to:

Then, store the SENTRY_DSN and MIXPANEL_PROJECT_TOKEN inside .env.dev, .env.stg, .env.prod:

# Go to sentry.io and grab the Sentry DSN from [Project] > Settings > Client Keys
SENTRY_DSN=https://[email protected]/your-dsn
# Go to https://mixpanel.com/settings/project/ and grab the Mixpanel project token from the Access Keys section
MIXPANEL_PROJECT_TOKEN=your-mixpanel-project-token-dev

Setting the App Store ID

In order for the force_update_helper and in_app_review packages to be correctly configured, the App Store ID should also be set in the .env files:

APP_STORE_ID=<app-store-id>

This can be found on your app's page in App Store Connect under General > App Information > Apple ID.

See this lesson for more info.

Note about Flutter Web

To make the app run on Flutter web, I followed some of the steps in the Drift web guide:

About

Companion app for the Flutter in Production course

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 76.0%
  • Dart 22.1%
  • HTML 0.7%
  • Shell 0.6%
  • Ruby 0.3%
  • Makefile 0.2%
  • Other 0.1%