Skip to content

extrawest/flutter_bloc_quiz_app_showcase

Repository files navigation

Simple Quiz App

Maintanence Ask Me Anything ! GitHub release Supported Programs View DEMO

PROJECT INFO

  • Bloc Quiz App based on Flutter v3.7.6.
  • App works on Android, iOS and WEB.

Features

  • 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)

Demo

https://admirable-pavlova-d09f9a.netlify.app/

quiz_app.mp4

Installing

On M1 Mac use arch -x86_64 pod install instead of just pod install.

Configuration of the app

JSON config files with the API endpoints and credentials for dev and prod environments: configs_development.json and config_production.json files

PRODUCTION

Create config_production.json inside the assets folder with the following structure:

{
  "appName": "Bloc Quiz App",
  "apiDomain": "https://run.mocky.io/v3"
}

RUN THE APP IN DEVELOPMENT OR PRODUCTION MODE

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
DEVELOPMENT

Follow the same process, but fill the empty fields with the development values The only difference is to create file named config_development.json

Localization

  1. Update en_EN.json, fr_FR.json and other json dictionaries in assets/ folder
  2. Load assets:
flutter pub run easy_localization:generate --source-dir assets/i18n
  1. Generate static keys for translations:
flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart --source-dir assets/i18n

Generate model and other assets (freezed,mockito etc.)

flutter pub run build_runner build --delete-conflicting-outputs

Testing

To run test run the following command in the terminal

flutter test test