Skip to content

Commit

Permalink
TW-555 Foward Image hide dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
drminh2807 authored and hoangdat committed Sep 29, 2023
1 parent 890e95e commit 7313b9c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/pages/forward/forward.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:fluffychat/pages/chat/send_file_dialog.dart';
import 'package:fluffychat/pages/forward/forward_view.dart';
import 'package:fluffychat/presentation/enum/chat_list/chat_list_enum.dart';
import 'package:fluffychat/presentation/extensions/client_extension.dart';
import 'package:fluffychat/utils/extension/navigator_state_extension.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:matrix/matrix.dart';
Expand Down Expand Up @@ -106,6 +107,7 @@ class ForwardController extends State<Forward> {
switch (success.runtimeType) {
case ForwardMessageSuccess:
final dataOnSuccess = success as ForwardMessageSuccess;
Navigator.of(context).popAllDialogs();
context.go('/rooms/${dataOnSuccess.room.id}');
break;
case ForwardMessageIsShareFileState:
Expand Down
7 changes: 7 additions & 0 deletions lib/utils/extension/navigator_state_extension.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'package:flutter/widgets.dart';

extension NavigatorStateExtension on NavigatorState {
void popAllDialogs() {
popUntil((route) => route is! RawDialogRoute);
}
}

0 comments on commit 7313b9c

Please sign in to comment.