A Flutter package that implements the Clean Architecture by Yusuf Nadaroglu in Flutter.
What It does?
x
Creates a common folder to handle common controllers and modelsx
Creates a core folder to handle exceptions, constants, services, useCasesx
Creates a utils folder to handle extensions and helpersx
Creates a views folder to handle pages and widgets
How to use?
Add Nadarchitecture to your pubspec.yaml in dev_dependencies: section.
dev_dependencies:
nadarchitecture: ^0.0.4
Update dependencies
flutter pub get
Run this command to create folder structure
flutter pub run nadarchitecture:main
Which Packages Implemented?
x
get (Open screens/snackbars/dialogs without context, manage states and inject dependencies easily)x
get_it (Simple direct Service Locator that allows to decouple the interface)x
get_storage (A fast, extra light and synchronous key-value storage written entirely in Dart)x
flutter_svg (An SVG rendering and widget library for Flutter)x
http (A composable, multi-platform, Future-based API for HTTP requests)x
connectivity_plus (Flutter plugin for discovering the state of the network connectivity)x
internet_connection_checker (A pure Dart library that checks for internet by opening a socket to a list of specified addresses, each with individual port and timeout)x
json_annotation (Classes and helper functions that support JSON code generation)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)
Folder Structure
|-- common
| |-- controllers
| | -- user_controller.dart
'-- models
| |-- data_model.dart
| |-- token_model.dart
| |-- token_model.g.dart
| |-- user_model.dart
| '-- user_model.g.dart
|-- core
| |-- base
| | |-- base_exception.dart
| | '-- base_model.dart
| |-- constants
| | |-- app.dart
| | |-- colors.dart
| | |-- end_points.dart
| | |-- enums
| | | |-- app_theme_enums.dart
| | | |-- http_type_enums.dart
| | | '-- network_result_enums.dart
| | |-- icons.dart
| | |-- images.dart
| | |-- local_consts.dart
| | |-- routes.dart
| | '-- themes.dart
| |-- init
| | |-- bindings
| | | '-- initial_bindings.dart
| | |-- controller
| | | '-- my_app_controller.dart
| | |-- exceptions
| | '-- http_exceptions.dart
| | |-- main
| | | '-- init_main.dart
| | '-- services
| | |-- get_it_service.dart
| | |-- local_service.dart
| | |-- network_service.dart
| | |-- route_service.dart
| | '-- theme_service.dart
| '-- useCases
| '-- checkNetwork
| |-- controller
| | '-- network_cache_controller.dart
| |-- services
| | |-- connectivity_service.dart
| | |-- internet_connection_checker_service.dart
| | '-- network_cache_service.dart
| '-- view
| '-- no_network.dart
|-- main.dart
|-- utils
| |-- extensions
| | |-- color_extension.dart
| | '-- page_padding.dart
| '-- helpers
| |-- get_snackbars.dart
| |-- screen_up_down.dart
| |-- sized_boxes.dart
| '-- text_styles.dart
'-- views
|-- pages
| |-- auth
| | |-- register
| | | |-- binding
| | | | '-- register_binding.dart
| | | |-- controller
| | | | '-- register_controller.dart
| | | |-- model
| | | | |-- register_model.dart
| | | | '-- register_model.g.dart
| | | '-- view
| | | '-- register.dart
| | '-- splash
| | |-- binding
| | | '-- splash_binding.dart
| | |-- controller
| | | '-- splash_controller.dart
| | '-- view
| | '-- splash.dart
| |-- bottomBar
| | |-- binding
| | | '-- bottom_navigation_bar_binding.dart
| | |-- consts
| | | '-- bottom_bar_consts.dart
| | |-- controller
| | | |-- bottom_navigation_bar_controller.dart
| | | '-- page_showed_controller.dart
| | |-- enums
| | | '-- bottom_bar_enums.dart
| | |-- view
| | | '-- bottom_bar.dart
| | '-- widgets
| | '-- page_showed.dart
| |-- home
| | '-- view
| | |-- home_detail.dart
| | '-- home_page.dart
| '-- profile
| |-- binding
| | '-- profile_binding.dart
| |-- controller
| | '-- profile_controller.dart
| '-- view
| '-- profile.dart
'-- widgets
|-- auth
| '-- have_an_account.dart
'-- custom
|-- custom_back_button.dart
|-- custom_button.dart
|-- custom_input.dart
'-- custom_loading.dart
Libraries
- arch/common/controllers/user_controller
- arch/common/models/data_model
- arch/common/models/token_model
- arch/common/models/token_model.g
- arch/common/models/user_model
- arch/common/models/user_model.g
- arch/core/base/base_exception
- arch/core/base/base_model
- arch/core/constants/app
- arch/core/constants/colors
- arch/core/constants/end_points
- arch/core/constants/enums/app_theme_enums
- arch/core/constants/enums/http_type_enums
- arch/core/constants/enums/network_result_enums
- arch/core/constants/icons
- arch/core/constants/images
- arch/core/constants/local_consts
- arch/core/constants/routes
- arch/core/constants/themes
- arch/core/init/bindings/initial_bindings
- arch/core/init/controller/my_app_controller
- arch/core/init/exceptions/http_exceptions
- arch/core/init/main/init_main
- arch/core/init/services/get_it_service
- arch/core/init/services/local_service
- arch/core/init/services/network_service
- arch/core/init/services/route_service
- arch/core/init/services/theme_service
- arch/core/useCases/checkNetwork/controller/network_cache_controller
- arch/core/useCases/checkNetwork/services/connectivity_service
- arch/core/useCases/checkNetwork/services/internet_connection_checker_service
- arch/core/useCases/checkNetwork/services/network_cache_service
- arch/core/useCases/checkNetwork/view/no_network
- arch/main
- arch/utils/extensions/color_extension
- arch/utils/extensions/page_padding
- arch/utils/helpers/get_snackbars
- arch/utils/helpers/screen_up_down
- arch/utils/helpers/sized_boxes
- arch/utils/helpers/text_styles
- arch/views/pages/auth/register/binding/register_binding
- arch/views/pages/auth/register/controller/register_controller
- arch/views/pages/auth/register/model/register_model
- arch/views/pages/auth/register/model/register_model.g
- arch/views/pages/auth/register/view/register
- arch/views/pages/auth/splash/binding/splash_binding
- arch/views/pages/auth/splash/controller/splash_controller
- arch/views/pages/auth/splash/view/splash
- arch/views/pages/bottomBar/consts/bottom_bar_consts
- arch/views/pages/bottomBar/controller/page_showed_controller
- arch/views/pages/bottomBar/enums/bottom_bar_enums
- arch/views/pages/bottomBar/view/bottom_bar
- arch/views/pages/bottomBar/widgets/page_showed
- arch/views/pages/home/view/home_detail
- arch/views/pages/home/view/home_page
- arch/views/pages/profile/binding/profile_binding
- arch/views/pages/profile/controller/profile_controller
- arch/views/pages/profile/view/profile
- arch/views/widgets/auth/have_an_account
- arch/views/widgets/custom/custom_input
- arch/views/widgets/custom/custom_loading
- nadarchitecture
- scripts/build_sh