route_lifecycle 0.0.5
route_lifecycle: ^0.0.5 copied to clipboard

the route_lifecycle is a new way to manage routes lifecycles.

route_lifecycle #

a new way to manage routes lifecycle.

Route路由生命周期管理插件

install #

Add to pubspec #

the latest version is pub package

dependencies:
  route_lifecycle: $latest_version

import in dart code #

import 'package:route_lifecycle/route_lifecycle.dart';

Usage #


/// config navigatorObservers

MaterialApp(
      navigatorObservers: [
        ...
        RouteMixin.getRouteLifecycleObserver(),
      ],
    );


/// 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();
  }
}


1
likes
130
pub points
18%
popularity

Publisher

newtab.work

the route_lifecycle is a new way to manage routes lifecycles.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on route_lifecycle