important web isn't supported yet, since the web view plug-in used for auth doesnt support web I should get to this early August
- open and add your add name to replace_app_name.sh
- run the script
A Real App that i am developing with this template is https://github.com/jeremiahlukus/guitar_tabs
- has tests
- basic auth flow
- riverpod as state provider
- logging (sentry)
- navigation (I used Beamer last time but might be something better out now)
- basic dashboard screen display user information
- basic settings screen to modify user profile.
- built in responsiveness
- built in flavors (dev,staging,prod)
- run web integration tests in github actions
- full test suite running in github actions
- logging with sentry monitoring
- riverpod
- Flavors configured
- built in responsiveness
- full CI lint/unit/integration
- Pre-Push githook to force lint before pushing
- setup login flow
Setup your backend to login a user.
On login the path needs to be be /callback?state=6meYRKLtQMSGctx2UXsxCd4L
the state is your api token.
I logout using the api part of my backend /api/v1/auth
in this call i delete the users token.
Soon ill add a refresh token endpoint.
I separated the WebAppAuthenticator so you can easily replace with your solution.
Run dart pub global activate derry
This will allow you to run commands defined in derry.yaml like derry lint
Support for running integration tests with flavors is added
flutter/flutter#89045
If you are on master you can run derry test_all
or derry e2e_iphone
To run unit tests derry unit_test
This project contains 3 flavors:
- development
- staging
- production
To run the desired flavor either use the launch configuration in VSCode/Android Studio or use the following commands:
# Development
$ flutter run --flavor development --target lib/main_development.dart
# Staging
$ flutter run --flavor staging --target lib/main_staging.dart
# Production
$ flutter run --flavor production --target lib/main_production.dart
*Flutter Template works on iOS, Android, and Web.
- install android studio and set up a emulator
ln -s ~/Library/Android/sdk/tools/emulator /usr/local/bin/emulator
emulator -list-avds
should list out your installed devices- export the paths
export ANDROID_SDK=$HOME/Library/Android/sdk
export PATH=$ANDROID_SDK/emulator:$ANDROID_SDK/tools:$PATH
- run
emulator -avd $(emulator -list-avds)
to open the emulator. adb tcpip 5555
After doing all the setup above you only need to run this command from here on out.
- Download Visual Studio
- Install Docker Plugin
- Install Remote Development Plugin
- Optional Download Docker Desktop
Once you have installed all of these, open Visual Studio and open this project. Visual Studio will auto detect the Dockerfile and build it for you as well as copy the project files in the docker container using settings from the devcontainer.json file. If you have a andriod emulator open and have typed adb tcpip 5555
into your terminal the device should show up in the docker container type adb devices
to make sure if not follow the steps below
In Docker
- Run
sh flutter-web.sh
- Open up an android emulator / or plugin your device
- type
adb devices
and make sure the device shows if it doesnt kill and restart your serveradb kill-server
&adb start-server
- in your terminal type
adb tcpip 5555
In the docker continer:
- Run
adb connect host.docker.internal:5555
- clilck allow permission on the andriod
sh flutter-android-emulator.sh
Errors:
If you get The message received from the daemon indicates that the daemon has disappeared.
When trying to launch on android increase your docker memory to 4 gigs. Do this by going to the docker app -> preferences -> resourses
To run all unit and widget tests use the following command:
$ derry test_all
$ derry e2e
$ derry unit
To view the generated coverage report you can use lcov.
# Generate Coverage Report
$ genhtml coverage/lcov.info -o coverage/
# Open Coverage Report
$ open coverage/index.html