
Master multimodular Flutter architecture with clean architecture and Bloc patterns to build scalable, production-ready apps for developers ready for a deep dive.
Break down your app into modular components with bloc-based state management. Use dependency injection, modular navigation, and caching to build scalable, maintainable Flutter architectures for enterprise apps.
Master multimodal and clean architecture in Flutter by modularizing apps with Bloc, managing networking with Retrofit and API safe calls, and implementing data layer and error handling.
Target intermediate flutter developers seeking scalable, maintainable apps by mastering multi modular and clean architecture with bloc state management, advanced dependency injection, and production use of API integration.
Access the official source code for every lecture via the GitHub repository linked in the resources, where each lecture page includes coding examples, tracked changes, and related pull requests.
Learn how to create a module for a multi-modular flutter project by creating directories and using flutter create with a template package, organizing core, data, domain, and representation directories.
Set up the core and features folders, then create the data module inside core using flutter create template, laying the foundation for a multi-modular clean architecture.
Create the domain module within the core directory to complete a multi-modular clean architecture in Flutter, alongside the data and presentation layers.
Learn to create the presentation module inside the core directory using a single command, with checks for existing core and automatic directory and module setup.
Create the features directory and build authentication (login and register), a movies module, and settings (app settings, profile) within a multi-modular Flutter architecture, using the command line to scaffold.
Create the flutter register module using the auth template package, enabling the login and register flows. Prepare to extend with home and settings modules in upcoming sessions.
Create the home module and main screen in Flutter's multi-modular clean architecture, wiring a bottom navigation bar with tabs for movies, settings, notifications, and users.
Create a settings directory and an app settings module for a Flutter project, then plan to add a profile module in the next lecture.
Create the profile module under the settings directory, establishing the project backbone with core and feature directories and data, domain, and presentation layers for auth and home modules.
Melos streamlines multi-modular flutter projects with centralized dependency management and linking of local packages across modules. It enables mono-repo workflows, shared dependency versions, script automation, and publishing across all packages.
This lecture guides adding melos to a flutter project, activating it, exporting its path, and preparing a melos.yaml for multi-modular clean architecture, with inline commands and common pitfalls.
Initiate Milos to manage a multi-modular flutter project, configure Milos.yaml, bootstrap packages, and run analysis across apps, core, and features.
Manage central dependencies across a multi-modular app with Milos, inheriting versions from a shared YAML and bootstrapping environment, dependencies, and dev dependencies, including dial and retrofit.
Learn to control and bootstrap packages in a modular Flutter project, filtering features to include only movies and validating bootstrapped packages across domain, data, and presentation layers.
Run melos commands to analyze all packages, fix dart analysis errors like unnecessary library names, bootstrap and clean the workspace, then format and list packages for future runs.
Create custom melos scripts to automate clean, bootstrap, and flutter tasks across the workspace. Run commands by name or via run, and extend with test, update, and upgrade.
Execute flutter tests across all modules in a multi-modular architecture by updating the central command to run each package serially, resolving concurrency issues, and validating nine packages.
Avoid exporting a data module to other modules, which creates implicit dependencies, and enforce explicit dependencies by requiring each module to declare its own dependencies in pubspec.yaml.
Add GetIt and dependency injection tooling, including injectable, json_serializable, and build_runner, configure them in pubspec, run melos bootstrap, and prepare DI setup in the main project.
Set up dependency injection in a Flutter project using injectable and get_it, configure DI in lib, update pubspec.yaml, run build_runner to generate injection config, and initialize get_it in the app.
Configure dependency injection by environment, enabling dev, prod, and test dependency injection instances. Use GetIt and injectable to wire environments and plan language providers and settings for resources and strings.
Implement environment-based dependency injection for app settings using get_it and injectable, with melos bootstrap and build_runner. Create language and settings providers that adapt to dev and production environments.
Test the app settings provider across development and production, confirm default language and theme via GetIt dependency injection, and outline the setup for the upcoming data store module.
Add a data store module and session provider with production and dev implementations, configure dependency injection, update pubspec.yaml, and generate injection config to enable testing.
Verify module to module, module to root, and root to module access in a multi-modular flutter app. Learn to configure pubspec.yaml dependencies and access app settings, data store, and main module, enabling cross-module collaboration with session provider demonstrations.
We define and manage http headers in the data layer by adding a constants file with application/json, content-type, accept, authorization, and custom headers for a clean architecture setup.
Build a dio factory for the network layer, add pretty dio logger, configure headers and base options, and enable interceptors to log requests and responses in non-release mode.
Add retrofit and retrofit generator dependencies to the login module, centralize versions with Milos, and prepare for the login service api calls using retrofit annotations and generated implementations.
Create and generate a login service using retrofit, build_runner, and a base url to post email and password, preparing the data layer and login response for future integration.
Create a login response model with json serialization by annotating with json_annotation and json_serializable, update pubspec, and generate fromJson and toJson via build_runner for login_response.g.dart.
Add a parse error logger to the login service by making the error logger optional, updating imports, and aligning the constructor, then build and verify the app runs smoothly.
Add a login remote data source and login request body, wiring a post API call via Retrofit to send email and password through the login service in a multi-layer architecture.
Define a localized message model and a failure class in the domain layer to standardize API error messages in multiple languages, then wire the domain package into the login API.
Explore how the Dartz either package enables functional error handling in Flutter, using left for failure and right for success, with yaml-based setup across data and domain modules.
Implement a login repository in the domain layer using dartz either, update pubspec to include dz, and map nullable API responses to a login model for the presentation layer.
Learn to implement a login response mapper as an extension function that converts login responses to the domain login model, handling nullability and required fields.
Add an extensions module in the core layer to provide default values for nullable responses, using extension functions for strings and integers and a constants-based approach.
Update the login response mapper by using the extensions library to improve reusability. Configure pubspec.yaml to include extensions, handle nullable fields with default empty values, and remove hardcoded values.
Implement a generic safe api call using Dartz Either to return right on success and left on error, enabling consistent error handling across login and other apis.
Implement safe API calls with either in the remote data source, map login responses to the login model via the login mapper, and update the repository in a clean architecture.
Implement a network connectivity check with the Connectivity Plus package, guard API calls by verifying internet connection before execution, and show 'Please check your internet connection' if offline.
Enhance a safe api call by injecting network info, checking network connectivity before execution, and handling offline scenarios with clear error messages to ensure robust api interactions.
Create a base use case in the domain layer and a login use case that returns a login model or failure via either, using the repository and remote data source.
Explain HTTP status codes and centralize error handling with a data source enum, mapping success, client and server errors, timeouts, and cache issues for a Flutter clean architecture.
Create a localized error messaging system by building an error messages data source and a strings class, mapping http status codes to user-friendly English and Arabic messages.
Implement a response code class that maps http status codes (200, 204, 400, 401, 403, 404, 500) and local error codes to drive ui messages and icons for network errors.
Standardize api response messages by creating a response message class and a strings file with keys like ok and cancel, enabling localization and future data source mapping.
Map the data source to a failure using a data source extension, returning a localized failure object for each response code, enabling safe API calls.
Create a Dio error handler that converts exceptions into meaningful failure messages using a handleError function that switches on error types like connection timeout and bad response.
Learn to handle Dio errors and unexpected API responses with a custom error handler in Flutter BLoC, extracting status codes and messages to return a structured failure.
Update safe API calls by integrating a custom error handler that returns failures for no internet connection and API exceptions, and propagates dynamic errors to the presentation layer.
Implement dependency injection for the core data module using injectable and build runner, configuring shared preferences, base URL, client id, and authorization token, plus language for a network instance.
Update Biofactory by injecting base URL, access token, and language via the dependency injection module, and prepare app references for secure, consistent Dio client usage.
Implement persistent preferences in the data store with a preferences provider and references provider, wired via dependency injection to supply app language and base URL.
Implement shared preferences in the Flutter multi-modular project by adding language and base URL keys, and wiring get/set methods in the preferences provider implementer.
Implement session provider with shared preferences by adding getters and setters for access token, refresh token, user id, and a generated client id via uuid, applying consistent keys across environments.
Update the data dependency injection module to include session and preferences providers, implement references and session providers, and configure base url, access token, and language using lazy singleton patterns.
Refactor the data module within core's dependency injection by moving sharedpreferences and related providers into a dedicated data store module, exposing the session service, preferences, and data store dependencies.
Add and configure the configuration data store dependency within the main injection modules, aligning core data dependencies with environment-specific session providers for dev and production.
Update the main configuration dependency function to be async and await data store and core data initialization. Coordinate dependency injection with get it and session provider to ensure orderly startup.
implement and verify login dependencies in the di module by wiring login service, remote data source, and network info through dependency injection, ensuring correct imports.
Inject the login use case into the login module and configure its dependencies. Use build runner to generate the injection configuration and wire up data source, repository, and use case.
Test the login use case by executing the login API through the login repository and remote data source, validating success and failure paths in a Flutter clean architecture.
Explore handling test API timeouts in a Flutter bloc flow, mapping connection timeout and connect timeout errors to login field messages after a 60-second wait.
Here's a course description for Flutter Advanced Course: Multi-Modular & Clean Architecture:
Flutter Advanced Course: Multi-Modular & Clean Architecture
Master Scalable & Maintainable Flutter Apps with a Multi-Modular Architecture
Are you an experienced Flutter developer looking to take your skills to the next level? This course dives deep into multi-modular architecture, state management with BLoC, networking with Dio & Retrofit, and dependency injection to help you build scalable, maintainable, and testable Flutter applications.
What You'll Learn:
Multi-Modular Architecture – Structure your Flutter project into maintainable modules.
Dependency Management – Manage dependencies effectively with Melos.
State Management with BLoC – Implement clean state management using the BLoC pattern.
Networking & API Handling – Work with Dio, Retrofit, and API-safe calls.
Error Handling – Implement robust error-handling mechanisms.
Session & Preferences – Manage user sessions with SharedPreferences.
Navigation & UI Components – Build a modular navigation system and reusable UI components.
Caching & Performance Optimization – Implement data caching for a smoother user experience.
Course Breakdown:
Core Architecture Setup – Learn how to create a modular core package and set up dependency injection.
Networking & Data Layer – Implement API handling, data repositories, and use cases.
Feature Modules – Develop independent feature modules like authentication and movie browsing.
State Management with BLoC – Implement BLoC-based architecture for predictable state management.
Navigation & UI Composition – Design a scalable UI structure with a dedicated navigation module.
Performance Optimization – Improve app efficiency with caching and optimized API calls.
By the end of this course, you'll have the skills to architect, develop, and maintain large-scale Flutter applications using industry best practices.
Enroll now and elevate your Flutter expertise!