page_controller_listenable 0.0.2 copy "page_controller_listenable: ^0.0.2" to clipboard
page_controller_listenable: ^0.0.2 copied to clipboard

A listenable that wraps around the PageController.

Await Route #

Convenience helper for awaiting route animation to finish.

This allows animating in keyboards, when a page with a form is opened, or deferring expensive animations and other work.

Example #

class ExampleWidgetState extends State<ExampleWidget> {
  var _didHandleInitialDependencies = false;

  @override
  void didChangeDependencies() {
    if (_didHandleInitialDependencies) return;

    // Focuses first input field and opens the keyboard, after the route has
    // finished animation.
    AwaitRoute.of(context).then(() => focusKeyboardOrSomething());
  }
}
2
likes
125
pub points
27%
popularity

Publisher

verified publishervolskaya.dev

A listenable that wraps around the PageController.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, flutter_hooks

More

Packages that depend on page_controller_listenable