- Bloc Quiz App based on Flutter v3.7.6.
- App works on Android, iOS and WEB.
- One Answer Quiz
- True-False Quiz
- The results of quizzes are stored on the device
- Light/Dark theme switching (manual and auto)
- English and Ukrainian languages implemented (depends on system language)
https://admirable-pavlova-d09f9a.netlify.app/
quiz_app.mp4
On M1 Mac use arch -x86_64 pod install
instead of just pod install
.
JSON config files with the API endpoints and credentials for dev and prod
environments: configs_development.json
and config_production.json
files
Create config_production.json
inside the assets
folder with the following structure:
{
"appName": "Bloc Quiz App",
"apiDomain": "https://run.mocky.io/v3"
}
App supports 2 flavors: dev
and prod
.
To use flavor value in app, use next function
To use flavor value in app, use next function
Future<String?> getFlavor()
In order to run in production mode provide an additional flavor argument to the run command:
- For Android/IOS:
--flavor=prod
flutter run --falvor=prod
- For Web:
--dart-define FLAVOR=prod
flutter run --dart-define FLAVOR=prod
Important! To create the production build of the app you should also provider an additional flavor argument:
- For Android/IOS:
--flavor=prod
flutter build ipa/apk --flavor=prod
- For Web:
--dart-define FLAVOR=prod
flutter build web --dart-define FLAVOR=prod
Follow the same process, but fill the empty fields with the development values
The only difference is to create file named config_development.json
- Update en_EN.json, fr_FR.json and other json dictionaries in assets/ folder
- Load assets:
flutter pub run easy_localization:generate --source-dir assets/i18n
- Generate static keys for translations:
flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart --source-dir assets/i18n
flutter pub run build_runner build --delete-conflicting-outputs
To run test run the following command in the terminal
flutter test test