Skip to content

Commit 6ed8423

Browse files
committed
🚀 Expose canTransitionFromPredicate from AssetPickerPageRoute
1 parent 2752b3c commit 6ed8423

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/src/widget/asset_picker_page_route.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class AssetPickerPageRoute<T> extends PageRoute<T> {
2222
this.barrierLabel,
2323
this.maintainState = true,
2424
this.opaque = true,
25+
this.canTransitionFromPredicate,
2526
});
2627

2728
final WidgetBuilder builder;
@@ -41,8 +42,11 @@ class AssetPickerPageRoute<T> extends PageRoute<T> {
4142
@override
4243
final bool maintainState;
4344

45+
final bool Function(TransitionRoute<dynamic>)? canTransitionFromPredicate;
46+
4447
@override
45-
bool canTransitionFrom(TransitionRoute<dynamic> previousRoute) => false;
48+
bool canTransitionFrom(TransitionRoute<dynamic> previousRoute) =>
49+
canTransitionFromPredicate?.call(previousRoute) ?? false;
4650

4751
@override
4852
Widget buildPage(

0 commit comments

Comments
 (0)