Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions lib/widgets/pop_scope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ class _SystemBackBlockState extends State<SystemBackBlock> {

@override
void dispose() {
globalState.appController.unBackBlock();
super.dispose();
WidgetsBinding.instance.addPostFrameCallback((_) {
globalState.appController.unBackBlock();
});
}

@override
Expand Down
27 changes: 15 additions & 12 deletions lib/widgets/scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -238,19 +238,22 @@ class CommonScaffoldState extends State<CommonScaffold> {
Widget _buildAppBarWrap(Widget child) {
final appBar = _isSearch ? _buildSearchingAppBarTheme(child) : child;
if (_isEdit || _isSearch) {
return SystemBackBlock(
child: CommonPopScope(
onPop: (context) {
if (_isEdit || _isSearch) {
handleExitSearching();
_appBarState.value.editState?.onExit();
return false;
}
return true;
},
child: appBar,
),
final wrappedAppBar = CommonPopScope(
onPop: (context) {
if (_isEdit || _isSearch) {
handleExitSearching();
_appBarState.value.editState?.onExit();
return false;
}
return true;
},
child: appBar,
);
// Only block system back for edit mode, not search mode
if (_isEdit) {
return SystemBackBlock(child: wrappedAppBar);
}
return wrappedAppBar;
}
return appBar;
}
Expand Down