refactor: Migrate for Flutter 3.16.0

This commit is contained in:
Krille 2023-11-16 12:46:01 +01:00 committed by lauren n. liberda
commit f4d3e6f928
No known key found for this signature in database
GPG key ID: 734C629FD04BD319
4 changed files with 40 additions and 35 deletions

View file

@ -136,16 +136,15 @@ class ChatView extends StatelessWidget {
final bottomSheetPadding = FluffyThemes.isColumnMode(context) ? 16.0 : 8.0;
final scrollUpBannerEventId = controller.scrollUpBannerEventId;
return WillPopScope(
onWillPop: () async {
return PopScope(
canPop: controller.selectedEvents.isEmpty && !controller.showEmojiPicker,
onPopInvoked: (pop) async {
if (pop) return;
if (controller.selectedEvents.isNotEmpty) {
controller.clearSelectedEvents();
return false;
} else if (controller.showEmojiPicker) {
controller.emojiPickerAction();
return false;
}
return true;
},
child: GestureDetector(
onTapDown: (_) => controller.setReadMarker(),