fix: Regressions because of vrouter

This commit is contained in:
Christian Pauly 2021-05-23 15:02:36 +02:00
parent 00e43c666e
commit 8ee4e3c155
24 changed files with 122 additions and 53 deletions

View File

@ -145,7 +145,22 @@ class AppRoutes {
), ),
buildTransition: _fadeTransition, buildTransition: _fadeTransition,
stackedRoutes: [ stackedRoutes: [
_settingsRoute, VNester(
path: '/settings',
widgetBuilder: (child) => TwoColumnLayout(
mainView: Settings(),
sideView: child,
),
buildTransition: _dynamicTransition,
nestedRoutes: [
VWidget(
path: '',
widget: EmptyPage(),
buildTransition: _dynamicTransition,
stackedRoutes: _settingsRoutes,
),
],
),
VWidget( VWidget(
path: '/search', path: '/search',
widget: TwoColumnLayout( widget: TwoColumnLayout(
@ -185,7 +200,11 @@ class AppRoutes {
stackedRoutes: _chatDetailsRoutes, stackedRoutes: _chatDetailsRoutes,
), ),
]), ]),
_settingsRoute, VWidget(
path: '/settings',
widget: Settings(),
stackedRoutes: _settingsRoutes,
),
VWidget( VWidget(
path: '/search', path: '/search',
widget: Search(), widget: Search(),
@ -224,58 +243,43 @@ class AppRoutes {
), ),
]; ];
VNester get _settingsRoute => VNester( List<VRouteElement> get _settingsRoutes => [
path: '/settings', VWidget(
widgetBuilder: (child) => TwoColumnLayout( path: 'emotes',
mainView: Settings(), widget: EmotesSettings(),
sideView: child, buildTransition: _dynamicTransition,
), ),
buildTransition: _dynamicTransition, VWidget(
nestedRoutes: [ path: 'notifications',
VWidget( widget: SettingsNotifications(),
path: '', buildTransition: _dynamicTransition,
widget: EmptyPage(), ),
buildTransition: _dynamicTransition, VWidget(
stackedRoutes: [ path: 'ignorelist',
VWidget( widget: SettingsIgnoreList(),
path: 'emotes', buildTransition: _dynamicTransition,
widget: EmotesSettings(), ),
buildTransition: _dynamicTransition, VWidget(
), path: 'style',
VWidget( widget: SettingsStyle(),
path: 'notifications', buildTransition: _dynamicTransition,
widget: SettingsNotifications(), ),
buildTransition: _dynamicTransition, VWidget(
), path: 'devices',
VWidget( widget: DevicesSettings(),
path: 'ignorelist', buildTransition: _dynamicTransition,
widget: SettingsIgnoreList(), ),
buildTransition: _dynamicTransition, VWidget(
), path: '/logs',
VWidget( widget: LogViewer(),
path: 'style', buildTransition: _dynamicTransition,
widget: SettingsStyle(), ),
buildTransition: _dynamicTransition, VWidget(
), path: '3pid',
VWidget( widget: Settings3Pid(),
path: 'devices', buildTransition: _dynamicTransition,
widget: DevicesSettings(), ),
buildTransition: _dynamicTransition, ];
),
VWidget(
path: '/logs',
widget: LogViewer(),
buildTransition: _dynamicTransition,
),
VWidget(
path: '3pid',
widget: Settings3Pid(),
buildTransition: _dynamicTransition,
),
],
),
],
);
final _fadeTransition = (animation1, _, child) => final _fadeTransition = (animation1, _, child) =>
FadeTransition(opacity: animation1, child: child); FadeTransition(opacity: animation1, child: child);

View File

