https://github.com/bachhoan88/FlutterCleanArchitecture
Clean Architecture for Flutter
https://github.com/bachhoan88/FlutterCleanArchitecture
architecture basecode clean-architecture cleanarchitecture dart flutter flutter-provider riverpod
Last synced: 11 months ago
JSON representation
Clean Architecture for Flutter
- Host: GitHub
- URL: https://github.com/bachhoan88/FlutterCleanArchitecture
- Owner: bachhoan88
- License: mit
- Created: 2021-01-25T01:25:30.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-10T15:44:13.000Z (about 3 years ago)
- Last Synced: 2024-08-03T14:07:15.305Z (over 1 year ago)
- Topics: architecture, basecode, clean-architecture, cleanarchitecture, dart, flutter, flutter-provider, riverpod
- Language: Dart
- Homepage:
- Size: 669 KB
- Stars: 134
- Watchers: 4
- Forks: 74
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# flutter_clean_architecture
This is a simple for Clean Architecture using the Provider Pattern
## App architecture
- Base on [MVVM](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel) + [CleanArchitecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html)
## Data Flow

## Exception Flow

## Run with Flavor (dev | stag | prod)
`flutter run --flavor dev --dart-define=FLAVOR=dev`
If using the another library not build with null-safety. Please run with argument `flutter run --no-sound-null-safety`
## Environment
**Framework**
- Dart: '>=2.12.0 <3.0.0'
- Flutter: '>=2.0.0'
**iOS**
- iOS 13+
**Android**
- Android 5.1+
- minSdkVersion 22
- targetSdkVersion 30
## Code Style
- [Effective Dart](https://dart.dev/guides/language/effective-dart)
## Assets, Fonts
**If added some assets or fonts**
- Use [FlutterGen](https://github.com/FlutterGen/flutter_gen/)
## Models
**If added some models for api results**
- Use [Freezed](https://pub.dev/packages/freezed)
## Auto generate resource
`flutter packages pub run build_runner build --delete-conflicting-outputs`
## Auto generate mock class using on Unit Test
Example: After created the test class, and run command below, the mock class `MockMovieRepository` will auto generate
```Dart
@GenerateMocks([MovieRepository])
void main() {
late MovieRepository repository;
}
```
`flutter pub run build_runner build --delete-conflicting-outputs`
## Auto generate asset image
`fluttergen -c pubspec.yaml`
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.