Skip to content

This repository showcases an example of Flutter architecture, offering insights into best practices and patterns for building scalable and maintainable Flutter applications. With clear structure and documentation, it serves as a valuable resource for developers seeking to enhance their understanding of Flutter development principles.

Notifications You must be signed in to change notification settings

doananhtuan22111996/flutter-architecture

Repository files navigation

Flutter Architecture

Welcome to the Flutter Architecture repository! This project aims to demonstrate and provide a reference for structuring Flutter applications using best practices in software architecture.

Demo

Table of Contents

Introduction

This repository provides a sample Flutter application showcasing an effective architecture that promotes scalability, testability, and maintainability. The goal is to help developers understand and implement robust architectural patterns in their Flutter projects.

Features

  • Clean architecture with separation of concerns
  • State management using GetX
  • Dependency injection using GetX
  • Repository pattern for data access
  • Modular and scalable project structure

Technologies Used

  • Flutter
  • Dart
  • GetX (state management and dependency injection)
  • Dio (networking)
  • Flutter Material icons - Recommended

Getting Started

To get a local copy up and running, follow these simple steps.

Prerequisites

  • Flutter (version X.X.X or higher)
  • Dart (version X.X.X or higher)

Installation

  • Install Flutter 3.22.3 or latest version
  • Install Melos latest version (Optional)
  • Install fvm latest version (Optional)

Environment

  • At Config module
  • Generated: make create-env

MacOs

  • One time: make denied (Mac OS)
  • PreBuild:
    • make pre-bootstrap
    • make pub-get
  • Run: make run flavor=[dev|staging|prod]

Window

If you can not install Melos, Fvm on Windown. You need to follow step by step to ready run source code

  • scripts package
    • cd scripts
    • sh pre-bootstrap.sh
  • flutter pub get
  • utilities package:
    • cd utilities
    • flutter pub get
  • domain package
    • cd domain
    • flutter pub get
    • flutter packages pub run build_runner build --delete-conflicting-outputs
  • data package
    • cd data
    • flutter pub get
    • flutter packages pub run build_runner build --delete-conflicting-outputs
  • config package
    • cd configs
    • flutter pub get
    • flutter packages pub run build_runner build --delete-conflicting-outputs
  • app package
    • cd app
    • flutter pub get
  • Run source
    • cd configs
    • dart run lib/src/env.json.dart [dev|prod]
    • cd ..
    • dart run scripts/build.dart [dev|prod] -> Run complete and copy command on console
    • cd app
    • paste command and run

WidgetBook

  • Widget Book is a web platform to build UIkit. It runs quickly on web instead of run by the mobile platform.
  • Run Project:
    • One time: make denied (Mac OS)
    • PreBuild:
      • make pre-bootstrap
      • make pub-get
    • make widget-book flavor=[dev|prod]

References

About

This repository showcases an example of Flutter architecture, offering insights into best practices and patterns for building scalable and maintainable Flutter applications. With clear structure and documentation, it serves as a valuable resource for developers seeking to enhance their understanding of Flutter development principles.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published