@ -23,6 +23,7 @@ class ArchiveController extends State<Archive> {
void forgetAllAction() async { void forgetAllAction() async {
if (await showOkCancelAlertDialog( if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).areYouSure, title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes, okLabel: L10n.of(context).yes,

View File

@ -26,11 +26,13 @@ class BootstrapDialog extends StatefulWidget {
context: context, context: context,
builder: (context) => this, builder: (context) => this,
barrierDismissible: true, barrierDismissible: true,
useRootNavigator: false,
) )
: showDialog( : showDialog(
context: context, context: context,
builder: (context) => this, builder: (context) => this,
barrierDismissible: true, barrierDismissible: true,
useRootNavigator: false,
); );
@override @override
@ -193,6 +195,7 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
onPressed: () async { onPressed: () async {
if (OkCancelResult.ok == if (OkCancelResult.ok ==
await showOkCancelAlertDialog( await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).securityKeyLost, title: L10n.of(context).securityKeyLost,
message: L10n.of(context).wipeChatBackup, message: L10n.of(context).wipeChatBackup,

View File

@ -233,6 +233,7 @@ class ChatController extends State<Chat> {
if (result == null) return; if (result == null) return;
await showDialog( await showDialog(
context: context, context: context,
useRootNavigator: false,
builder: (c) => SendFileDialog( builder: (c) => SendFileDialog(
file: MatrixFile( file: MatrixFile(
bytes: result.toUint8List(), bytes: result.toUint8List(),
@ -249,6 +250,7 @@ class ChatController extends State<Chat> {
if (result == null) return; if (result == null) return;
await showDialog( await showDialog(
context: context, context: context,
useRootNavigator: false,
builder: (c) => SendFileDialog( builder: (c) => SendFileDialog(
file: MatrixImageFile( file: MatrixImageFile(
bytes: result.toUint8List(), bytes: result.toUint8List(),
@ -265,6 +267,7 @@ class ChatController extends State<Chat> {
final bytes = await file.readAsBytes(); final bytes = await file.readAsBytes();
await showDialog( await showDialog(
context: context, context: context,
useRootNavigator: false,
builder: (c) => SendFileDialog( builder: (c) => SendFileDialog(
file: MatrixImageFile( file: MatrixImageFile(
bytes: bytes, bytes: bytes,
@ -282,6 +285,7 @@ class ChatController extends State<Chat> {
} }
final result = await showDialog<String>( final result = await showDialog<String>(
context: context, context: context,
useRootNavigator: false,
builder: (c) => RecordingDialog(), builder: (c) => RecordingDialog(),
); );
if (result == null) return; if (result == null) return;
@ -339,6 +343,7 @@ class ChatController extends State<Chat> {
]); ]);
if (score == null) return; if (score == null) return;
final reason = await showTextInputDialog( final reason = await showTextInputDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).whyDoYouWantToReportThis, title: L10n.of(context).whyDoYouWantToReportThis,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -362,6 +367,7 @@ class ChatController extends State<Chat> {
void redactEventsAction() async { void redactEventsAction() async {
final confirmed = await showOkCancelAlertDialog( final confirmed = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).messageWillBeRemovedWarning, title: L10n.of(context).messageWillBeRemovedWarning,
okLabel: L10n.of(context).remove, okLabel: L10n.of(context).remove,
@ -538,6 +544,7 @@ class ChatController extends State<Chat> {
void goToNewRoomAction() async { void goToNewRoomAction() async {
if (OkCancelResult.ok != if (OkCancelResult.ok !=
await showOkCancelAlertDialog( await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).goToTheNewRoom, title: L10n.of(context).goToTheNewRoom,
message: room message: room

View File

@ -31,6 +31,7 @@ class ChatDetailsController extends State<ChatDetails> {
void setDisplaynameAction() async { void setDisplaynameAction() async {
final room = Matrix.of(context).client.getRoomById(roomId); final room = Matrix.of(context).client.getRoomById(roomId);
final input = await showTextInputDialog( final input = await showTextInputDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).changeTheNameOfTheGroup, title: L10n.of(context).changeTheNameOfTheGroup,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -88,6 +89,7 @@ class ChatDetailsController extends State<ChatDetails> {
return setAliasAction(); return setAliasAction();
} }
final select = await showConfirmationDialog( final select = await showConfirmationDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).editRoomAliases, title: L10n.of(context).editRoomAliases,
actions: [ actions: [
@ -155,6 +157,7 @@ class ChatDetailsController extends State<ChatDetails> {
final domain = room.client.userID.domain; final domain = room.client.userID.domain;
final input = await showTextInputDialog( final input = await showTextInputDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).setInvitationLink, title: L10n.of(context).setInvitationLink,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -179,6 +182,7 @@ class ChatDetailsController extends State<ChatDetails> {
void setTopicAction() async { void setTopicAction() async {
final room = Matrix.of(context).client.getRoomById(roomId); final room = Matrix.of(context).client.getRoomById(roomId);
final input = await showTextInputDialog( final input = await showTextInputDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).setGroupDescription, title: L10n.of(context).setGroupDescription,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,

View File

@ -155,6 +155,7 @@ class ChatListController extends State<ChatList> {
Future<void> archiveAction() async { Future<void> archiveAction() async {
final confirmed = await showOkCancelAlertDialog( final confirmed = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).areYouSure, title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes, okLabel: L10n.of(context).yes,
@ -171,6 +172,7 @@ class ChatListController extends State<ChatList> {
void setStatus() async { void setStatus() async {
final input = await showTextInputDialog( final input = await showTextInputDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).setStatus, title: L10n.of(context).setStatus,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,

View File

@ -78,6 +78,7 @@ class ChatPermissionsSettingsController extends State<ChatPermissionsSettings> {
if (newVersion == null || if (newVersion == null ||
OkCancelResult.cancel == OkCancelResult.cancel ==
await showOkCancelAlertDialog( await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
okLabel: L10n.of(context).yes, okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).cancel, cancelLabel: L10n.of(context).cancel,

View File

@ -29,6 +29,7 @@ class DevicesSettingsController extends State<DevicesSettings> {
void removeDevicesAction(List<Device> devices) async { void removeDevicesAction(List<Device> devices) async {
if (await showOkCancelAlertDialog( if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).areYouSure, title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes, okLabel: L10n.of(context).yes,
@ -63,6 +64,7 @@ class DevicesSettingsController extends State<DevicesSettings> {
void renameDeviceAction(Device device) async { void renameDeviceAction(Device device) async {
final displayName = await showTextInputDialog( final displayName = await showTextInputDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).changeDeviceName, title: L10n.of(context).changeDeviceName,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,

View File

@ -16,11 +16,13 @@ class KeyVerificationDialog extends StatefulWidget {
context: context, context: context,
barrierDismissible: true, barrierDismissible: true,
builder: (context) => this, builder: (context) => this,
useRootNavigator: false,
) )
: showDialog( : showDialog(
context: context, context: context,
barrierDismissible: true, barrierDismissible: true,
builder: (context) => this, builder: (context) => this,
useRootNavigator: false,
); );
final KeyVerification request; final KeyVerification request;
@ -96,6 +98,7 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
}); });
if (valid.error != null) { if (valid.error != null) {
await showOkAlertDialog( await showOkAlertDialog(
useRootNavigator: false,
context: context, context: context,
message: L10n.of(context).incorrectPassphraseOrKey, message: L10n.of(context).incorrectPassphraseOrKey,
); );
@ -183,6 +186,7 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
label: L10n.of(context).verifyManual, label: L10n.of(context).verifyManual,
onPressed: () async { onPressed: () async {
final result = await showOkCancelAlertDialog( final result = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).verifyManual, title: L10n.of(context).verifyManual,
message: key.ed25519Key.beautified, message: key.ed25519Key.beautified,

View File

@ -115,6 +115,7 @@ class LoginController extends State<Login> {
void passwordForgotten() async { void passwordForgotten() async {
final input = await showTextInputDialog( final input = await showTextInputDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).enterAnEmailAddress, title: L10n.of(context).enterAnEmailAddress,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -138,6 +139,7 @@ class LoginController extends State<Login> {
); );
if (response.error != null) return; if (response.error != null) return;
final ok = await showOkAlertDialog( final ok = await showOkAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).weSentYouAnEmail, title: L10n.of(context).weSentYouAnEmail,
message: L10n.of(context).pleaseClickOnLink, message: L10n.of(context).pleaseClickOnLink,
@ -145,6 +147,7 @@ class LoginController extends State<Login> {
); );
if (ok == null) return; if (ok == null) return;
final password = await showTextInputDialog( final password = await showTextInputDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).chooseAStrongPassword, title: L10n.of(context).chooseAStrongPassword,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,

View File

@ -14,10 +14,12 @@ class PermissionSliderDialog extends StatefulWidget {
? showCupertinoDialog<int>( ? showCupertinoDialog<int>(
context: context, context: context,
builder: (context) => this, builder: (context) => this,
useRootNavigator: false,
) )
: showDialog<int>( : showDialog<int>(
context: context, context: context,
builder: (context) => this, builder: (context) => this,
useRootNavigator: false,
); );
final int initialPermission; final int initialPermission;

View File

@ -59,6 +59,7 @@ class SearchController extends State<Search> {
void joinGroupAction(PublicRoom room) async { void joinGroupAction(PublicRoom room) async {
if (await showOkCancelAlertDialog( if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
okLabel: L10n.of(context).joinRoom, okLabel: L10n.of(context).joinRoom,
title: '${room.name} (${room.numJoinedMembers ?? 0})', title: '${room.name} (${room.numJoinedMembers ?? 0})',
@ -85,6 +86,7 @@ class SearchController extends State<Search> {
void setServer() async { void setServer() async {
final newServer = await showTextInputDialog( final newServer = await showTextInputDialog(
useRootNavigator: false,
title: L10n.of(context).changeTheHomeserver, title: L10n.of(context).changeTheHomeserver,
context: context, context: context,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,

View File

@ -37,6 +37,7 @@ class SettingsController extends State<Settings> {
void logoutAction() async { void logoutAction() async {
if (await showOkCancelAlertDialog( if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).areYouSureYouWantToLogout, title: L10n.of(context).areYouSureYouWantToLogout,
okLabel: L10n.of(context).yes, okLabel: L10n.of(context).yes,
@ -54,6 +55,7 @@ class SettingsController extends State<Settings> {
void changePasswordAccountAction() async { void changePasswordAccountAction() async {
final input = await showTextInputDialog( final input = await showTextInputDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).changePassword, title: L10n.of(context).changePassword,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -88,6 +90,7 @@ class SettingsController extends State<Settings> {
void deleteAccountAction() async { void deleteAccountAction() async {
if (await showOkCancelAlertDialog( if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).warning, title: L10n.of(context).warning,
message: L10n.of(context).deactivateAccountWarning, message: L10n.of(context).deactivateAccountWarning,
@ -98,6 +101,7 @@ class SettingsController extends State<Settings> {
return; return;
} }
if (await showOkCancelAlertDialog( if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).areYouSure, title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes, okLabel: L10n.of(context).yes,
@ -107,6 +111,7 @@ class SettingsController extends State<Settings> {
return; return;
} }
final input = await showTextInputDialog( final input = await showTextInputDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).pleaseEnterYourPassword, title: L10n.of(context).pleaseEnterYourPassword,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -137,6 +142,7 @@ class SettingsController extends State<Settings> {
void setJitsiInstanceAction() async { void setJitsiInstanceAction() async {
const prefix = 'https://'; const prefix = 'https://';
final input = await showTextInputDialog( final input = await showTextInputDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).editJitsiInstance, title: L10n.of(context).editJitsiInstance,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -160,6 +166,7 @@ class SettingsController extends State<Settings> {
void setDisplaynameAction() async { void setDisplaynameAction() async {
final input = await showTextInputDialog( final input = await showTextInputDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).editDisplayname, title: L10n.of(context).editDisplayname,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -224,6 +231,7 @@ class SettingsController extends State<Settings> {
Future<void> requestSSSSCache() async { Future<void> requestSSSSCache() async {
final handle = Matrix.of(context).client.encryption.ssss.open(); final handle = Matrix.of(context).client.encryption.ssss.open();
final input = await showTextInputDialog( final input = await showTextInputDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).askSSSSCache, title: L10n.of(context).askSSSSCache,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -256,6 +264,7 @@ class SettingsController extends State<Settings> {
if (valid.result == true) { if (valid.result == true) {
await handle.maybeCacheAll(); await handle.maybeCacheAll();
await showOkAlertDialog( await showOkAlertDialog(
useRootNavigator: false,
context: context, context: context,
message: L10n.of(context).cachedKeys, message: L10n.of(context).cachedKeys,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -268,6 +277,7 @@ class SettingsController extends State<Settings> {
}); });
} else { } else {
await showOkAlertDialog( await showOkAlertDialog(
useRootNavigator: false,
context: context, context: context,
message: L10n.of(context).incorrectPassphraseOrKey, message: L10n.of(context).incorrectPassphraseOrKey,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -283,6 +293,7 @@ class SettingsController extends State<Settings> {
await AppLock.of(context).showLockScreen(); await AppLock.of(context).showLockScreen();
} }
final newLock = await showTextInputDialog( final newLock = await showTextInputDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).pleaseChooseAPasscode, title: L10n.of(context).pleaseChooseAPasscode,
message: L10n.of(context).pleaseEnter4Digits, message: L10n.of(context).pleaseEnter4Digits,
@ -317,6 +328,7 @@ class SettingsController extends State<Settings> {
if (await Matrix.of(context).client.encryption.keyManager.isCached()) { if (await Matrix.of(context).client.encryption.keyManager.isCached()) {
if (OkCancelResult.ok == if (OkCancelResult.ok ==
await showOkCancelAlertDialog( await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).keysCached, title: L10n.of(context).keysCached,
message: L10n.of(context).wipeChatBackup, message: L10n.of(context).wipeChatBackup,

View File

@ -17,6 +17,7 @@ class Settings3Pid extends StatefulWidget {
class Settings3PidController extends State<Settings3Pid> { class Settings3PidController extends State<Settings3Pid> {
void add3PidAction() async { void add3PidAction() async {
final input = await showTextInputDialog( final input = await showTextInputDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).enterAnEmailAddress, title: L10n.of(context).enterAnEmailAddress,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -40,6 +41,7 @@ class Settings3PidController extends State<Settings3Pid> {
); );
if (response.error != null) return; if (response.error != null) return;
final ok = await showOkAlertDialog( final ok = await showOkAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).weSentYouAnEmail, title: L10n.of(context).weSentYouAnEmail,
message: L10n.of(context).pleaseClickOnLink, message: L10n.of(context).pleaseClickOnLink,
@ -64,6 +66,7 @@ class Settings3PidController extends State<Settings3Pid> {
void delete3Pid(ThirdPartyIdentifier identifier) async { void delete3Pid(ThirdPartyIdentifier identifier) async {
if (await showOkCancelAlertDialog( if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).areYouSure, title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes, okLabel: L10n.of(context).yes,

View File

@ -135,6 +135,7 @@ class EmotesSettingsController extends State<EmotesSettings> {
-1) { -1) {
controller.text = emote.emoteClean; controller.text = emote.emoteClean;
showOkAlertDialog( showOkAlertDialog(
useRootNavigator: false,
context: context, context: context,
message: L10n.of(context).emoteExists, message: L10n.of(context).emoteExists,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -144,6 +145,7 @@ class EmotesSettingsController extends State<EmotesSettings> {
if (!RegExp(r'^:[-\w]+:$').hasMatch(emoteCode)) { if (!RegExp(r'^:[-\w]+:$').hasMatch(emoteCode)) {
controller.text = emote.emoteClean; controller.text = emote.emoteClean;
showOkAlertDialog( showOkAlertDialog(
useRootNavigator: false,
context: context, context: context,
message: L10n.of(context).emoteInvalid, message: L10n.of(context).emoteInvalid,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -182,6 +184,7 @@ class EmotesSettingsController extends State<EmotesSettings> {
newMxcController.text == null || newMxcController.text == null ||
newMxcController.text.isEmpty) { newMxcController.text.isEmpty) {
await showOkAlertDialog( await showOkAlertDialog(
useRootNavigator: false,
context: context, context: context,
message: L10n.of(context).emoteWarnNeedToPick, message: L10n.of(context).emoteWarnNeedToPick,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -192,6 +195,7 @@ class EmotesSettingsController extends State<EmotesSettings> {
final mxc = newMxcController.text; final mxc = newMxcController.text;
if (emotes.indexWhere((e) => e.emote == emoteCode && e.mxc != mxc) != -1) { if (emotes.indexWhere((e) => e.emote == emoteCode && e.mxc != mxc) != -1) {
await showOkAlertDialog( await showOkAlertDialog(
useRootNavigator: false,
context: context, context: context,
message: L10n.of(context).emoteExists, message: L10n.of(context).emoteExists,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
@ -200,6 +204,7 @@ class EmotesSettingsController extends State<EmotesSettings> {
} }
if (!RegExp(r'^:[-\w]+:$').hasMatch(emoteCode)) { if (!RegExp(r'^:[-\w]+:$').hasMatch(emoteCode)) {
await showOkAlertDialog( await showOkAlertDialog(
useRootNavigator: false,
context: context, context: context,
message: L10n.of(context).emoteInvalid, message: L10n.of(context).emoteInvalid,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,

View File

@ -58,6 +58,7 @@ class SignUpPasswordController extends State<SignUpPassword> {
); );
if (OkCancelResult.ok != if (OkCancelResult.ok !=
await showOkCancelAlertDialog( await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
message: L10n.of(context).weSentYouAnEmail, message: L10n.of(context).weSentYouAnEmail,
okLabel: L10n.of(context).confirm, okLabel: L10n.of(context).confirm,

View File

@ -30,6 +30,7 @@ class UserBottomSheetController extends State<UserBottomSheet> {
void participantAction(String action) async { void participantAction(String action) async {
final Function _askConfirmation = final Function _askConfirmation =
() async => (await showOkCancelAlertDialog( () async => (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).areYouSure, title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes, okLabel: L10n.of(context).yes,

View File

@ -202,6 +202,7 @@ class SettingsView extends StatelessWidget {
ListTile( ListTile(
title: Text(L10n.of(context).yourPublicKey), title: Text(L10n.of(context).yourPublicKey),
onTap: () => showOkAlertDialog( onTap: () => showOkAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).yourPublicKey, title: L10n.of(context).yourPublicKey,
message: client.fingerprintKey.beautified, message: client.fingerprintKey.beautified,

View File

@ -43,6 +43,7 @@ abstract class PlatformInfos {
final version = await PlatformInfos.getVersion(); final version = await PlatformInfos.getVersion();
showAboutDialog( showAboutDialog(
context: context, context: context,
useRootNavigator: false,
children: [ children: [
Text('Version: $version'), Text('Version: $version'),
OutlinedButton( OutlinedButton(

View File

@ -70,6 +70,7 @@ class UrlLauncher {
} }
if (roomIdOrAlias.sigil == '!') { if (roomIdOrAlias.sigil == '!') {
if (await showOkCancelAlertDialog( if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: 'Join room $roomIdOrAlias', title: 'Join room $roomIdOrAlias',
) == ) ==
@ -111,6 +112,7 @@ class UrlLauncher {
} }
if (await showOkCancelAlertDialog( if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: 'Message user ${user.id}', title: 'Message user ${user.id}',
) == ) ==

View File

@ -68,6 +68,7 @@ class _ChatSettingsPopupMenuState extends State<ChatSettingsPopupMenu> {
switch (choice) { switch (choice) {
case 'leave': case 'leave':
final confirmed = await showOkCancelAlertDialog( final confirmed = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).areYouSure, title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,

View File

@ -26,6 +26,7 @@ class _EncryptionButtonState extends State<EncryptionButton> {
} }
if (widget.room.joinRules == JoinRules.public) { if (widget.room.joinRules == JoinRules.public) {
await showOkAlertDialog( await showOkAlertDialog(
useRootNavigator: false,
context: context, context: context,
okLabel: L10n.of(context).ok, okLabel: L10n.of(context).ok,
message: L10n.of(context).noEncryptionForPublicRooms, message: L10n.of(context).noEncryptionForPublicRooms,
@ -33,6 +34,7 @@ class _EncryptionButtonState extends State<EncryptionButton> {
return; return;
} }
if (await showOkCancelAlertDialog( if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).enableEncryption, title: L10n.of(context).enableEncryption,
message: widget.room.client.encryptionEnabled message: widget.room.client.encryptionEnabled

View File

@ -93,6 +93,7 @@ class ChatListItem extends StatelessWidget {
'chat.fluffy.shared_file') { 'chat.fluffy.shared_file') {
await showDialog( await showDialog(
context: context, context: context,
useRootNavigator: false,
builder: (c) => SendFileDialog( builder: (c) => SendFileDialog(
file: Matrix.of(context).shareContent['file'], file: Matrix.of(context).shareContent['file'],
room: room, room: room,
@ -121,6 +122,7 @@ class ChatListItem extends StatelessWidget {
return success; return success;
} }
final confirmed = await showOkCancelAlertDialog( final confirmed = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context, context: context,
title: L10n.of(context).areYouSure, title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes, okLabel: L10n.of(context).yes,

View File

@ -128,6 +128,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
case AuthenticationTypes.password: case AuthenticationTypes.password:
final input = cachedPassword ?? final input = cachedPassword ??
(await showTextInputDialog( (await showTextInputDialog(
useRootNavigator: false,
context: navigatorContext, context: navigatorContext,
title: L10n.of(widget.context).pleaseEnterYourPassword, title: L10n.of(widget.context).pleaseEnterYourPassword,
okLabel: L10n.of(widget.context).ok, okLabel: L10n.of(widget.context).ok,
@ -182,6 +183,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
); );
if (OkCancelResult.ok == if (OkCancelResult.ok ==
await showOkCancelAlertDialog( await showOkCancelAlertDialog(
useRootNavigator: false,
message: L10n.of(widget.context).pleaseFollowInstructionsOnWeb, message: L10n.of(widget.context).pleaseFollowInstructionsOnWeb,
context: navigatorContext, context: navigatorContext,
okLabel: L10n.of(widget.context).next, okLabel: L10n.of(widget.context).next,
@ -293,6 +295,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
hidPopup = true; hidPopup = true;
}; };
if (await showOkCancelAlertDialog( if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: navigatorContext, context: navigatorContext,
title: L10n.of(widget.context).newVerificationRequest, title: L10n.of(widget.context).newVerificationRequest,
message: message: