mirror of
https://github.com/BlueBubblesApp/bluebubbles-app.git
synced 2025-05-17 21:25:57 +08:00
fix: material & samsung pop app on back button from list
This commit is contained in:
@ -8,6 +8,7 @@ import 'package:bluebubbles/app/wrappers/scrollbar_wrapper.dart';
|
||||
import 'package:bluebubbles/app/wrappers/theme_switcher.dart';
|
||||
import 'package:bluebubbles/services/services.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_acrylic/flutter_acrylic.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@ -43,7 +44,7 @@ class _MaterialConversationListState extends OptimizedState<MaterialConversation
|
||||
Widget build(BuildContext context) {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (bool didPop) async {
|
||||
onPopInvokedWithResult: <T>(bool didPop, T? other) {
|
||||
if (didPop) return;
|
||||
if (controller.selectedChats.isNotEmpty) {
|
||||
controller.clearSelectedChats();
|
||||
@ -51,6 +52,9 @@ class _MaterialConversationListState extends OptimizedState<MaterialConversation
|
||||
} else if (controller.showArchivedChats || controller.showUnknownSenders) {
|
||||
// Pop the current page
|
||||
Navigator.of(context).pop();
|
||||
} else {
|
||||
// Pop the app to exit the app
|
||||
SystemNavigator.pop();
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
|
@ -11,6 +11,7 @@ import 'package:bluebubbles/app/wrappers/theme_switcher.dart';
|
||||
import 'package:bluebubbles/services/services.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_acrylic/flutter_acrylic.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@ -46,7 +47,7 @@ class _SamsungConversationListState extends OptimizedState<SamsungConversationLi
|
||||
Widget build(BuildContext context) {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (bool didPop) async {
|
||||
onPopInvokedWithResult: <T>(bool didPop, T? other) {
|
||||
if (didPop) return;
|
||||
if (controller.selectedChats.isNotEmpty) {
|
||||
controller.clearSelectedChats();
|
||||
@ -54,6 +55,9 @@ class _SamsungConversationListState extends OptimizedState<SamsungConversationLi
|
||||
} else if (controller.showArchivedChats || controller.showUnknownSenders) {
|
||||
// Pop the current page
|
||||
Navigator.of(context).pop();
|
||||
} else {
|
||||
// Pop the app to exit the app
|
||||
SystemNavigator.pop();
|
||||
}
|
||||
},
|
||||
child: Scaffold(
|
||||
|
Reference in New Issue
Block a user