• Stars
    star
    114
  • Rank 308,031 (Top 7 %)
  • Language
    Dart
  • Created about 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Flutter clean architecture

Supported Null safety

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 - models.
3. Presentation layer consist of
* Widgets
* Cubit
* Cubit only manages UI state based on business logic
4. Domain layer (Business logic layer)
* Entities (or models that UI needs)
* Usecases (user stories)
* Repositories interface
* 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)
* Repositories (Implementation from Domain layer)
6. Models (The data model common for domain layer and data layer)
* models
* request
* response

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 and injectable to implement DI and we have also defined classes so you can easily implement DI in the DI layer.

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/manifest.dart
 *  To add a route to the project you just need to declare in the func "generateRoute". Each route will be provided with a func "build", you must call it in the func "generateRoute" of "manifest" 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 /configuration/lib/network/interceptor/* class
 * To work with Certificate, please refer to the "/configuration/lib/network/http_overrides.dart" class, with the default the project accept badCertificate

Development environment settings.

 * All flavor environments are installed in the "/configuration/lib/environment/buid_config.dart" class.
 * Basically we are defining 4 development environments: development, staging, preprod and release.
 * Run App

You can run the app using the commands

## development: flutter run -t lib/main.dart --debug --flavor beta

## staging: flutter run -t lib/main.dart --debug --flavor prod
Build App

You can build the app using the commands

for Android

## development: flutter build apk -t lib/main.dart --flavor beta

## staging: flutter build apk -t lib/main.dart --flavor prod

for IOS

## development flutter build ios -t lib/main.dart --flavor beta

## staging: flutter build ios -t lib/main.dart --flavor prod

resources

  * All resources (images, fonts, videos, ...) must be placed in the assets class
  * Before using them, please declare the path in utility class and the suffix of the class to be type_provide (image_provide.dart)

Getting started

Get dependencies and generate necessary files.

npm run init

We'll handle the generation of required files for 🚀 your onboarding!

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:

flutter pub run build_runner build

generator using build_runner and remove conflict file :

npm run generate

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 :

flutter pub global activate intl_utils

flutter pub global run intl_utils:generate

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

Visitors Count

Loading

More Repositories

1

public-apis

A collective list of free APIs for use in software development
Python
156
star
2

flutter_nearby_connections

Flutter plugin support peer-to-peer connectivity and the discovery of nearby devices for Android vs IOS
Dart
84
star
3

presentation-displays

The flutter plugin supports running on two screens. It's basically a tablet connected to another screen via an HDMI or Wireless
Dart
44
star
4

UDP-TCP-Flutter

UDP/TCP Flutter
Dart
16
star
5

flutter-wowza

Wowza plugin for Flutter supports both iOS and Android https://pub.dev/packages/flutter_wowza
Objective-C
10
star
6

kotlin-spring-boot

Server res API use Kotlin spring boot
Kotlin
8
star
7

Flutter-Tiktok-UI-API

Flutter Tiktok UI API
Dart
7
star
8

USB-accessory-sample

example on how to leverage the accessory mode to communicate between 2 Android devices
Java
7
star
9

scroll_two

Flutter Solution for keep scroll position in ListView when adding new item on top. Detect item position when scrolling.
Makefile
5
star
10

funny_camera

sample funny camera
Java
4
star
11

CatsCam

Android Custom Camera with audio effects to attract pets
Kotlin
3
star
12

sample-sunmi-d2

Sunmi T1 dual-screen communication
Java
3
star
13

android-interview

android-interview-questions
Java
3
star
14

Health-in-Hands

Health in Hands
2
star
15

Night-owl

Night owl can help you prevent from the harm of strong light at night: https://play.google.com/store/apps/details?id=vn.apnic.nightscreen
Java
2
star
16

animations-flutter

simple animations use flutter
Dart
2
star
17

Keep-alive-navigator-fragment

Keep alive navigator fragment
Kotlin
2
star
18

flutter-channels-sample

flutter channels sample
Objective-C
2
star
19

Enstack

the project enstack enabling endeavors
Dart
2
star
20

Training-socket

2
star
21

health-check-ios

The project health check use swift IOS
2
star
22

flutter-animation-show_item

flutter animation show item
Dart
2
star
23

CD-CI-Android-IOS

Here is an example of how to set up a GitLab CI/CD pipeline to build, test, and deploy an Android and iOS application using Docker and Firebase/Testflight
2
star
24

custom_clipper_flutter

CustomClipper Flutter
Dart
2
star
25

vnapnic

2
star
26

Music-pro

Project music pro
Kotlin
2
star
27

SampleCustomPopupWindow

Sample Custom Popup Window
Java
1
star
28

SampleThreadIntentService

Sample Thread IntentService
Java
1
star
29

FAI-C1212L-Sem4-G5-OnlineShopForDVD

FAI-C1212L-Sem4-G5-OnlineShopForDVD
Java
1
star
30

StreamGame

Project Stream Game
Java
1
star
31

SampleBroadcastReceiver

Sample Broadcast Receiver
Java
1
star
32

TestSDK

TestSDK of Soha SDK
Java
1
star
33

MyVIB

MyVIB
Java
1
star
34

RecordLiveStreaming

Record Live Streaming
Java
1
star
35

DemoJson

Sample code adnroid read xml and json
Java
1
star
36

fpi.com.sg

App Android for website fpi.com.sg
Java
1
star
37

KotlinAndroid

sample kotlin android project
Kotlin
1
star
38

MultiFunctionAdapter

One RecyclerView.Adapter to rule them all
Kotlin
1
star
39

NamBH_A05320

Assessment Servlet vs JSP
Java
1
star
40

Jetpack-sample

Jetpack sample
Kotlin
1
star
41

FacebookDemo

Java
1
star
42

SampleWidgetService

Sample Widget Service
Java
1
star
43

Android_Example

Android Example
Kotlin
1
star
44

DebtManager

Ứng dụng quản lý nợ
Java
1
star
45

QuizProject

QuizProject
Java
1
star
46

Resize_images_for_multiple_screen

Resize images to Supporting Different Screen Sizes for android
Java
1
star
47

ImageViewer

Android ImageView to include pinch zooming, panning, fling and double tap zoom.
Java
1
star
48

go-websocket

example go-websocket
Go
1
star
49

Okila-Server

The Okila server project uses the Spring boot framework and uses the Kotlin language
Kotlin
1
star
50

example-golang-gin

The server of the application Healthcare panel use golang
Go
1
star
51

flutter_flavorizr_one_main

flutter_flavorizr_one_main
Dart
1
star
52

Placeholder-Images

A package provides an easy way to add placeholder Images shimmer effect in Flutter project
1
star
53

Decode-scanner

Ứng dụng đọc mã vạch sử dụng Zxing
Java
1
star