Skip to content

MealBook is a collection of the best recipes for your favorite foods

Notifications You must be signed in to change notification settings

dimkazv/mealbook

Repository files navigation

MealBook

This app allows you to find best recipe for cooking

Gif Intro screen Home screen Recipe screen

Start

This project uses Flutter 2 with Null Safety enabled.

Kotlin for Android and Swift for iOS are chosen as the native part.

  1. Clone the repository.
  2. Delete the .git folder
  3. Initialize git and bind the project repository
rm -rf .git
git init
git remote add origin git@github.com:username/new_repo

flutter pub get
flutter pub run build_runner build

Environment

All fields in the environment are added via a new config or an existing one. An example of a config in a template:

import 'package:mealbook/common/env/debug_options.dart';
import 'package:mealbook/common/logger/logger.dart';

class Config {
  Config({
    required this.logger,
    required this.debugOptions,
    required this.apiBaseUrl,
  });

  final Logger logger;
  final DebugOptions debugOptions;
  final String apiBaseUrl;
}

Initialization happens at the beginning, in main with the corresponding env postfix.

Example:

Environment.init(
    buildType: BuildType.dev,
    config: Config(
      logger: devLogger(),
      debugOptions: DebugOptions(),
      apiBaseUrl: 'https://www.themealdb.com/api/json/v1/1/',
    ),
  );

Example read from Env:

Available everywhere, since Environment is Singleton.

Environment<Config>.instance().config.title  

Launching an application

We have two environments: dev and production. Then the file structure should be as follows:

Production - main.dart

Run:

flutter run -t lib/main.dart  

Dev - main_dev.dart

Run:

flutter run -t lib/main_dev.dart  

Important: Each file must include configuration specific to the environment. It is allowed to declare it only in these files.

About

MealBook is a collection of the best recipes for your favorite foods

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages