cupertino_will_pop_scope 1.2.1 cupertino_will_pop_scope: ^1.2.1 copied to clipboard
Enables 'onWillPop' callbacks on Cupertino page transitions and improves visual feedback of rejected "Swipe to go back" gestures.
import 'package:cupertino_will_pop_scope/cupertino_will_pop_scope.dart';
import 'package:flutter/material.dart';
import 'screens/home_screen.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
final theme = ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
pageTransitionsTheme: PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoWillPopScopePageTransionsBuilder(),
},
),
);
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: theme,
home: HomeScreen(),
);
}
}