flutter_modular
Smart project structure with dependency injection and route management for Flutter.
7.1.0
81K downloads/mo
#1211 most downloaded on pub.dev
Flutterando/modular
What this package is like to depend on
Last release 2 months ago
24 Jun 2026
Ships unpredictably
gaps range from 8 days to 13 months
Rarely documented
notes for 11 of 147 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
261 releases · first in 2019
5 releases in the last 12 months
see the full history below
Release timeline
261 releases · Dec 2019 to Jun 2026Releases
latest 60 of 261-
7.1.024 Jun 2026Release notes
Open source →Feature modules can now consume shared/core dependencies
A feature module's module-level bind (
addSingleton,add,addLazySingleton) now resolves dependencies registered in a root-owned shared/core module (a path-lessmodule(...)). Previously only page-scopedprovidebinds could reach the core; a feature's module-level binds ran in a leaf injector blind to root-owned binds, forcing shared deps to be threaded in by hand.A core consumer can now be a
provide, the core itself, or a feature module-level bind — all alike. A feature's own bind still shadows a same-typed core bind (local wins; core is the fallback).Requires
auto_injector >= 2.2.0Adds the opt-in upward resolution (
addInjector(child, resolveUpward: true)) this builds on, fixes a dispose-listener accumulation in its layer graph, and adds anUpwardResolutionCycleguard against mutual upward links.Docs
New
dependency-injection.mdsections: cross-module resolution and the async bootstrap idiom (await once in aFuture<Module>builder somainstays thin and features take no parameters).Full changelog: https://pub.dev/packages/flutter_modular/versions/7.1.0/changelog
Release notes
Open source →- Feature modules can now consume shared/core dependencies directly. A
module-level bind inside a feature (a module with a
path) —addSingleton,add,addLazySingleton— now resolves dependencies registered in a root-owned shared module (a path-lessmodule(...), the "core"). Previously only page-scopedprovidebinds could reach the core; a feature's module-level binds ran in a leaf injector that couldn't see root-owned binds, forcing shared deps to be threaded in by hand. This removes that asymmetry: a core consumer can be aprovide, the core itself, OR a feature module-level bind — all alike. A feature's own bind still shadows a same-typed core bind (local wins; core is the fallback). - Requires
auto_injector >= 2.2.0, which adds the opt-in upward resolution (addInjector(child, resolveUpward: true)) this builds on, fixes a dispose-listener accumulation in its layer graph, and adds anUpwardResolutionCycleguard against mutual upward links.
- Feature modules can now consume shared/core dependencies directly. A
module-level bind inside a feature (a module with a
-
7.0.323 Jun 2026Release notes
Open source →- Customizable route transitions.
route(transition:)and the new app-wideModularApp(defaultTransition:)now accept anyPageTransition, an open contract that builds the route'sPage. Three ways to supply one:- the
TransitionTypepresets (material,fade,none) — each value now is aPageTransition, so existingtransition: TransitionType.fadekeeps working; CustomTransition— the inline convenience: pass atransitionsBuilder(same signature asPageRouteBuilder) and optionally tuneduration/reverseDuration/opaque/barrierColor/barrierDismissible/fullscreenDialog; Modular still owns thePage;- implement
PageTransitionyourself for full control of thePage(e.g. aCupertinoPagewith swipe-back, afullscreenDialog, shared-axis from theanimationspackage).
- the
- App-wide default.
ModularApp.defaultTransition(defaultTransitionType.material) applies to every route that doesn't declare its own. Precedence: route-local → app default →material.route(transition:)now defaults tonull(inherit the app default) instead of forcingmaterial.
- Customizable route transitions.
-
7.0.223 Jun 2026Release notes
Open source →context.select<T, R>(selector)— the method-based twin of theSelectorwidget. Reads a value derived from a page-scopedTand rebuilds the calling widget only when the selected value changes (==). Mirrorscontext.selectfromproviderto ease migration; call it frombuild.
-
7.0.123 Jun 2026Release notes
Open source →📦 Published on pub.dev: https://pub.dev/packages/flutter_modular/versions/7.0.1
Page-scoped BLoC/Cubit support
Scoped.addStreamable<T>(ctor, (t) => t.stream, (t) => t.close())— exposes the object itself viacontext.watch<T>()(read its synchronousstate, call its methods) while rebuilds are driven by its stream. flutter_modular keeps no dependency on theblocpackage (stream/close are caller callbacks). See the docs for a suggestedaddBlocextension covering both BLoC and Cubit.addListenable<T>(ctor, (t) => t.listenable, (t) => t.dispose())— for objects whose reactivity is aListenableproperty.
Simpler non-reactive registration
add<T>(ctor)— non-reactive page-scoped object, readable viacontext.read/watch, disposed on unmount when it implementsDisposable. Breaking: replacesaddDisposable(removed; theDisposableinterface is retained).
Internals
addChangeNotifierreexpressed overaddListenable;watch/read/Consumer/Selectornow accept anyObject(not justListenable), so a non-Listenablereactive object can be exposed. Fully backward compatible.
Full Changelog: https://github.com/Flutterando/modular/blob/master/CHANGELOG.md
Release notes
Open source →- Page-scoped BLoC/Cubit support. New
Scoped.addStreamable<T>(ctor, (t) => t.stream, (t) => t.close())exposes the object itself viacontext.watch<T>()(read its synchronousstate, call its methods) while rebuilds are driven by its stream — flutter_modular keeps no dependency on theblocpackage (stream/close are caller callbacks). CompanionaddListenable<T>(ctor, (t) => t.listenable, (t) => t.dispose())for objects whose reactivity is aListenableproperty. See the docs for a suggestedaddBlocextension covering both BLoC and Cubit. add<T>(ctor)— non-reactive page-scoped object, readable viacontext.read/watchand disposed on unmount when it implementsDisposable. Breaking: replacesaddDisposable, which is removed (theDisposableinterface is retained).addChangeNotifierreexpressed overaddListenable;watch/read/Consumer/Selectornow accept anyObject(not justListenable), so a non-Listenablereactive object can be exposed.
-
7.0.022 Jun 2026Nothing published for this version
-
6.4.112 Jun 2025Nothing published for this version
-
6.4.010 Jun 2025Nothing published for this version
-
6.3.423 May 2024Nothing published for this version
-
6.3.308 Apr 2024Nothing published for this version
-
6.3.206 Sep 2023Nothing published for this version
-
6.3.101 Sep 2023Nothing published for this version
-
6.3.031 Aug 2023Nothing published for this version
-
6.2.0-beta.430 Aug 2023 pre-releaseNothing published for this version
-
6.2.0-beta.330 Aug 2023 pre-releaseNothing published for this version
-
6.2.0-beta.230 Aug 2023 pre-releaseNothing published for this version
-
6.2.0-beta.130 Aug 2023 pre-releaseNothing published for this version
-
6.1.128 Aug 2023Nothing published for this version
-
6.1.024 Aug 2023Nothing published for this version
-
6.1.0+124 Aug 2023Nothing published for this version
-
6.0.416 Aug 2023Nothing published for this version
-
6.0.4+117 Aug 2023Nothing published for this version
-
6.0.309 Aug 2023Nothing published for this version
-
6.0.205 Aug 2023Nothing published for this version
-
6.0.101 Aug 2023Nothing published for this version
-
6.0.031 Jul 2023Nothing published for this version
-
6.0.0+101 Aug 2023Nothing published for this version
-
6.0.0+201 Aug 2023Nothing published for this version
-
6.0.0-rc.131 Jul 2023 pre-releaseNothing published for this version
-
6.0.0-beta.930 Jul 2023 pre-releaseNothing published for this version
-
6.0.0-beta.530 Jun 2023 pre-releaseNothing published for this version
-
6.0.0-beta.430 Jun 2023 pre-releaseNothing published for this version
-
6.0.0-beta.314 Jun 2023 pre-releaseNothing published for this version
-
6.0.0-beta.204 Jun 2023 pre-releaseNothing published for this version
-
6.0.0-beta.124 May 2023 pre-releaseNothing published for this version
-
6.0.0-alpha.511 Feb 2023 pre-releaseNothing published for this version
-
6.0.0-alpha.411 Feb 2023 pre-releaseNothing published for this version
-
6.0.0-alpha.311 Feb 2023 pre-releaseNothing published for this version
-
6.0.0-alpha.203 Feb 2023 pre-releaseNothing published for this version
-
6.0.0-alpha.131 Jan 2023 pre-releaseNothing published for this version
-
6.0.0-alpha.029 Jan 2023 pre-releaseNothing published for this version
-
5.0.303 Jun 2022 -
5.0.3-dev.103 Jun 2022 pre-releaseNothing published for this version
-
5.0.213 May 2022 -
5.0.112 May 2022 -
5.0.012 May 2022Release notes
Open source →- Support Flutter 3.0.0
- [BREAK CHANGE]: Removed
MaterialApp.modular()andCupertino().modular().
Use instead:return MaterialApp.router( routeInformationParser: Modular.routeInformationParser, routerDelegate: Modular.routerDelegate, );
This modification aims to keep Modular support independent of
WidgetAppupdates, and can be used in other bootstraps such asFluentApp [fluent_ui].- [BREAK CHANGE]: New auto-dispose configuration.
Previously Modular had automatic closing or destruction calls for objects of typeChangeNotifier/ValueNotifier,Streamand Triple`sStores.
Starting with version 5.0, Modular will provide theBind.onDisposeproperty for calls to destroy, close or dispose methods FOR EACH BIND. This will make the dispose settings more straightforward and less universal. Therefore, Modular will manage the destruction of Binds that implementDisposableonly. This is the new configuration:
@override final List<Bind> binds = [ Bind.singleton((i) => MyBloc(), onDispose: (bloc) => bloc.close()), ];
The
Bind.onDisposeCANNOT be used in Bind type factory.
You can choose to useBind.onDisposeor implement theDisposableclass.- Added
Bind.selector. Generates a reactivity (Listenable/Stream) to be listened to whencontext.watch()is called.
@override final List<Bind> binds = [ //notifier return stream or listenable to use context.watch() Bind.singleton((i) => MyBloc(), onDispose: (bloc) => bloc.close(), selector: (bloc) => bloc.stream), ];
- [BREAK CHANGE]: As already described above, the reactivities worked externally to Modular, providing a
longer life to the project. For this reason, BLoC or Triple users should use specialBind'sin order to use thecontext.watch()and auto dispose functionality. They are:BlocBind()andTripleBind(), which are available through external packages.
modular_bloc_bind -> BlocBind
modular_triple_bind -> TripleBind
Example:
@override final List<Bind> binds = [ BlocBind.singleton((i) => MyBloc()), ];
-
[BREAK CHANGE]
Bind.exportworks only after imported. -
@deprecated
ModularState.
A few months of research showed us that ModularState caused unnecessary coupling with the view and made it difficult for those who used it to understand. For this reason, we decided to deprecate it to ensure code congruence for all professionals who use Modular. -
Removed
tripledependency. -
Simplify docs.
-
Added
Modular.setArguments.
Modular.setArguments('cody1024d'); // get Modular.args.data; // -> cody1024d //or Bind((i) => MyClass(i.args.data));
Issues
-
5.0.0-dev.1509 May 2022 pre-releaseNothing published for this version
-
5.0.0-dev.1408 May 2022 pre-releaseNothing published for this version
-
5.0.0-dev.1306 May 2022 pre-releaseNothing published for this version
-
5.0.0-dev.1205 May 2022 pre-releaseNothing published for this version
-
5.0.0-dev.1105 May 2022 pre-releaseNothing published for this version
-
5.0.0-dev.829 Apr 2022 pre-releaseNothing published for this version
-
5.0.0-dev.729 Apr 2022 pre-releaseNothing published for this version
-
5.0.0-dev.629 Apr 2022 pre-releaseNothing published for this version
-
5.0.0-dev.523 Apr 2022 pre-releaseNothing published for this version
-
5.0.0-dev.423 Apr 2022 pre-releaseNothing published for this version
-
5.0.0-dev.322 Apr 2022 pre-releaseNothing published for this version
-
5.0.0-dev.222 Apr 2022 pre-releaseNothing published for this version
-
5.0.0-dev.121 Apr 2022 pre-releaseNothing published for this version
-
4.5.105 Apr 2022Nothing published for this version
-
4.5.1+105 Apr 2022Nothing published for this version