page_life_cycle 1.0.1 copy "page_life_cycle: ^1.0.1" to clipboard
page_life_cycle: ^1.0.1 copied to clipboard

outdated

由于flutter本身widget没有路由onShow,onHide事件,根据路由变化增加widget的onShow,onHide事件,同时继承了WidgetsBindingObserver的didChangeAppLifecycleState app周期,同时优化了两点,1.只触发当前路由是顶层路由的widget,2.优化在ios上AppLifecycleState.paused延迟触发的表现

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add page_life_cycle

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  page_life_cycle: ^1.0.1

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:page_life_cycle/page_life_cycle.dart';
7
likes
0
points
29
downloads

Publisher

unverified uploader

Weekly Downloads

由于flutter本身widget没有路由onShow,onHide事件,根据路由变化增加widget的onShow,onHide事件,同时继承了WidgetsBindingObserver的didChangeAppLifecycleState app周期,同时优化了两点,1.只触发当前路由是顶层路由的widget,2.优化在ios上AppLifecycleState.paused延迟触发的表现

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on page_life_cycle