pop_scope_aware_cupertino_route 0.0.1 copy "pop_scope_aware_cupertino_route: ^0.0.1" to clipboard
pop_scope_aware_cupertino_route: ^0.0.1 copied to clipboard

outdated

an adjustment of the cupertino page transition to be usable with pop scope

PopScopeAwareCupertinoRoute #

_Note: This package can be used on any platform, and is not specific to iOS.


PopScopeAwareCupertinoRouteTransition #

The key to this package is a modified version of Flutter's CupertinoPageRoute, and Cupertino Will Pop Scope which has been enhanced with the following:

  • Visual feedback when users attempt to "swipe to go back" - the screen is allowed to be dragged a bit before it is snapped back to place.
  • If an enclosing route popDisposition is set to doNotPop, the routes onPopInvoked callback is triggered

A working app using this package can be found in the example folder.

Usage #

To use this package, add pop_scope_aware_cupertino_route as a dependency in your pubspec.yaml file.

Example #

Import the library #

// main.dart
import 'package:pop_scope_aware_cupertino_route/pop_scope_aware_cupertino_route.dart';

Configure page transitions #

Set the transition builder of the desired platform to PopScopeAwareCupertinoPageTransitionBuilder in your theme configuration.

// main.dart
theme = ThemeData
(...pageTransitionsTheme: PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: PopScopeAwareCupertinoPageTransitionBuilder(),
},
)
,
);
Make sure the theme is applied to the app.
// main.dart
MaterialApp
(...theme: theme,
home: HomeScreen(),
);
Using PopScope:
// my_screen.dart
@override
Widget build(BuildContext context) {
  return PopScope(
    canPop: false,
    onPopInvoked: (canPop) {
      print(canPop);
    },
    child: Container(),
  );
}
3
likes
0
points
107
downloads

Publisher

unverified uploader

Weekly Downloads

an adjustment of the cupertino page transition to be usable with pop scope

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on pop_scope_aware_cupertino_route