fix: 修正跳轉不正當滑動返回(ios)

修正使用 Navigator.pushReplacement (73e0f8f0) 未正常處理不正當滑動返回
This commit is contained in:
JingChiang
2024-09-03 00:42:44 +08:00
parent 13f218f089
commit 939d8ddef0
3 changed files with 25 additions and 3 deletions

20
lib/NoSwipeBackRoute.dart Normal file
View File

@@ -0,0 +1,20 @@
import 'package:flutter/material.dart';
class NoSwipeBackRoute<T> extends MaterialPageRoute<T> {
NoSwipeBackRoute({required WidgetBuilder builder})
: super(builder: builder);
@override
bool get allowImplicitScrolling => false;
@override
bool get hasScopedWillPopCallback => true;
@override
bool get maintainState => true;
@override
bool get popGestureInProgress => false;
}