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

Enables 'onWillPop' callbacks on Cupertino page transitions and improves visual feedback of rejected "Swipe to go back" gestures.

example/lib/main.dart

import 'package:custom_will_pop_scope/custom_will_pop_scope.dart';
import 'package:example/locator.dart';
import 'package:example/navigation_service.dart';
import 'package:example/screens/home_screen.dart';
import 'package:example/screens/router.dart' as router;
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  final theme = ThemeData(
    primarySwatch: Colors.blue,
    pageTransitionsTheme: PageTransitionsTheme(
      builders: {
        TargetPlatform.android: CustomWillPopScopePageTransitionsBuilder(),
        TargetPlatform.iOS: CustomWillPopScopePageTransitionsBuilder(),
      },
    ),
  );

  @override
  Widget build(BuildContext context) {
    setupLocator();
    return MaterialApp(
      theme: theme,
      home: HomeScreen(),
      initialRoute: router.homeScreen,
      onGenerateRoute: router.generateRoute,
      navigatorKey: locator<NavigationService>().navigationKey,
    );
  }
}
24
likes
150
points
177
downloads

Publisher

verified publisherhelmybouchiha.me

Weekly Downloads

Enables 'onWillPop' callbacks on Cupertino page transitions and improves visual feedback of rejected "Swipe to go back" gestures.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on custom_will_pop_scope