A Flutter package that implements the Clean Architecture by Yusuf Nadaroglu in Flutter.
What It does?
x
Creates a common folder to handle common view_models, models and widgetsx
Creates a core folder to handle base, consts, helper, servicesx
Creates a features folder to handle all pages
How to use?
Add Nadarchitecture to your pubspec.yaml in dev_dependencies: section.
dev_dependencies:
nadarchitecture: ^1.0.17
Update dependencies
flutter pub get
Run this command to create folder structure
flutter pub run nadarchitecture:main
Which Packages Implemented?
x
get_storage (A fast, extra light and synchronous key-value storage written entirely in Dart)x
get_it (Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App)x
flutter_native_splash (Customize Flutter's default white native splash screen with background color and splash image. Supports dark mode, full screen, and more)x
dartz (Functional Programming in Dart. Purify your Dart code using efficient immutable data structures, monads, lenses and other FP tools)x
flutter_svg (An SVG rendering and widget library for Flutter, which allows painting and displaying Scalable Vector Graphics 1.1 files)x
flutter_screenutil (A flutter plugin for adapting screen and font size.Guaranteed to look good on different models)x
logger (Small, easy to use and extensible logger which prints beautiful logs)x
dio (A powerful HTTP package for Dart/Flutter, which supports Global settings, Interceptors, FormData, Aborting and canceling a request)x
provider (A wrapper around InheritedWidget to make them easier to use and more reusable)x
json_annotation (Classes and helper functions that support JSON code generation)x
freezed_annotation (Annotations for the freezed code-generator. This package does nothing without freezed too)x
build_runner (A build system for Dart code generation and modular compilation)x
json_serializable (Automatically generate code for converting to and from JSON by annotating Dart classes)x
freezed (Code generation for immutable classes that has a simple syntax/API without compromising on the features)x
flutter_gen_runner (The Flutter code generator for your assets, fonts, colors)
Folder Structure
├── common
│ ├── models
│ │ ├── token_model.dart
│ │ └── user_model.dart
│ ├── view_model
│ │ └── user_view_model.dart
│ └── widget
│ ├── app_logo.dart
│ ├── custom_button.dart
│ └── custom_input.dart
├── core
│ ├── base
│ │ ├── model
│ │ │ ├── base_error_model.dart
│ │ │ └── base_pagination_model.dart
│ │ ├── view
│ │ │ └── base_view.dart
│ │ └── viewModel
│ │ └── base_view_model.dart
│ ├── constants
│ │ ├── app
│ │ │ └── app_constants.dart
│ │ ├── color
│ │ │ └── app_colors.dart
│ │ ├── end_point
│ │ │ └── app_end_points.dart
│ │ ├── enum
│ │ │ └── http_types_enums.dart
│ │ ├── local
│ │ │ └── app_locals.dart
│ │ ├── notification
│ │ │ └── notification_constants.dart
│ │ ├── route
│ │ │ └── app_routes.dart
│ │ ├── text_style
│ │ │ └── app_text_styles.dart
│ │ └── theme
│ │ └── app_themes.dart
│ ├── helper
│ │ ├── extension
│ │ │ ├── color.dart
│ │ │ ├── context.dart
│ │ │ └── string.dart
│ │ └── init
│ │ └── helper_init.dart
│ └── services
│ ├── get_it
│ │ └── get_it_service.dart
│ ├── local
│ │ └── local_service.dart
│ ├── logger
│ │ └── logger_service.dart
│ ├── network
│ │ ├── helper
│ │ │ └── network_helper.dart
│ │ ├── mapper
│ │ │ └── api_model_mapper.dart
│ │ └── network_service.dart
│ ├── route
│ │ ├── app_router.dart
│ │ └── route_service.dart
│ └── theme
│ └── theme_service.dart
├── features
│ ├── home
│ │ └── presentation
│ │ ├── mixin
│ │ │ └── home_mixin.dart
│ │ └── view
│ │ └── home_view.dart
│ ├── login
│ │ ├── data
│ │ │ ├── data_sources
│ │ │ │ └── login_data_source.dart
│ │ │ ├── models
│ │ │ │ ├── login_request
│ │ │ │ │ └── login_request_model.dart
│ │ │ │ └── login_response
│ │ │ │ └── login_response_model.dart
│ │ │ └── repositories
│ │ │ └── login_repository_impl.dart
│ │ ├── domain
│ │ │ ├── entities
│ │ │ │ └── login_response
│ │ │ │ └── login_response_entity.dart
│ │ │ └── repositories
│ │ │ └── login_repository.dart
│ │ └── presentation
│ │ ├── mixin
│ │ │ └── login_mixin.dart
│ │ ├── view
│ │ │ └── login_view.dart
│ │ └── view_model
│ │ └── login_view_model.dart
│ └── test
│ ├── data
│ │ ├── data_sources
│ │ │ └── test_data_source.dart
│ │ ├── models
│ │ │ └── test_model.dart
│ │ └── repositories
│ │ └── test_repository_impl.dart
│ ├── domain
│ │ ├── entities
│ │ │ └── test_entity.dart
│ │ └── repositories
│ │ └── test_repository.dart
│ └── presentation
│ ├── mixin
│ │ └── test_mixin.dart
│ ├── view
│ │ └── test_view.dart
│ └── view_model
│ └── test_view_model.dart
└── main.dart
Libraries
- arch/common/models/token_model
- arch/common/models/user_model
- arch/common/view_model/user_view_model
- arch/common/widget/app_logo
- arch/common/widget/custom_input
- arch/core/base/model/base_error_model
- arch/core/base/model/base_pagination_model
- arch/core/base/view/base_view
- arch/core/base/viewModel/base_view_model
- arch/core/constants/app/app_constants
- arch/core/constants/color/app_colors
- arch/core/constants/end_point/app_end_points
- arch/core/constants/enum/http_types_enums
- arch/core/constants/local/app_locals
- arch/core/constants/notification/notification_constants
- arch/core/constants/route/app_routes
- arch/core/constants/text_style/app_text_styles
- arch/core/constants/theme/app_themes
- arch/core/helper/extension/color
- arch/core/helper/extension/context
- arch/core/helper/extension/string
- arch/core/helper/init/helper_init
- arch/core/services/get_it/get_it_service
- arch/core/services/local/local_service
- arch/core/services/logger/logger_service
- arch/core/services/network/helper/network_helper
- arch/core/services/network/mapper/api_model_mapper
- arch/core/services/network/network_service
- arch/core/services/route/app_router
- arch/core/services/route/route_service
- arch/core/services/theme/theme_service
- arch/features/home/presentation/mixin/home_mixin
- arch/features/home/presentation/view/home_view
- arch/features/login/data/data_sources/login_data_source
- arch/features/login/data/models/login_request/login_request_model
- arch/features/login/data/models/login_response/login_response_model
- arch/features/login/data/repositories/login_repository_impl
- arch/features/login/domain/entities/login_response/login_response_entity
- arch/features/login/domain/repositories/login_repository
- arch/features/login/presentation/mixin/login_mixin
- arch/features/login/presentation/view/login_view
- arch/features/login/presentation/view_model/login_view_model
- arch/features/test/data/data_sources/test_data_source
- arch/features/test/data/models/test_model
- arch/features/test/data/repositories/test_repository_impl
- arch/features/test/domain/entities/test_entity
- arch/features/test/domain/repositories/test_repository
- arch/features/test/presentation/mixin/test_mixin
- arch/features/test/presentation/view/test_view
- arch/features/test/presentation/view_model/test_view_model
- arch/main
- nadarchitecture
- scripts/build_sh