Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TW-1841: Fix back screen when use go_router and Navigator #1850

Merged
merged 1 commit into from
Jun 10, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:go_router/go_router.dart';
import 'package:linagora_design_flutter/colors/linagora_ref_colors.dart';
import 'package:linagora_design_flutter/colors/linagora_sys_colors.dart';
import 'package:matrix/matrix.dart';
Expand Down Expand Up @@ -129,7 +128,7 @@ class ParticipantListItem extends StatelessWidget {
userId: member.id,
onUpdatedMembers: onUpdatedMembers,
onNewChatOpen: () {
dialogContext.pop();
Navigator.of(dialogContext).pop();
},
);
},
Expand Down Expand Up @@ -228,15 +227,15 @@ class ParticipantListItem extends StatelessWidget {
child: Padding(
padding: ParticipantListItemStyle.closeButtonPadding,
child: IconButton(
onPressed: () => dialogContext.pop(),
onPressed: () => Navigator.of(dialogContext).pop(),
icon: const Icon(Icons.close),
),
),
),
ProfileInfoBody(
user: member,
onNewChatOpen: () {
dialogContext.pop();
Navigator.of(dialogContext).pop();
},
onUpdatedMembers: onUpdatedMembers,
),
Expand Down
3 changes: 1 addition & 2 deletions lib/pages/invitation_selection/invitation_selection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:flutter/material.dart';
import 'package:adaptive_dialog/adaptive_dialog.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';

import 'package:go_router/go_router.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:fluffychat/widgets/matrix.dart';
import 'package:matrix/matrix.dart';
Expand Down Expand Up @@ -94,7 +93,7 @@ class InvitationSelectionController
}

void inviteSuccessAction() {
context.pop();
Navigator.of(context).pop();
}

@override
Expand Down
3 changes: 1 addition & 2 deletions lib/pages/new_group/contacts_selection_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import 'package:fluffychat/widgets/twake_components/twake_fab.dart';
import 'package:fluffychat/widgets/twake_components/twake_text_button.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:linagora_design_flutter/linagora_design_flutter.dart';

class ContactsSelectionView extends StatelessWidget {
Expand Down Expand Up @@ -140,7 +139,7 @@ class ContactsSelectionView extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.end,
children: [
TwakeTextButton(
onTap: () => context.pop(),
onTap: () => Navigator.of(context).pop(),
message: L10n.of(context)!.cancel,
borderHover: ContactsSelectionViewStyle.webActionsButtonBorder,
margin: ContactsSelectionViewStyle.webActionsButtonMargin,
Expand Down
3 changes: 1 addition & 2 deletions lib/pages/profile_info/profile_info_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:fluffychat/pages/profile_info/profile_info_page.dart';
import 'package:fluffychat/pages/profile_info/profile_info_body/profile_info_body.dart';
import 'package:fluffychat/pages/profile_info/profile_info_view_style.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:linagora_design_flutter/colors/linagora_state_layer.dart';
import 'package:linagora_design_flutter/colors/linagora_sys_colors.dart';
Expand Down Expand Up @@ -43,7 +42,7 @@ class ProfileInfoView extends StatelessWidget {
splashColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
onPressed: () => context.pop(),
onPressed: () => Navigator.of(context).pop(),
icon: const Icon(Icons.arrow_back),
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/app_bars/searchable_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class SearchableAppBar extends StatelessWidget {
] else ...[
if (displayBackButton)
TwakeIconButton(
onTap: () => context.pop(),
onTap: () => Navigator.of(context).pop(),
tooltip: L10n.of(context)!.close,
icon: Icons.close,
paddingAll: SearchableAppBarStyle.closeButtonPaddingAll,
Expand Down
Loading