v5.0.0
- 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 WidgetApp updates, and can be used in other bootstraps such as FluentApp [fluent_ui].
- [BREAK CHANGE]: New auto-dispose configuration.
Previously Modular had automatic closing or destruction calls for objects of type
ChangeNotifier/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()),
];