Git Product home page Git Product logo

demo_schedulerbooking's Introduction

Demo - SchedulerBooking

App Flow - BloC

Preview image

Main features

  • Tap on schedule to set your booking or remove booking.
  • Drag and drop to update the start and end time of your booking
  • Local database with hive

Project architecture (Clean Architecture Approach)

1. Why:
* We want to determine what types of database that we use for storage (might want to change it later on)
* We want to adhere to SOLID principles since we are using OOP for this project.
* We want to ensure that UI layers do not care what is going on at the data layer at all.
* We might want to separate each layer into different packages.
2. Presentation - Domain - Data.
3. Presentation layer consist of
* Widgets
* BloC - Provider
* BloC - Provider only manages UI state based on business logic
4. Domain layer (Business logic layer)
* Repositories (interfaces aka idea how the logic would behave)
* Entities (or models that UI needs)
* Usecases (user stories)
* Typically one function, but can be more if functions are related.
* Remember, one class has one responsibility only.
5. Data layer (Data access layer)
* source
    * remotes (API)
    * locals (Database)
* model
    * request
    * response
* Repositories (Implementation from Domain layer)

We build this class working separately and not following logics of Domain layer. However, Repositories will still implement from Domain layer, but the Domain layer will follow each function, and the Data layer will follow the cluster of data defined on the server. For example: Domain layer has defined 2 layers of Login and Register features, but these two features are related to the API User cluster on the server, so in the Data layer, there will only be one Repo which is user and that Repo will implement 2 layers Login and Register of the Domain layer.

6. More insight of layers

image

DI pattern

Dependency Injection is a great design pattern that allows us to eliminate rigid dependencies between elements and it makes the application more flexible, easy to expand scales and maintain. In the project we use Plugin get_it to implement DI and we have also defined classes so you can easily implement DI in the DI layer.

injection

Inject modules

module
 * Declare the modules used in the project.
 * All modules must extend "DIModule"
 * The registers must be set in the func provides.
 * When you want to call 1 DI just use the syntax. "getIt.get<My Component>()" or "Injection.getIt<My Component>()"
 * Learn more about "get_it"

Routes

The project has predefined Named routes RouteDefine + manifest

1. RouteDefine
 * All routes must extend this class.
 * When extending, you will have to override func "initRoute", here you will define your routes.
 * A feature may have multiple routes with different input arguments.
 * Make sure that the ID of each route in your project is unique.
2. manifest - lib/presentation/routes/routes.dart
 *  To add a route to the project you just need to declare in the "RouteList". Each route will be provided with a class "Routes" in "lib/app/route.dart", you must call it in the func "getRouteGenerate" of "Routes" to register.

Network.

 * Project can use retrofit to work with the alternative network for http.
 * Retrofit is pre-installed in the "ApiModule.dart". You can customize it here
 * All interceptors are defined in the lib/common/network/interceptor/* class
 * To work with Certificate, please refer to the "/lib/common/network/http_overrides.dart" class, with the default the project accept badCertificate

Development environment settings.

 * All flavor environments are installed in the "/lib/common/config/build_config.dart" class.
 * Basically we are defining 4 development environments: development, staging, preprod and release.
 * Run App
Gen Assets and source code

You can geb the assets, source code using the command

## tools/build-runner.sh
Clean Flutter source code

You can clean Flutter source code using the command

## tools/clean-all.sh
Build App

You can build the app using the commands

for both Android & iOS:

## tools/build-flavor.sh

Build by env: Prod, Staging, Dev: Update FLAVOR value in tools/build-flavor to

## development: FLAVOR=${DEV}

## staging: FLAVOR=${STAGE}

## production: FLAVOR=${PROD}

for IOS

## adhoc || production: build XCode -> TestFlight

resources

  * All resources (images, fonts, videos, ...) must be placed in the assets class

Json parsing / serialization

This project is implementing json_serializable. It use build_runner to generate files. If you make a change to these files, you need to re-run the generator using build_runner:

tools/build-runner.sh

Indentation.

  • Auto indentation handled with git hook using Lefthook.
  • For mac users, run npm run setup and you should be done. More details below.
  • This project use npm for Lefthook installation, to ease others getting it up running fast - run npm install
  • After installation, run npx lefthook install to finish up installation.
  • More info here.

Localization

Using this library to handle multi-languages. Follow this guide to understand and config languages files

Setup Step :

tools/setup-intl.sh

Initialize plugins (IntelliJ reference)

  1. Open Flutter intl in Action
  2. Click on arb File

image

  1. To add / remove Locale, choose Add Locale / Remove Locale
  2. Then it will promp which locale

image

Current available locale is en, en

Link library : https://pub.dev/packages/intl_utils

demo_schedulerbooking's People

Contributors

9hubapps avatar

Watchers

Vu Nguyen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.