Appify project created in Flutter using Cubit and Bloc. Appify supports both Android and iOS platforms. It introduces services for cars, like internal wash, external wash, chemical wash, and so on. It lists all the nearest workshops to your current location.
Appify contains the minimal implementation required to create a new library or project. The repository code is preloaded with some basic components like basic app architecture, app theme, constants, and required dependencies to create a new project. By using boilerplate code as a standard initializer, we can have the same patterns in all the projects that will inherit it. This will also help in reducing setup & development time by allowing you to use the same code pattern and avoid re-writing from scratch.
Step 1:
Download or clone this repo by using the link below:
https://github.com/abdallah-abuzead/Appify
Step 2:
Go to the project root and execute the following command in the console to get the required dependencies:
flutter pub get
- Splash
- Login
- Home
- Workshops
- Reservations
- Routing
- Theme
- Dio
- Cubit (to connect the reactive data of your application with the UI)
- Bloc (State Management)
- Dependency Injection
- Validation
- Error Handling
- Authentication
- Caching data
- Pagination
- Settings
- Dio
- Cubit (to connect the reactive data of your application with the UI)
- Bloc (State Management)
- Dependency Injection
- dartz (Functional programming)
Here is the core folder structure that Flutter provides.
flutter-app/
βββ android
βββ assets
βββ build
βββ ios
βββ lib
βββ test
assets/
βββ fonts/
βββ icons/
βββ images/
βββ languages/
βββ lottie/
Here is the folder structure we have been using in this project
lib/
βββ core/
βββ modules/
βββ main.dart
Now, lets dive into the lib folder which has the main code for the application.
core/
βββ app/
β βββ app_initializer.dart
β βββ app_root_provider.dart
β βββ my_app.dart
βββ app_injections/
β βββ app_injections.dart
βββ app_locale/
β βββ app_locale.dart
βββ app_router/
β βββ app_router.dart
βββ app_themes/
β βββ app_themes.dart
βββ bloc_observer/
β βββ bloc_observer.dart
βββ constants/
β βββ assets/
β β βββ app_icons.dart
β β βββ app_images.dart
β βββ app_colors.dart
β βββ app_constants.dart
β βββ app_strings.dart
β βββ app_url.dart
βββ errors/
β βββ exceptions.dart
β βββ failure_message.dart
β βββ failures.dart
βββ network/
β βββ api_handler.dart
β βββ api_helper.dart
β βββ dio_interceptor.dart
β βββ network_checker.dart
βββ screens/
β βββ bottom_nav_screen.dart
β βββ splash_screen.dart
βββ utils/
β βββ caching_sevices/
β β βββ shared_preferences_services.dart
β βββ extensions/
β β βββ date_time_extensions.dart
β β βββ math_extensions.dart
β β βββ on_tap_extension.dart
β β βββ size_extensions.dart
β β βββ string_extensions.dart
β βββ validation/
β β βββ validation_error.dart
β β βββ validator.dart
β βββ app_date_utils.dart
β βββ app_functions.dart
β βββ debouncer.dart
βββ widgets
βββ app_input_fields/
β βββ app_rounded_text_field.dart
β βββ input_label.dart
βββ cookbooks/
β βββ loading_dialog.dart
β βββ loading_progress.dart
β βββ loading_widget.dart
β βββ snackbar_message.dart
β βββ toast.dart
βββ dialogs/
β βββ app_dialog.dart
βββ errors/
β βββ empty_widget.dart
β βββ offline_widget.dart
β βββ server_error_widget.dart
β βββ unauthorized_widget.dart
βββ app_button.dart
βββ app_drop_down_menu.dart
βββ app_text.dart
βββ change_language_widget.dart
βββ circle_cached_network_image.dart
βββ custom_app_bar.dart
βββ custom_auto_size_text.dart
βββ rounded_cached_network_image.dart
1- app - Contains all needed initializations of services and settings for the app.
2- app_injections - includes all injected instances used in the app.
3- app_locale - Contains all app-supported locals, and switches between them.
4- app_router β This file contains all the navigation methods for your application, and it uses Get routing.
5- constants - All the application-level constants are defined in this directory within their respective files. This directory contains the constants for `icons paths`, `images paths`, `colors` `API endpoints`, `preferences`, and `strings`.
6- errors - Contains all exceptions and failures in the app.
7- network - Contains the dio instance configurations, request header, token handling, network checker, and response and error handling.
8- screens β Contains the unmodulated/common screens of your application.
9- utils β Contains the utilities/common functions, and extensions of your application.
10- widgets β Contains the common widgets for your applications. For example, Button, TextField, etc.
Here is the module folder structure I have been using for this project. Each module has the same structure and layers, so I'll explain one module and the other modules are the same.
modules/
βββ auth/
βββ home/
βββ reservations/
β βββ data/
β β βββ data_sources/
β β β βββ reservations_remote_data_source.dart
β β βββ models/
β β β βββ reservation.dart
β β βββ repositories/
β β βββ reservations_repository.dart
β βββ domain/
β β βββ entities/
β β βββ repositories/
β β βββ use_cases/
β βββ presentation/
β βββ cubits/
β β βββ reservations/
β β β βββ reservations_cubit.dartβ
β β β βββ reservations_state.dart
β β βββ reservations_actions/
β β βββ reservations_actions_cubit.dart
β β βββ reservations_actions_state.dart
β βββ screens/
β β βββ order_details_screen.dart
β β βββ reservation_details_screen.dart
β β βββ reservations_screen.dart
β βββ widgets/
β βββ order_details_screen/
β β βββ order_details_item.dart
β βββ reservations_screen/
β βββ pending_tab.dart
β βββ reservation_card.dart
β βββ reservation_card_details_item.dart
βββ settings/
This is the starting point of the application. All the application-level configurations are defined in this file i.e., theme, routes, title, orientation, etc.
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'core/app/app_initializer.dart';
import 'core/app/my_app.dart';
import 'core/app_locale/app_locale.dart';
import 'core/constants/app_url.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await AppInitializer.initSettingsAndServices();
runApp(
EasyLocalization(
supportedLocales: const [AppLocale.arabic, AppLocale.english],
path: AppUrl.translations,
startLocale: AppLocale.arabic,
fallbackLocale: AppLocale.arabic,
child: const MyApp(),
),
);
}
I will be happy to answer any questions that you may have on this approach, and if you want to lend a hand with the Appify then please feel free to submit an issue and/or pull request π
Again to note, this is example can appear as over-architecture for what it is - but it is an example only. If you liked my work, donβt forget to β star the repo to show your support.




