Last updated:
0 purchases
route lifecycle
route_lifecycle #
a new way to manage routes lifecycle.
Route路由生命周期管理插件
install #
Add to pubspec #
the latest version is
dependencies:
route_lifecycle: $latest_version
copied to clipboard
import in dart code #
import 'package:route_lifecycle/route_lifecycle.dart';
copied to clipboard
Usage #
/// config navigatorObservers
MaterialApp(
navigatorObservers: [
...
RouteMixin.getRouteLifecycleObserver(),
],
);
copied to clipboard
/// with RouteMixin<T>
class _HomePageState extends State<HomePage> with RouteMixin<HomePage> {
@override
String getRouteName() {
return "/main";
}
@override
void init() {
super.init();
}
@override
void resume() {
super.resume();
}
@override
void stop() {
super.stop();
}
@override
void inactive() {
super.inactive();
}
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.