mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-23 18:44:10 +01:00
fix: Dialog using wrong Navigator
This commit is contained in:
parent
aa396acdc9
commit
9458ab3e3b
@ -68,6 +68,7 @@ class _ChatSettingsPopupMenuState extends State<ChatSettingsPopupMenu> {
|
|||||||
case 'leave':
|
case 'leave':
|
||||||
var confirmed = await showOkCancelAlertDialog(
|
var confirmed = await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
useRootNavigator: false,
|
||||||
title: L10n.of(context).areYouSure,
|
title: L10n.of(context).areYouSure,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
@ -3,6 +3,7 @@ import 'package:famedlysdk/encryption.dart';
|
|||||||
import 'package:famedlysdk/encryption/utils/bootstrap.dart';
|
import 'package:famedlysdk/encryption/utils/bootstrap.dart';
|
||||||
import 'package:famedlysdk/famedlysdk.dart';
|
import 'package:famedlysdk/famedlysdk.dart';
|
||||||
import 'package:fluffychat/components/dialogs/adaptive_flat_button.dart';
|
import 'package:fluffychat/components/dialogs/adaptive_flat_button.dart';
|
||||||
|
import 'package:fluffychat/components/matrix.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:fluffychat/utils/platform_infos.dart';
|
import 'package:fluffychat/utils/platform_infos.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
@ -15,17 +16,20 @@ class BootstrapDialog extends StatefulWidget {
|
|||||||
final bool wipe;
|
final bool wipe;
|
||||||
const BootstrapDialog({
|
const BootstrapDialog({
|
||||||
Key key,
|
Key key,
|
||||||
@required this.l10n,
|
|
||||||
@required this.client,
|
|
||||||
this.wipe = false,
|
this.wipe = false,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
Future<bool> show(BuildContext context) => PlatformInfos.isCupertinoStyle
|
Future<bool> show(BuildContext context) => PlatformInfos.isCupertinoStyle
|
||||||
? showCupertinoDialog(context: context, builder: (context) => this)
|
? showCupertinoDialog(
|
||||||
: showDialog(context: context, builder: (context) => this);
|
context: context,
|
||||||
|
builder: (context) => this,
|
||||||
final L10n l10n;
|
useRootNavigator: false,
|
||||||
final Client client;
|
)
|
||||||
|
: showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => this,
|
||||||
|
useRootNavigator: false,
|
||||||
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_BootstrapDialogState createState() => _BootstrapDialogState();
|
_BootstrapDialogState createState() => _BootstrapDialogState();
|
||||||
@ -52,7 +56,9 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||||||
_wipe = wipe;
|
_wipe = wipe;
|
||||||
titleText = null;
|
titleText = null;
|
||||||
_recoveryKeyStored = false;
|
_recoveryKeyStored = false;
|
||||||
bootstrap = widget.client.encryption
|
bootstrap = Matrix.of(context)
|
||||||
|
.client
|
||||||
|
.encryption
|
||||||
.bootstrap(onUpdate: () => setState(() => null));
|
.bootstrap(onUpdate: () => setState(() => null));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -62,19 +68,19 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||||||
_wipe ??= widget.wipe;
|
_wipe ??= widget.wipe;
|
||||||
final buttons = <AdaptiveFlatButton>[];
|
final buttons = <AdaptiveFlatButton>[];
|
||||||
Widget body = LinearProgressIndicator();
|
Widget body = LinearProgressIndicator();
|
||||||
titleText = widget.l10n.loadingPleaseWait;
|
titleText = L10n.of(context).loadingPleaseWait;
|
||||||
|
|
||||||
if (bootstrap == null) {
|
if (bootstrap == null) {
|
||||||
titleText = widget.l10n.chatBackup;
|
titleText = L10n.of(context).chatBackup;
|
||||||
body = Text(widget.l10n.chatBackupDescription);
|
body = Text(L10n.of(context).chatBackupDescription);
|
||||||
buttons.add(AdaptiveFlatButton(
|
buttons.add(AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.next),
|
child: Text(L10n.of(context).next),
|
||||||
onPressed: () => _createBootstrap(false),
|
onPressed: () => _createBootstrap(false),
|
||||||
));
|
));
|
||||||
} else if (bootstrap.newSsssKey?.recoveryKey != null &&
|
} else if (bootstrap.newSsssKey?.recoveryKey != null &&
|
||||||
_recoveryKeyStored == false) {
|
_recoveryKeyStored == false) {
|
||||||
final key = bootstrap.newSsssKey.recoveryKey;
|
final key = bootstrap.newSsssKey.recoveryKey;
|
||||||
titleText = widget.l10n.securityKey;
|
titleText = L10n.of(context).securityKey;
|
||||||
body = Container(
|
body = Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
width: 200,
|
width: 200,
|
||||||
@ -89,11 +95,11 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
buttons.add(AdaptiveFlatButton(
|
buttons.add(AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.copyToClipboard),
|
child: Text(L10n.of(context).copyToClipboard),
|
||||||
onPressed: () => Clipboard.setData(ClipboardData(text: key)),
|
onPressed: () => Clipboard.setData(ClipboardData(text: key)),
|
||||||
));
|
));
|
||||||
buttons.add(AdaptiveFlatButton(
|
buttons.add(AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.next),
|
child: Text(L10n.of(context).next),
|
||||||
onPressed: () => setState(() => _recoveryKeyStored = true),
|
onPressed: () => setState(() => _recoveryKeyStored = true),
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
@ -120,7 +126,7 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||||||
case BootstrapState.openExistingSsss:
|
case BootstrapState.openExistingSsss:
|
||||||
_recoveryKeyStored = true;
|
_recoveryKeyStored = true;
|
||||||
titleText =
|
titleText =
|
||||||
_recoveryKeyInputError ?? widget.l10n.pleaseEnterSecurityKey;
|
_recoveryKeyInputError ?? L10n.of(context).pleaseEnterSecurityKey;
|
||||||
body = PlatformInfos.isCupertinoStyle
|
body = PlatformInfos.isCupertinoStyle
|
||||||
? CupertinoTextField(
|
? CupertinoTextField(
|
||||||
minLines: 2,
|
minLines: 2,
|
||||||
@ -149,10 +155,11 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||||||
if (OkCancelResult.ok ==
|
if (OkCancelResult.ok ==
|
||||||
await showOkCancelAlertDialog(
|
await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
title: widget.l10n.securityKeyLost,
|
useRootNavigator: false,
|
||||||
message: widget.l10n.wipeChatBackup,
|
title: L10n.of(context).securityKeyLost,
|
||||||
okLabel: widget.l10n.ok,
|
message: L10n.of(context).wipeChatBackup,
|
||||||
cancelLabel: widget.l10n.cancel,
|
okLabel: L10n.of(context).ok,
|
||||||
|
cancelLabel: L10n.of(context).cancel,
|
||||||
isDestructiveAction: true,
|
isDestructiveAction: true,
|
||||||
)) {
|
)) {
|
||||||
_createBootstrap(true);
|
_createBootstrap(true);
|
||||||
@ -160,20 +167,18 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||||||
},
|
},
|
||||||
));
|
));
|
||||||
buttons.add(AdaptiveFlatButton(
|
buttons.add(AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.transferFromAnotherDevice),
|
child: Text(L10n.of(context).transferFromAnotherDevice),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final req = await widget
|
final req = await Matrix.of(context)
|
||||||
.client.userDeviceKeys[widget.client.userID]
|
.client
|
||||||
|
.userDeviceKeys[Matrix.of(context).client.userID]
|
||||||
.startVerification();
|
.startVerification();
|
||||||
await KeyVerificationDialog(
|
await KeyVerificationDialog(request: req).show(context);
|
||||||
request: req,
|
Navigator.of(context, rootNavigator: false).pop();
|
||||||
l10n: widget.l10n,
|
|
||||||
).show(context);
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
buttons.add(AdaptiveFlatButton(
|
buttons.add(AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.next),
|
child: Text(L10n.of(context).next),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
setState(() {
|
setState(() {
|
||||||
_recoveryKeyInputError = null;
|
_recoveryKeyInputError = null;
|
||||||
@ -187,7 +192,7 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
Logs().w('Unable to unlock SSSS', e, s);
|
Logs().w('Unable to unlock SSSS', e, s);
|
||||||
setState(() => _recoveryKeyInputError =
|
setState(() => _recoveryKeyInputError =
|
||||||
widget.l10n.oopsSomethingWentWrong);
|
L10n.of(context).oopsSomethingWentWrong);
|
||||||
} finally {
|
} finally {
|
||||||
setState(() => _recoveryKeyInputLoading = false);
|
setState(() => _recoveryKeyInputLoading = false);
|
||||||
}
|
}
|
||||||
@ -220,27 +225,29 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||||||
break;
|
break;
|
||||||
case BootstrapState.askBadSsss:
|
case BootstrapState.askBadSsss:
|
||||||
case BootstrapState.error:
|
case BootstrapState.error:
|
||||||
titleText = widget.l10n.oopsSomethingWentWrong;
|
titleText = L10n.of(context).oopsSomethingWentWrong;
|
||||||
body = ListTile(
|
body = ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
leading: Icon(Icons.error_outline, color: Colors.red),
|
leading: Icon(Icons.error_outline, color: Colors.red),
|
||||||
title: Text(widget.l10n.oopsSomethingWentWrong),
|
title: Text(L10n.of(context).oopsSomethingWentWrong),
|
||||||
);
|
);
|
||||||
buttons.add(AdaptiveFlatButton(
|
buttons.add(AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.close),
|
child: Text(L10n.of(context).close),
|
||||||
onPressed: () => Navigator.of(context).pop<bool>(false),
|
onPressed: () =>
|
||||||
|
Navigator.of(context, rootNavigator: false).pop<bool>(false),
|
||||||
));
|
));
|
||||||
break;
|
break;
|
||||||
case BootstrapState.done:
|
case BootstrapState.done:
|
||||||
titleText = widget.l10n.everythingReady;
|
titleText = L10n.of(context).everythingReady;
|
||||||
body = ListTile(
|
body = ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
leading: Icon(Icons.check_circle, color: Colors.green),
|
leading: Icon(Icons.check_circle, color: Colors.green),
|
||||||
title: Text(widget.l10n.keysCached),
|
title: Text(L10n.of(context).keysCached),
|
||||||
);
|
);
|
||||||
buttons.add(AdaptiveFlatButton(
|
buttons.add(AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.close),
|
child: Text(L10n.of(context).close),
|
||||||
onPressed: () => Navigator.of(context).pop<bool>(false),
|
onPressed: () =>
|
||||||
|
Navigator.of(context, rootNavigator: false).pop<bool>(false),
|
||||||
));
|
));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -12,16 +12,21 @@ import '../../utils/beautify_string_extension.dart';
|
|||||||
|
|
||||||
class KeyVerificationDialog extends StatefulWidget {
|
class KeyVerificationDialog extends StatefulWidget {
|
||||||
Future<void> show(BuildContext context) => PlatformInfos.isCupertinoStyle
|
Future<void> show(BuildContext context) => PlatformInfos.isCupertinoStyle
|
||||||
? showCupertinoDialog(context: context, builder: (context) => this)
|
? showCupertinoDialog(
|
||||||
: showDialog(context: context, builder: (context) => this);
|
context: context,
|
||||||
|
builder: (context) => this,
|
||||||
|
useRootNavigator: false,
|
||||||
|
)
|
||||||
|
: showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => this,
|
||||||
|
useRootNavigator: false,
|
||||||
|
);
|
||||||
|
|
||||||
final KeyVerification request;
|
final KeyVerification request;
|
||||||
|
|
||||||
final L10n l10n;
|
|
||||||
|
|
||||||
KeyVerificationDialog({
|
KeyVerificationDialog({
|
||||||
this.request,
|
this.request,
|
||||||
@required this.l10n,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -92,7 +97,8 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||||||
if (valid.error != null) {
|
if (valid.error != null) {
|
||||||
await showOkAlertDialog(
|
await showOkAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
message: widget.l10n.incorrectPassphraseOrKey,
|
message: L10n.of(context).incorrectPassphraseOrKey,
|
||||||
|
useRootNavigator: false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -100,7 +106,8 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||||||
margin: EdgeInsets.only(left: 8.0, right: 8.0),
|
margin: EdgeInsets.only(left: 8.0, right: 8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(widget.l10n.askSSSSSign, style: TextStyle(fontSize: 20)),
|
Text(L10n.of(context).askSSSSSign,
|
||||||
|
style: TextStyle(fontSize: 20)),
|
||||||
Container(height: 10),
|
Container(height: 10),
|
||||||
TextField(
|
TextField(
|
||||||
controller: textEditingController,
|
controller: textEditingController,
|
||||||
@ -114,7 +121,7 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
obscureText: true,
|
obscureText: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: widget.l10n.passphraseOrKey,
|
hintText: L10n.of(context).passphraseOrKey,
|
||||||
prefixStyle: TextStyle(color: Theme.of(context).primaryColor),
|
prefixStyle: TextStyle(color: Theme.of(context).primaryColor),
|
||||||
suffixStyle: TextStyle(color: Theme.of(context).primaryColor),
|
suffixStyle: TextStyle(color: Theme.of(context).primaryColor),
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
@ -125,32 +132,33 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
buttons.add(AdaptiveFlatButton(
|
buttons.add(AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.submit),
|
child: Text(L10n.of(context).submit),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
input = textEditingController.text;
|
input = textEditingController.text;
|
||||||
checkInput();
|
checkInput();
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
buttons.add(AdaptiveFlatButton(
|
buttons.add(AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.skip),
|
child: Text(L10n.of(context).skip),
|
||||||
onPressed: () => widget.request.openSSSS(skip: true),
|
onPressed: () => widget.request.openSSSS(skip: true),
|
||||||
));
|
));
|
||||||
break;
|
break;
|
||||||
case KeyVerificationState.askAccept:
|
case KeyVerificationState.askAccept:
|
||||||
body = Container(
|
body = Container(
|
||||||
child: Text(widget.l10n.askVerificationRequest(widget.request.userId),
|
child: Text(
|
||||||
|
L10n.of(context).askVerificationRequest(widget.request.userId),
|
||||||
style: TextStyle(fontSize: 20)),
|
style: TextStyle(fontSize: 20)),
|
||||||
margin: EdgeInsets.only(left: 8.0, right: 8.0),
|
margin: EdgeInsets.only(left: 8.0, right: 8.0),
|
||||||
);
|
);
|
||||||
buttons.add(AdaptiveFlatButton(
|
buttons.add(AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.accept),
|
child: Text(L10n.of(context).accept),
|
||||||
onPressed: () => widget.request.acceptVerification(),
|
onPressed: () => widget.request.acceptVerification(),
|
||||||
));
|
));
|
||||||
buttons.add(AdaptiveFlatButton(
|
buttons.add(AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.reject),
|
child: Text(L10n.of(context).reject),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
widget.request.rejectVerification().then((_) {
|
widget.request.rejectVerification().then((_) {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context, rootNavigator: false).pop();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
@ -163,7 +171,7 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||||||
: CircularProgressIndicator(),
|
: CircularProgressIndicator(),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
widget.l10n.waitingPartnerAcceptRequest,
|
L10n.of(context).waitingPartnerAcceptRequest,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -173,18 +181,19 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||||||
.deviceKeys[widget.request.deviceId];
|
.deviceKeys[widget.request.deviceId];
|
||||||
if (key != null) {
|
if (key != null) {
|
||||||
buttons.add(AdaptiveFlatButton(
|
buttons.add(AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.verifyManual),
|
child: Text(L10n.of(context).verifyManual),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final result = await showOkCancelAlertDialog(
|
final result = await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
title: widget.l10n.verifyManual,
|
useRootNavigator: false,
|
||||||
|
title: L10n.of(context).verifyManual,
|
||||||
message: key.ed25519Key.beautified,
|
message: key.ed25519Key.beautified,
|
||||||
);
|
);
|
||||||
if (result == OkCancelResult.ok) {
|
if (result == OkCancelResult.ok) {
|
||||||
await key.setVerified(true);
|
await key.setVerified(true);
|
||||||
}
|
}
|
||||||
await widget.request.cancel();
|
await widget.request.cancel();
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context, rootNavigator: false).pop();
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -196,14 +205,14 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||||||
// view for if "emoji" is a present sasType or not?
|
// view for if "emoji" is a present sasType or not?
|
||||||
String compareText;
|
String compareText;
|
||||||
if (widget.request.sasTypes.contains('emoji')) {
|
if (widget.request.sasTypes.contains('emoji')) {
|
||||||
compareText = widget.l10n.compareEmojiMatch;
|
compareText = L10n.of(context).compareEmojiMatch;
|
||||||
compareWidget = TextSpan(
|
compareWidget = TextSpan(
|
||||||
children: widget.request.sasEmojis
|
children: widget.request.sasEmojis
|
||||||
.map((e) => WidgetSpan(child: _Emoji(e)))
|
.map((e) => WidgetSpan(child: _Emoji(e)))
|
||||||
.toList(),
|
.toList(),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
compareText = widget.l10n.compareNumbersMatch;
|
compareText = L10n.of(context).compareNumbersMatch;
|
||||||
final numbers = widget.request.sasNumbers;
|
final numbers = widget.request.sasNumbers;
|
||||||
final numbstr = '${numbers[0]}-${numbers[1]}-${numbers[2]}';
|
final numbstr = '${numbers[0]}-${numbers[1]}-${numbers[2]}';
|
||||||
compareWidget =
|
compareWidget =
|
||||||
@ -228,18 +237,18 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||||||
);
|
);
|
||||||
buttons.add(AdaptiveFlatButton(
|
buttons.add(AdaptiveFlatButton(
|
||||||
textColor: Colors.red,
|
textColor: Colors.red,
|
||||||
child: Text(widget.l10n.theyDontMatch),
|
child: Text(L10n.of(context).theyDontMatch),
|
||||||
onPressed: () => widget.request.rejectSas(),
|
onPressed: () => widget.request.rejectSas(),
|
||||||
));
|
));
|
||||||
buttons.add(AdaptiveFlatButton(
|
buttons.add(AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.theyMatch),
|
child: Text(L10n.of(context).theyMatch),
|
||||||
onPressed: () => widget.request.acceptSas(),
|
onPressed: () => widget.request.acceptSas(),
|
||||||
));
|
));
|
||||||
break;
|
break;
|
||||||
case KeyVerificationState.waitingSas:
|
case KeyVerificationState.waitingSas:
|
||||||
var acceptText = widget.request.sasTypes.contains('emoji')
|
var acceptText = widget.request.sasTypes.contains('emoji')
|
||||||
? widget.l10n.waitingPartnerEmoji
|
? L10n.of(context).waitingPartnerEmoji
|
||||||
: widget.l10n.waitingPartnerNumbers;
|
: L10n.of(context).waitingPartnerNumbers;
|
||||||
body = Column(
|
body = Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
PlatformInfos.isCupertinoStyle
|
PlatformInfos.isCupertinoStyle
|
||||||
@ -260,15 +269,15 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||||||
Icon(Icons.check_circle_outlined, color: Colors.green, size: 200.0),
|
Icon(Icons.check_circle_outlined, color: Colors.green, size: 200.0),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
widget.l10n.verifySuccess,
|
L10n.of(context).verifySuccess,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
);
|
);
|
||||||
buttons.add(AdaptiveFlatButton(
|
buttons.add(AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.close),
|
child: Text(L10n.of(context).close),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context, rootNavigator: false).pop(),
|
||||||
));
|
));
|
||||||
break;
|
break;
|
||||||
case KeyVerificationState.error:
|
case KeyVerificationState.error:
|
||||||
@ -284,8 +293,8 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
);
|
);
|
||||||
buttons.add(FlatButton(
|
buttons.add(FlatButton(
|
||||||
child: Text(widget.l10n.close),
|
child: Text(L10n.of(context).close),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context, rootNavigator: false).pop(),
|
||||||
));
|
));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -329,7 +338,7 @@ class _KeyVerificationPageState extends State<KeyVerificationDialog> {
|
|||||||
],
|
],
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
);
|
);
|
||||||
final title = Text(widget.l10n.verifyTitle);
|
final title = Text(L10n.of(context).verifyTitle);
|
||||||
final content = Scrollbar(
|
final content = Scrollbar(
|
||||||
isAlwaysShown: true,
|
isAlwaysShown: true,
|
||||||
controller: _scrollController,
|
controller: _scrollController,
|
||||||
|
@ -8,14 +8,19 @@ class PermissionSliderDialog extends StatefulWidget {
|
|||||||
const PermissionSliderDialog({
|
const PermissionSliderDialog({
|
||||||
Key key,
|
Key key,
|
||||||
this.initialPermission = 0,
|
this.initialPermission = 0,
|
||||||
@required this.l10n,
|
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final L10n l10n;
|
|
||||||
|
|
||||||
Future<int> show(BuildContext context) => PlatformInfos.isCupertinoStyle
|
Future<int> show(BuildContext context) => PlatformInfos.isCupertinoStyle
|
||||||
? showCupertinoDialog<int>(context: context, builder: (context) => this)
|
? showCupertinoDialog<int>(
|
||||||
: showDialog<int>(context: context, builder: (context) => this);
|
context: context,
|
||||||
|
builder: (context) => this,
|
||||||
|
useRootNavigator: false,
|
||||||
|
)
|
||||||
|
: showDialog<int>(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => this,
|
||||||
|
useRootNavigator: false,
|
||||||
|
);
|
||||||
|
|
||||||
final int initialPermission;
|
final int initialPermission;
|
||||||
@override
|
@override
|
||||||
@ -46,7 +51,7 @@ class _PermissionSliderDialogState extends State<PermissionSliderDialog> {
|
|||||||
min: 0.0,
|
min: 0.0,
|
||||||
);
|
);
|
||||||
final title = Text(
|
final title = Text(
|
||||||
widget.l10n.setPermissionsLevel,
|
L10n.of(context).setPermissionsLevel,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
);
|
);
|
||||||
final content = Column(
|
final content = Column(
|
||||||
@ -54,9 +59,9 @@ class _PermissionSliderDialogState extends State<PermissionSliderDialog> {
|
|||||||
children: [
|
children: [
|
||||||
Text('Level: ' +
|
Text('Level: ' +
|
||||||
(_permission == 100
|
(_permission == 100
|
||||||
? '$_permission (${widget.l10n.admin})'
|
? '$_permission (${L10n.of(context).admin})'
|
||||||
: _permission >= 50
|
: _permission >= 50
|
||||||
? '$_permission (${widget.l10n.moderator})'
|
? '$_permission (${L10n.of(context).moderator})'
|
||||||
: _permission.toString())),
|
: _permission.toString())),
|
||||||
Container(
|
Container(
|
||||||
height: 56,
|
height: 56,
|
||||||
@ -66,12 +71,14 @@ class _PermissionSliderDialogState extends State<PermissionSliderDialog> {
|
|||||||
);
|
);
|
||||||
final buttons = [
|
final buttons = [
|
||||||
AdaptiveFlatButton(
|
AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.cancel),
|
child: Text(L10n.of(context).cancel),
|
||||||
onPressed: () => Navigator.of(context).pop<int>(null),
|
onPressed: () =>
|
||||||
|
Navigator.of(context, rootNavigator: false).pop<int>(null),
|
||||||
),
|
),
|
||||||
AdaptiveFlatButton(
|
AdaptiveFlatButton(
|
||||||
child: Text(widget.l10n.confirm),
|
child: Text(L10n.of(context).confirm),
|
||||||
onPressed: () => Navigator.of(context).pop<int>(_permission),
|
onPressed: () =>
|
||||||
|
Navigator.of(context, rootNavigator: false).pop<int>(_permission),
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
if (PlatformInfos.isCupertinoStyle) {
|
if (PlatformInfos.isCupertinoStyle) {
|
||||||
|
@ -8,10 +8,7 @@ import 'package:flutter_sound_lite/flutter_sound.dart';
|
|||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
|
||||||
class RecordingDialog extends StatefulWidget {
|
class RecordingDialog extends StatefulWidget {
|
||||||
final L10n l10n;
|
|
||||||
|
|
||||||
const RecordingDialog({
|
const RecordingDialog({
|
||||||
@required this.l10n,
|
|
||||||
Key key,
|
Key key,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@ -76,7 +73,7 @@ class _RecordingDialogState extends State<RecordingDialog> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (error) {
|
if (error) {
|
||||||
Timer(Duration(seconds: 1), () {
|
Timer(Duration(seconds: 1), () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context, rootNavigator: false).pop();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const maxDecibalWidth = 64.0;
|
const maxDecibalWidth = 64.0;
|
||||||
@ -101,7 +98,7 @@ class _RecordingDialogState extends State<RecordingDialog> {
|
|||||||
SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
'${widget.l10n.recording}: $time',
|
'${L10n.of(context).recording}: $time',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
),
|
),
|
||||||
@ -112,17 +109,17 @@ class _RecordingDialogState extends State<RecordingDialog> {
|
|||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
FlatButton(
|
FlatButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.l10n.cancel.toUpperCase(),
|
L10n.of(context).cancel.toUpperCase(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).textTheme.bodyText2.color.withAlpha(150),
|
color: Theme.of(context).textTheme.bodyText2.color.withAlpha(150),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context, rootNavigator: false).pop(),
|
||||||
),
|
),
|
||||||
FlatButton(
|
FlatButton(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(widget.l10n.send.toUpperCase()),
|
Text(L10n.of(context).send.toUpperCase()),
|
||||||
SizedBox(width: 4),
|
SizedBox(width: 4),
|
||||||
Icon(Icons.send_outlined, size: 15),
|
Icon(Icons.send_outlined, size: 15),
|
||||||
],
|
],
|
||||||
@ -130,7 +127,8 @@ class _RecordingDialogState extends State<RecordingDialog> {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await _recorderSubscription?.cancel();
|
await _recorderSubscription?.cancel();
|
||||||
await flutterSound.stopRecorder();
|
await flutterSound.stopRecorder();
|
||||||
Navigator.of(context).pop<String>(_recordedPath);
|
Navigator.of(context, rootNavigator: false)
|
||||||
|
.pop<String>(_recordedPath);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -10,11 +10,9 @@ import '../../utils/resize_image.dart';
|
|||||||
class SendFileDialog extends StatefulWidget {
|
class SendFileDialog extends StatefulWidget {
|
||||||
final Room room;
|
final Room room;
|
||||||
final MatrixFile file;
|
final MatrixFile file;
|
||||||
final L10n l10n;
|
|
||||||
|
|
||||||
const SendFileDialog({
|
const SendFileDialog({
|
||||||
this.room,
|
this.room,
|
||||||
@required this.l10n,
|
|
||||||
this.file,
|
this.file,
|
||||||
Key key,
|
Key key,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
@ -40,13 +38,13 @@ class _SendFileDialogState extends State<SendFileDialog> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var sendStr = widget.l10n.sendFile;
|
var sendStr = L10n.of(context).sendFile;
|
||||||
if (widget.file is MatrixImageFile) {
|
if (widget.file is MatrixImageFile) {
|
||||||
sendStr = widget.l10n.sendImage;
|
sendStr = L10n.of(context).sendImage;
|
||||||
} else if (widget.file is MatrixAudioFile) {
|
} else if (widget.file is MatrixAudioFile) {
|
||||||
sendStr = widget.l10n.sendAudio;
|
sendStr = L10n.of(context).sendAudio;
|
||||||
} else if (widget.file is MatrixVideoFile) {
|
} else if (widget.file is MatrixVideoFile) {
|
||||||
sendStr = widget.l10n.sendVideo;
|
sendStr = L10n.of(context).sendVideo;
|
||||||
}
|
}
|
||||||
Widget contentWidget;
|
Widget contentWidget;
|
||||||
if (widget.file is MatrixImageFile) {
|
if (widget.file is MatrixImageFile) {
|
||||||
@ -66,8 +64,8 @@ class _SendFileDialogState extends State<SendFileDialog> {
|
|||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () => setState(() => origImage = !origImage),
|
onTap: () => setState(() => origImage = !origImage),
|
||||||
child: Text(
|
child: Text(L10n.of(context).sendOriginal +
|
||||||
widget.l10n.sendOriginal + ' (${widget.file.sizeString})'),
|
' (${widget.file.sizeString})'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@ -80,14 +78,14 @@ class _SendFileDialogState extends State<SendFileDialog> {
|
|||||||
content: contentWidget,
|
content: contentWidget,
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
FlatButton(
|
FlatButton(
|
||||||
child: Text(widget.l10n.cancel),
|
child: Text(L10n.of(context).cancel),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// just close the dialog
|
// just close the dialog
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context, rootNavigator: false).pop();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
FlatButton(
|
FlatButton(
|
||||||
child: Text(widget.l10n.send),
|
child: Text(L10n.of(context).send),
|
||||||
onPressed: _isSending
|
onPressed: _isSending
|
||||||
? null
|
? null
|
||||||
: () async {
|
: () async {
|
||||||
@ -96,7 +94,7 @@ class _SendFileDialogState extends State<SendFileDialog> {
|
|||||||
});
|
});
|
||||||
await showFutureLoadingDialog(
|
await showFutureLoadingDialog(
|
||||||
context: context, future: () => _send());
|
context: context, future: () => _send());
|
||||||
await Navigator.of(context).pop();
|
await Navigator.of(context, rootNavigator: false).pop();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -34,6 +34,7 @@ class _EncryptionButtonState extends State<EncryptionButton> {
|
|||||||
}
|
}
|
||||||
if (await showOkCancelAlertDialog(
|
if (await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
useRootNavigator: false,
|
||||||
title: L10n.of(context).enableEncryptionWarning,
|
title: L10n.of(context).enableEncryptionWarning,
|
||||||
message: widget.room.client.encryptionEnabled
|
message: widget.room.client.encryptionEnabled
|
||||||
? L10n.of(context).warningEncryptionInBeta
|
? L10n.of(context).warningEncryptionInBeta
|
||||||
|
@ -233,7 +233,7 @@ class _ImageBubbleState extends State<ImageBubble> {
|
|||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (!widget.tapToView) return;
|
if (!widget.tapToView) return;
|
||||||
Navigator.of(context).push(
|
Navigator.of(context, rootNavigator: false).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (_) => ImageView(widget.event, onLoaded: () {
|
builder: (_) => ImageView(widget.event, onLoaded: () {
|
||||||
// If the original file didn't load yet, we want to do that now.
|
// If the original file didn't load yet, we want to do that now.
|
||||||
|
@ -90,12 +90,13 @@ class ChatListItem extends StatelessWidget {
|
|||||||
if (Matrix.of(context).shareContent['msgtype'] ==
|
if (Matrix.of(context).shareContent['msgtype'] ==
|
||||||
'chat.fluffy.shared_file') {
|
'chat.fluffy.shared_file') {
|
||||||
await showDialog(
|
await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (c) => SendFileDialog(
|
builder: (c) => SendFileDialog(
|
||||||
file: Matrix.of(context).shareContent['file'],
|
file: Matrix.of(context).shareContent['file'],
|
||||||
room: room,
|
room: room,
|
||||||
l10n: L10n.of(context),
|
),
|
||||||
));
|
useRootNavigator: false,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
unawaited(room.sendEvent(Matrix.of(context).shareContent));
|
unawaited(room.sendEvent(Matrix.of(context).shareContent));
|
||||||
}
|
}
|
||||||
@ -124,6 +125,7 @@ class ChatListItem extends StatelessWidget {
|
|||||||
title: L10n.of(context).areYouSure,
|
title: L10n.of(context).areYouSure,
|
||||||
okLabel: L10n.of(context).yes,
|
okLabel: L10n.of(context).yes,
|
||||||
cancelLabel: L10n.of(context).no,
|
cancelLabel: L10n.of(context).no,
|
||||||
|
useRootNavigator: false,
|
||||||
);
|
);
|
||||||
if (confirmed == OkCancelResult.cancel) return;
|
if (confirmed == OkCancelResult.cancel) return;
|
||||||
await showFutureLoadingDialog(
|
await showFutureLoadingDialog(
|
||||||
|
@ -29,7 +29,6 @@ class ParticipantListItem extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (c) => UserBottomSheet(
|
builder: (c) => UserBottomSheet(
|
||||||
user: user,
|
user: user,
|
||||||
l10n: L10n.of(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
title: Row(
|
title: Row(
|
||||||
|
@ -137,6 +137,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||||||
title: L10n.of(context).pleaseEnterYourPassword,
|
title: L10n.of(context).pleaseEnterYourPassword,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
minLines: 1,
|
minLines: 1,
|
||||||
@ -164,6 +165,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||||||
await showOkCancelAlertDialog(
|
await showOkCancelAlertDialog(
|
||||||
message: L10n.of(context).pleaseFollowInstructionsOnWeb,
|
message: L10n.of(context).pleaseFollowInstructionsOnWeb,
|
||||||
context: context,
|
context: context,
|
||||||
|
useRootNavigator: false,
|
||||||
okLabel: L10n.of(context).next,
|
okLabel: L10n.of(context).next,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
)) {
|
)) {
|
||||||
@ -209,7 +211,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||||||
body: body,
|
body: body,
|
||||||
replacesID: _linuxNotificationIds[roomId] ?? -1,
|
replacesID: _linuxNotificationIds[roomId] ?? -1,
|
||||||
appName: AppConfig.applicationName,
|
appName: AppConfig.applicationName,
|
||||||
actionCallback: (_) => Navigator.of(context).pushAndRemoveUntil(
|
actionCallback: (_) => Navigator.of(context, rootNavigator: false).pushAndRemoveUntil(
|
||||||
AppRoute.defaultRoute(
|
AppRoute.defaultRoute(
|
||||||
context,
|
context,
|
||||||
ChatView(roomId),
|
ChatView(roomId),
|
||||||
@ -273,6 +275,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||||||
final sender = room.getUserByMXIDSync(request.sender);
|
final sender = room.getUserByMXIDSync(request.sender);
|
||||||
if (await showOkCancelAlertDialog(
|
if (await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
useRootNavigator: false,
|
||||||
title: L10n.of(context).requestToReadOlderMessages,
|
title: L10n.of(context).requestToReadOlderMessages,
|
||||||
message:
|
message:
|
||||||
'${sender.id}\n\n${L10n.of(context).device}:\n${request.requestingDevice.deviceId}\n\n${L10n.of(context).publicKey}:\n${request.requestingDevice.ed25519Key.beautified}',
|
'${sender.id}\n\n${L10n.of(context).device}:\n${request.requestingDevice.deviceId}\n\n${L10n.of(context).publicKey}:\n${request.requestingDevice.ed25519Key.beautified}',
|
||||||
@ -296,6 +299,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||||||
};
|
};
|
||||||
if (await showOkCancelAlertDialog(
|
if (await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
useRootNavigator: false,
|
||||||
title: L10n.of(context).newVerificationRequest,
|
title: L10n.of(context).newVerificationRequest,
|
||||||
message: L10n.of(context).askVerificationRequest(request.userId),
|
message: L10n.of(context).askVerificationRequest(request.userId),
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
@ -305,10 +309,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||||||
request.onUpdate = null;
|
request.onUpdate = null;
|
||||||
hidPopup = true;
|
hidPopup = true;
|
||||||
await request.acceptVerification();
|
await request.acceptVerification();
|
||||||
await KeyVerificationDialog(
|
await KeyVerificationDialog(request: request).show(context);
|
||||||
request: request,
|
|
||||||
l10n: L10n.of(context),
|
|
||||||
).show(context);
|
|
||||||
} else {
|
} else {
|
||||||
request.onUpdate = null;
|
request.onUpdate = null;
|
||||||
hidPopup = true;
|
hidPopup = true;
|
||||||
|
@ -52,10 +52,7 @@ class MessageContent extends StatelessWidget {
|
|||||||
timeline.cancelSubscriptions();
|
timeline.cancelSubscriptions();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
await KeyVerificationDialog(
|
await KeyVerificationDialog(request: req).show(context);
|
||||||
request: req,
|
|
||||||
l10n: L10n.of(context),
|
|
||||||
).show(context);
|
|
||||||
} else {
|
} else {
|
||||||
final success = await showFutureLoadingDialog(
|
final success = await showFutureLoadingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
@ -17,12 +17,10 @@ import 'dialogs/key_verification_dialog.dart';
|
|||||||
class UserBottomSheet extends StatelessWidget {
|
class UserBottomSheet extends StatelessWidget {
|
||||||
final User user;
|
final User user;
|
||||||
final Function onMention;
|
final Function onMention;
|
||||||
final L10n l10n;
|
|
||||||
|
|
||||||
const UserBottomSheet({
|
const UserBottomSheet({
|
||||||
Key key,
|
Key key,
|
||||||
@required this.user,
|
@required this.user,
|
||||||
@required this.l10n,
|
|
||||||
this.onMention,
|
this.onMention,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@ -30,14 +28,15 @@ class UserBottomSheet extends StatelessWidget {
|
|||||||
final Function _askConfirmation =
|
final Function _askConfirmation =
|
||||||
() async => (await showOkCancelAlertDialog(
|
() async => (await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
title: l10n.areYouSure,
|
useRootNavigator: false,
|
||||||
okLabel: l10n.yes,
|
title: L10n.of(context).areYouSure,
|
||||||
cancelLabel: l10n.no,
|
okLabel: L10n.of(context).yes,
|
||||||
|
cancelLabel: L10n.of(context).no,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.ok);
|
OkCancelResult.ok);
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'mention':
|
case 'mention':
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context, rootNavigator: false).pop();
|
||||||
onMention();
|
onMention();
|
||||||
break;
|
break;
|
||||||
case 'ban':
|
case 'ban':
|
||||||
@ -46,7 +45,7 @@ class UserBottomSheet extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
future: () => user.ban(),
|
future: () => user.ban(),
|
||||||
);
|
);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context, rootNavigator: false).pop();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'unban':
|
case 'unban':
|
||||||
@ -55,7 +54,7 @@ class UserBottomSheet extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
future: () => user.unban(),
|
future: () => user.unban(),
|
||||||
);
|
);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context, rootNavigator: false).pop();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'kick':
|
case 'kick':
|
||||||
@ -64,21 +63,20 @@ class UserBottomSheet extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
future: () => user.kick(),
|
future: () => user.kick(),
|
||||||
);
|
);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context, rootNavigator: false).pop();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'permission':
|
case 'permission':
|
||||||
final newPermission = await PermissionSliderDialog(
|
final newPermission =
|
||||||
initialPermission: user.powerLevel,
|
await PermissionSliderDialog(initialPermission: user.powerLevel)
|
||||||
l10n: L10n.of(context),
|
.show(context);
|
||||||
).show(context);
|
|
||||||
if (newPermission != null) {
|
if (newPermission != null) {
|
||||||
if (newPermission == 100 && await _askConfirmation() == false) break;
|
if (newPermission == 100 && await _askConfirmation() == false) break;
|
||||||
await showFutureLoadingDialog(
|
await showFutureLoadingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
future: () => user.setPower(newPermission),
|
future: () => user.setPower(newPermission),
|
||||||
);
|
);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context, rootNavigator: false).pop();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'message':
|
case 'message':
|
||||||
@ -92,10 +90,7 @@ class UserBottomSheet extends StatelessWidget {
|
|||||||
void _verifyAction(BuildContext context) async {
|
void _verifyAction(BuildContext context) async {
|
||||||
final client = user.room.client;
|
final client = user.room.client;
|
||||||
final req = await client.userDeviceKeys[user.id].startVerification();
|
final req = await client.userDeviceKeys[user.id].startVerification();
|
||||||
await KeyVerificationDialog(
|
await KeyVerificationDialog(request: req).show(context);
|
||||||
request: req,
|
|
||||||
l10n: L10n.of(context),
|
|
||||||
).show(context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -109,7 +104,7 @@ class UserBottomSheet extends StatelessWidget {
|
|||||||
items.add(
|
items.add(
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
child: _TextWithIcon(
|
child: _TextWithIcon(
|
||||||
l10n.mention,
|
L10n.of(context).mention,
|
||||||
Icons.alternate_email_outlined,
|
Icons.alternate_email_outlined,
|
||||||
),
|
),
|
||||||
value: 'mention'),
|
value: 'mention'),
|
||||||
@ -119,7 +114,7 @@ class UserBottomSheet extends StatelessWidget {
|
|||||||
items.add(
|
items.add(
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
child: _TextWithIcon(
|
child: _TextWithIcon(
|
||||||
l10n.sendAMessage,
|
L10n.of(context).sendAMessage,
|
||||||
Icons.send_outlined,
|
Icons.send_outlined,
|
||||||
),
|
),
|
||||||
value: 'message'),
|
value: 'message'),
|
||||||
@ -129,7 +124,7 @@ class UserBottomSheet extends StatelessWidget {
|
|||||||
items.add(
|
items.add(
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
child: _TextWithIcon(
|
child: _TextWithIcon(
|
||||||
l10n.setPermissionsLevel,
|
L10n.of(context).setPermissionsLevel,
|
||||||
Icons.edit_attributes_outlined,
|
Icons.edit_attributes_outlined,
|
||||||
),
|
),
|
||||||
value: 'permission'),
|
value: 'permission'),
|
||||||
@ -139,7 +134,7 @@ class UserBottomSheet extends StatelessWidget {
|
|||||||
items.add(
|
items.add(
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
child: _TextWithIcon(
|
child: _TextWithIcon(
|
||||||
l10n.kickFromChat,
|
L10n.of(context).kickFromChat,
|
||||||
Icons.exit_to_app_outlined,
|
Icons.exit_to_app_outlined,
|
||||||
),
|
),
|
||||||
value: 'kick'),
|
value: 'kick'),
|
||||||
@ -149,7 +144,7 @@ class UserBottomSheet extends StatelessWidget {
|
|||||||
items.add(
|
items.add(
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
child: _TextWithIcon(
|
child: _TextWithIcon(
|
||||||
l10n.banFromChat,
|
L10n.of(context).banFromChat,
|
||||||
Icons.warning_sharp,
|
Icons.warning_sharp,
|
||||||
),
|
),
|
||||||
value: 'ban'),
|
value: 'ban'),
|
||||||
@ -158,7 +153,7 @@ class UserBottomSheet extends StatelessWidget {
|
|||||||
items.add(
|
items.add(
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
child: _TextWithIcon(
|
child: _TextWithIcon(
|
||||||
l10n.removeExile,
|
L10n.of(context).removeExile,
|
||||||
Icons.warning_outlined,
|
Icons.warning_outlined,
|
||||||
),
|
),
|
||||||
value: 'unban'),
|
value: 'unban'),
|
||||||
@ -179,7 +174,7 @@ class UserBottomSheet extends StatelessWidget {
|
|||||||
Theme.of(context).scaffoldBackgroundColor.withOpacity(0.5),
|
Theme.of(context).scaffoldBackgroundColor.withOpacity(0.5),
|
||||||
leading: IconButton(
|
leading: IconButton(
|
||||||
icon: Icon(Icons.arrow_downward_outlined),
|
icon: Icon(Icons.arrow_downward_outlined),
|
||||||
onPressed: Navigator.of(context).pop,
|
onPressed: Navigator.of(context, rootNavigator: false).pop,
|
||||||
tooltip: L10n.of(context).close,
|
tooltip: L10n.of(context).close,
|
||||||
),
|
),
|
||||||
title: Text(user.calcDisplayname()),
|
title: Text(user.calcDisplayname()),
|
||||||
@ -224,7 +219,7 @@ class UserBottomSheet extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(l10n.username),
|
title: Text(L10n.of(context).username),
|
||||||
subtitle: Text(user.id),
|
subtitle: Text(user.id),
|
||||||
trailing: Icon(Icons.share_outlined),
|
trailing: Icon(Icons.share_outlined),
|
||||||
onTap: () => FluffyShare.share(user.id, context),
|
onTap: () => FluffyShare.share(user.id, context),
|
||||||
|
@ -10,7 +10,7 @@ extension LocalizedBody on Event {
|
|||||||
void openFile(BuildContext context, {bool downloadOnly = false}) async {
|
void openFile(BuildContext context, {bool downloadOnly = false}) async {
|
||||||
if (!downloadOnly &&
|
if (!downloadOnly &&
|
||||||
[MessageTypes.Image, MessageTypes.Sticker].contains(messageType)) {
|
[MessageTypes.Image, MessageTypes.Sticker].contains(messageType)) {
|
||||||
await Navigator.of(context).push(
|
await Navigator.of(context, rootNavigator: false).push(
|
||||||
MaterialPageRoute(builder: (_) => ImageView(this)),
|
MaterialPageRoute(builder: (_) => ImageView(this)),
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
|
@ -43,6 +43,7 @@ abstract class PlatformInfos {
|
|||||||
var version = await PlatformInfos.getVersion();
|
var version = await PlatformInfos.getVersion();
|
||||||
showAboutDialog(
|
showAboutDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
useRootNavigator: false,
|
||||||
children: [
|
children: [
|
||||||
Text('Version: $version'),
|
Text('Version: $version'),
|
||||||
RaisedButton(
|
RaisedButton(
|
||||||
|
@ -73,6 +73,7 @@ class UrlLauncher {
|
|||||||
if (await showOkCancelAlertDialog(
|
if (await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
title: 'Join room $roomIdOrAlias',
|
title: 'Join room $roomIdOrAlias',
|
||||||
|
useRootNavigator: false,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.ok) {
|
OkCancelResult.ok) {
|
||||||
roomId = roomIdOrAlias;
|
roomId = roomIdOrAlias;
|
||||||
@ -116,6 +117,7 @@ class UrlLauncher {
|
|||||||
if (await showOkCancelAlertDialog(
|
if (await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
title: 'Message user ${user.id}',
|
title: 'Message user ${user.id}',
|
||||||
|
useRootNavigator: false,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.ok) {
|
OkCancelResult.ok) {
|
||||||
roomId = (await showFutureLoadingDialog(
|
roomId = (await showFutureLoadingDialog(
|
||||||
|
@ -211,13 +211,13 @@ class _ChatState 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(),
|
||||||
name: result.fileName,
|
name: result.fileName,
|
||||||
).detectFileType,
|
).detectFileType,
|
||||||
room: room,
|
room: room,
|
||||||
l10n: L10n.of(context),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -228,13 +228,13 @@ class _ChatState 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(),
|
||||||
name: result.fileName,
|
name: result.fileName,
|
||||||
),
|
),
|
||||||
room: room,
|
room: room,
|
||||||
l10n: L10n.of(context),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -245,13 +245,13 @@ class _ChatState 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,
|
||||||
name: file.path,
|
name: file.path,
|
||||||
),
|
),
|
||||||
room: room,
|
room: room,
|
||||||
l10n: L10n.of(context),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -263,9 +263,8 @@ class _ChatState extends State<Chat> {
|
|||||||
}
|
}
|
||||||
final result = await showDialog<String>(
|
final result = await showDialog<String>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (c) => RecordingDialog(
|
builder: (c) => RecordingDialog(),
|
||||||
l10n: L10n.of(context),
|
useRootNavigator: false,
|
||||||
),
|
|
||||||
);
|
);
|
||||||
if (result == null) return;
|
if (result == null) return;
|
||||||
final audioFile = File(result);
|
final audioFile = File(result);
|
||||||
@ -306,6 +305,7 @@ class _ChatState extends State<Chat> {
|
|||||||
final score = await showConfirmationDialog<int>(
|
final score = await showConfirmationDialog<int>(
|
||||||
context: context,
|
context: context,
|
||||||
title: L10n.of(context).howOffensiveIsThisContent,
|
title: L10n.of(context).howOffensiveIsThisContent,
|
||||||
|
useRootNavigator: false,
|
||||||
actions: [
|
actions: [
|
||||||
AlertDialogAction(
|
AlertDialogAction(
|
||||||
key: -100,
|
key: -100,
|
||||||
@ -326,6 +326,7 @@ class _ChatState extends State<Chat> {
|
|||||||
title: L10n.of(context).whyDoYouWantToReportThis,
|
title: L10n.of(context).whyDoYouWantToReportThis,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [DialogTextField(hintText: L10n.of(context).reason)]);
|
textFields: [DialogTextField(hintText: L10n.of(context).reason)]);
|
||||||
if (reason == null || reason.single.isEmpty) return;
|
if (reason == null || reason.single.isEmpty) return;
|
||||||
final result = await showFutureLoadingDialog(
|
final result = await showFutureLoadingDialog(
|
||||||
@ -350,6 +351,7 @@ class _ChatState extends State<Chat> {
|
|||||||
title: L10n.of(context).messageWillBeRemovedWarning,
|
title: L10n.of(context).messageWillBeRemovedWarning,
|
||||||
okLabel: L10n.of(context).remove,
|
okLabel: L10n.of(context).remove,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.ok;
|
OkCancelResult.ok;
|
||||||
if (!confirmed) return;
|
if (!confirmed) return;
|
||||||
@ -473,7 +475,7 @@ class _ChatState extends State<Chat> {
|
|||||||
// make sure we remove duplicates
|
// make sure we remove duplicates
|
||||||
prefs.setStringList('recents', recents.toSet().toList());
|
prefs.setStringList('recents', recents.toSet().toList());
|
||||||
});
|
});
|
||||||
Navigator.of(context).pop<Emoji>(emoji);
|
Navigator.of(context, rootNavigator: false).pop<Emoji>(emoji);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -538,7 +540,6 @@ class _ChatState extends State<Chat> {
|
|||||||
? () => showModalBottomSheet(
|
? () => showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (c) => UserBottomSheet(
|
builder: (c) => UserBottomSheet(
|
||||||
l10n: L10n.of(context),
|
|
||||||
user: room.getUserByMXIDSync(
|
user: room.getUserByMXIDSync(
|
||||||
room.directChatMatrixID),
|
room.directChatMatrixID),
|
||||||
onMention: () => sendController.text +=
|
onMention: () => sendController.text +=
|
||||||
@ -823,7 +824,6 @@ class _ChatState extends State<Chat> {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (c) =>
|
builder: (c) =>
|
||||||
UserBottomSheet(
|
UserBottomSheet(
|
||||||
l10n: L10n.of(context),
|
|
||||||
user: event.sender,
|
user: event.sender,
|
||||||
onMention: () =>
|
onMention: () =>
|
||||||
sendController.text +=
|
sendController.text +=
|
||||||
|
@ -39,6 +39,7 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||||||
title: L10n.of(context).changeTheNameOfTheGroup,
|
title: L10n.of(context).changeTheNameOfTheGroup,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
initialText: room.getLocalizedDisplayname(
|
initialText: room.getLocalizedDisplayname(
|
||||||
@ -67,6 +68,7 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||||||
title: L10n.of(context).setInvitationLink,
|
title: L10n.of(context).setInvitationLink,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
hintText: '#localpart:domain',
|
hintText: '#localpart:domain',
|
||||||
@ -109,6 +111,7 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||||||
title: L10n.of(context).setGroupDescription,
|
title: L10n.of(context).setGroupDescription,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
hintText: L10n.of(context).setGroupDescription,
|
hintText: L10n.of(context).setGroupDescription,
|
||||||
|
@ -35,10 +35,7 @@ class _ChatEncryptionSettingsState extends State<ChatEncryptionSettings> {
|
|||||||
setState(() => null);
|
setState(() => null);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
await KeyVerificationDialog(
|
await KeyVerificationDialog(request: req).show(context);
|
||||||
request: req,
|
|
||||||
l10n: L10n.of(context),
|
|
||||||
).show(context);
|
|
||||||
break;
|
break;
|
||||||
case 'verify_user':
|
case 'verify_user':
|
||||||
await unblock();
|
await unblock();
|
||||||
@ -49,10 +46,7 @@ class _ChatEncryptionSettingsState extends State<ChatEncryptionSettings> {
|
|||||||
setState(() => null);
|
setState(() => null);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
await KeyVerificationDialog(
|
await KeyVerificationDialog(request: req).show(context);
|
||||||
request: req,
|
|
||||||
l10n: L10n.of(context),
|
|
||||||
).show(context);
|
|
||||||
break;
|
break;
|
||||||
case 'block':
|
case 'block':
|
||||||
if (key.directVerified) {
|
if (key.directVerified) {
|
||||||
|
@ -143,6 +143,7 @@ class _ChatListState extends State<ChatList> {
|
|||||||
title: L10n.of(context).areYouSure,
|
title: L10n.of(context).areYouSure,
|
||||||
okLabel: L10n.of(context).yes,
|
okLabel: L10n.of(context).yes,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.ok;
|
OkCancelResult.ok;
|
||||||
if (!confirmed) return;
|
if (!confirmed) return;
|
||||||
|
@ -20,10 +20,9 @@ class ChatPermissionsSettings extends StatelessWidget {
|
|||||||
return FlushbarHelper.createError(message: L10n.of(context).noPermission)
|
return FlushbarHelper.createError(message: L10n.of(context).noPermission)
|
||||||
.show(context);
|
.show(context);
|
||||||
}
|
}
|
||||||
final newLevel = await PermissionSliderDialog(
|
final newLevel =
|
||||||
initialPermission: currentLevel,
|
await PermissionSliderDialog(initialPermission: currentLevel)
|
||||||
l10n: L10n.of(context),
|
.show(context);
|
||||||
).show(context);
|
|
||||||
if (newLevel == null) return;
|
if (newLevel == null) return;
|
||||||
final content = Map<String, dynamic>.from(
|
final content = Map<String, dynamic>.from(
|
||||||
room.getState(EventTypes.RoomPowerLevels).content);
|
room.getState(EventTypes.RoomPowerLevels).content);
|
||||||
|
@ -43,6 +43,7 @@ class _ContactsState extends State<Contacts> {
|
|||||||
title: L10n.of(context).setStatus,
|
title: L10n.of(context).setStatus,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
hintText: L10n.of(context).statusExampleMessage,
|
hintText: L10n.of(context).statusExampleMessage,
|
||||||
|
@ -66,6 +66,7 @@ class _DiscoverState extends State<Discover> {
|
|||||||
title: '${room.name} (${room.numJoinedMembers ?? 0})',
|
title: '${room.name} (${room.numJoinedMembers ?? 0})',
|
||||||
message: room.topic ?? L10n.of(context).noDescription,
|
message: room.topic ?? L10n.of(context).noDescription,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.cancel) {
|
OkCancelResult.cancel) {
|
||||||
return;
|
return;
|
||||||
@ -92,6 +93,7 @@ class _DiscoverState extends State<Discover> {
|
|||||||
context: context,
|
context: context,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
prefixText: 'https://',
|
prefixText: 'https://',
|
||||||
|
@ -29,7 +29,7 @@ class ImageView extends StatelessWidget {
|
|||||||
elevation: 0,
|
elevation: 0,
|
||||||
leading: IconButton(
|
leading: IconButton(
|
||||||
icon: Icon(Icons.close),
|
icon: Icon(Icons.close),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context, rootNavigator: false).pop(),
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
tooltip: L10n.of(context).close,
|
tooltip: L10n.of(context).close,
|
||||||
),
|
),
|
||||||
@ -67,7 +67,7 @@ class ImageView extends StatelessWidget {
|
|||||||
onInteractionEnd: (ScaleEndDetails endDetails) {
|
onInteractionEnd: (ScaleEndDetails endDetails) {
|
||||||
if (PlatformInfos.usesTouchscreen == false) {
|
if (PlatformInfos.usesTouchscreen == false) {
|
||||||
if (endDetails.velocity.pixelsPerSecond.dy > calcVelocity) {
|
if (endDetails.velocity.pixelsPerSecond.dy > calcVelocity) {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context, rootNavigator: false).pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -96,6 +96,7 @@ class _LoginState extends State<Login> {
|
|||||||
title: L10n.of(context).enterAnEmailAddress,
|
title: L10n.of(context).enterAnEmailAddress,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
hintText: L10n.of(context).enterAnEmailAddress,
|
hintText: L10n.of(context).enterAnEmailAddress,
|
||||||
@ -119,6 +120,7 @@ class _LoginState extends State<Login> {
|
|||||||
title: L10n.of(context).weSentYouAnEmail,
|
title: L10n.of(context).weSentYouAnEmail,
|
||||||
message: L10n.of(context).pleaseClickOnLink,
|
message: L10n.of(context).pleaseClickOnLink,
|
||||||
okLabel: L10n.of(context).iHaveClickedOnLink,
|
okLabel: L10n.of(context).iHaveClickedOnLink,
|
||||||
|
useRootNavigator: false,
|
||||||
);
|
);
|
||||||
if (ok == null) return;
|
if (ok == null) return;
|
||||||
final password = await showTextInputDialog(
|
final password = await showTextInputDialog(
|
||||||
@ -126,6 +128,7 @@ class _LoginState extends State<Login> {
|
|||||||
title: L10n.of(context).chooseAStrongPassword,
|
title: L10n.of(context).chooseAStrongPassword,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
hintText: '******',
|
hintText: '******',
|
||||||
|
@ -47,6 +47,7 @@ class _SettingsState extends State<Settings> {
|
|||||||
title: L10n.of(context).areYouSureYouWantToLogout,
|
title: L10n.of(context).areYouSureYouWantToLogout,
|
||||||
okLabel: L10n.of(context).yes,
|
okLabel: L10n.of(context).yes,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.cancel) {
|
OkCancelResult.cancel) {
|
||||||
return;
|
return;
|
||||||
@ -64,6 +65,7 @@ class _SettingsState extends State<Settings> {
|
|||||||
title: L10n.of(context).changePassword,
|
title: L10n.of(context).changePassword,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
hintText: L10n.of(context).pleaseEnterYourPassword,
|
hintText: L10n.of(context).pleaseEnterYourPassword,
|
||||||
@ -98,6 +100,7 @@ class _SettingsState extends State<Settings> {
|
|||||||
message: L10n.of(context).deactivateAccountWarning,
|
message: L10n.of(context).deactivateAccountWarning,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.cancel) {
|
OkCancelResult.cancel) {
|
||||||
return;
|
return;
|
||||||
@ -107,6 +110,7 @@ class _SettingsState extends State<Settings> {
|
|||||||
title: L10n.of(context).areYouSure,
|
title: L10n.of(context).areYouSure,
|
||||||
okLabel: L10n.of(context).yes,
|
okLabel: L10n.of(context).yes,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.cancel) {
|
OkCancelResult.cancel) {
|
||||||
return;
|
return;
|
||||||
@ -116,6 +120,7 @@ class _SettingsState extends State<Settings> {
|
|||||||
title: L10n.of(context).pleaseEnterYourPassword,
|
title: L10n.of(context).pleaseEnterYourPassword,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
obscureText: true,
|
obscureText: true,
|
||||||
@ -146,6 +151,7 @@ class _SettingsState extends State<Settings> {
|
|||||||
title: L10n.of(context).editJitsiInstance,
|
title: L10n.of(context).editJitsiInstance,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
initialText: AppConfig.jitsiInstance.replaceFirst(prefix, ''),
|
initialText: AppConfig.jitsiInstance.replaceFirst(prefix, ''),
|
||||||
@ -169,6 +175,7 @@ class _SettingsState extends State<Settings> {
|
|||||||
title: L10n.of(context).editDisplayname,
|
title: L10n.of(context).editDisplayname,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
initialText: profile?.displayname ??
|
initialText: profile?.displayname ??
|
||||||
@ -233,6 +240,7 @@ class _SettingsState extends State<Settings> {
|
|||||||
title: L10n.of(context).askSSSSCache,
|
title: L10n.of(context).askSSSSCache,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
hintText: L10n.of(context).passphraseOrKey,
|
hintText: L10n.of(context).passphraseOrKey,
|
||||||
@ -263,6 +271,8 @@ class _SettingsState extends State<Settings> {
|
|||||||
await showOkAlertDialog(
|
await showOkAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
message: L10n.of(context).cachedKeys,
|
message: L10n.of(context).cachedKeys,
|
||||||
|
okLabel: L10n.of(context).ok,
|
||||||
|
useRootNavigator: false,
|
||||||
);
|
);
|
||||||
setState(() {
|
setState(() {
|
||||||
crossSigningCachedFuture = null;
|
crossSigningCachedFuture = null;
|
||||||
@ -274,6 +284,8 @@ class _SettingsState extends State<Settings> {
|
|||||||
await showOkAlertDialog(
|
await showOkAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
message: L10n.of(context).incorrectPassphraseOrKey,
|
message: L10n.of(context).incorrectPassphraseOrKey,
|
||||||
|
okLabel: L10n.of(context).ok,
|
||||||
|
useRootNavigator: false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -297,6 +309,7 @@ class _SettingsState extends State<Settings> {
|
|||||||
title: L10n.of(context).pleaseChooseAPasscode,
|
title: L10n.of(context).pleaseChooseAPasscode,
|
||||||
message: L10n.of(context).pleaseEnter4Digits,
|
message: L10n.of(context).pleaseEnter4Digits,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
validator: (text) {
|
validator: (text) {
|
||||||
@ -516,6 +529,8 @@ class _SettingsState extends State<Settings> {
|
|||||||
context: context,
|
context: context,
|
||||||
title: L10n.of(context).yourPublicKey,
|
title: L10n.of(context).yourPublicKey,
|
||||||
message: client.fingerprintKey.beautified,
|
message: client.fingerprintKey.beautified,
|
||||||
|
okLabel: L10n.of(context).ok,
|
||||||
|
useRootNavigator: false,
|
||||||
),
|
),
|
||||||
trailing: Icon(Icons.vpn_key_outlined),
|
trailing: Icon(Icons.vpn_key_outlined),
|
||||||
),
|
),
|
||||||
@ -534,19 +549,13 @@ class _SettingsState extends State<Settings> {
|
|||||||
isDestructiveAction: true,
|
isDestructiveAction: true,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
)) {
|
)) {
|
||||||
await BootstrapDialog(
|
await BootstrapDialog(wipe: true).show(context);
|
||||||
l10n: L10n.of(context),
|
|
||||||
client: Matrix.of(context).client,
|
|
||||||
wipe: true,
|
|
||||||
).show(context);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await BootstrapDialog(
|
await BootstrapDialog().show(context);
|
||||||
l10n: L10n.of(context),
|
|
||||||
client: Matrix.of(context).client,
|
|
||||||
).show(context);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
@ -19,6 +19,7 @@ class _Settings3PidState extends State<Settings3Pid> {
|
|||||||
title: L10n.of(context).enterAnEmailAddress,
|
title: L10n.of(context).enterAnEmailAddress,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
hintText: L10n.of(context).enterAnEmailAddress,
|
hintText: L10n.of(context).enterAnEmailAddress,
|
||||||
@ -42,6 +43,7 @@ class _Settings3PidState extends State<Settings3Pid> {
|
|||||||
title: L10n.of(context).weSentYouAnEmail,
|
title: L10n.of(context).weSentYouAnEmail,
|
||||||
message: L10n.of(context).pleaseClickOnLink,
|
message: L10n.of(context).pleaseClickOnLink,
|
||||||
okLabel: L10n.of(context).iHaveClickedOnLink,
|
okLabel: L10n.of(context).iHaveClickedOnLink,
|
||||||
|
useRootNavigator: false,
|
||||||
);
|
);
|
||||||
if (ok == null) return;
|
if (ok == null) return;
|
||||||
final password = await showTextInputDialog(
|
final password = await showTextInputDialog(
|
||||||
@ -49,6 +51,7 @@ class _Settings3PidState extends State<Settings3Pid> {
|
|||||||
title: L10n.of(context).pleaseEnterYourPassword,
|
title: L10n.of(context).pleaseEnterYourPassword,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
hintText: '******',
|
hintText: '******',
|
||||||
@ -82,6 +85,7 @@ class _Settings3PidState extends State<Settings3Pid> {
|
|||||||
title: L10n.of(context).areYouSure,
|
title: L10n.of(context).areYouSure,
|
||||||
okLabel: L10n.of(context).yes,
|
okLabel: L10n.of(context).yes,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
) !=
|
) !=
|
||||||
OkCancelResult.ok) {
|
OkCancelResult.ok) {
|
||||||
return;
|
return;
|
||||||
|
@ -34,6 +34,7 @@ class DevicesSettingsState extends State<DevicesSettings> {
|
|||||||
title: L10n.of(context).areYouSure,
|
title: L10n.of(context).areYouSure,
|
||||||
okLabel: L10n.of(context).yes,
|
okLabel: L10n.of(context).yes,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.cancel) return;
|
OkCancelResult.cancel) return;
|
||||||
var matrix = Matrix.of(context);
|
var matrix = Matrix.of(context);
|
||||||
@ -68,6 +69,7 @@ class DevicesSettingsState extends State<DevicesSettings> {
|
|||||||
title: L10n.of(context).changeDeviceName,
|
title: L10n.of(context).changeDeviceName,
|
||||||
okLabel: L10n.of(context).ok,
|
okLabel: L10n.of(context).ok,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
textFields: [
|
textFields: [
|
||||||
DialogTextField(
|
DialogTextField(
|
||||||
hintText: device.displayName,
|
hintText: device.displayName,
|
||||||
@ -98,10 +100,7 @@ class DevicesSettingsState extends State<DevicesSettings> {
|
|||||||
setState(() => null);
|
setState(() => null);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
await KeyVerificationDialog(
|
await KeyVerificationDialog(request: req).show(context);
|
||||||
request: req,
|
|
||||||
l10n: L10n.of(context),
|
|
||||||
).show(context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _blockDeviceAction(BuildContext context, Device device) async {
|
void _blockDeviceAction(BuildContext context, Device device) async {
|
||||||
|
@ -233,8 +233,11 @@ class _EmotesSettingsState extends State<EmotesSettings> {
|
|||||||
newMxcController.text == null ||
|
newMxcController.text == null ||
|
||||||
newMxcController.text.isEmpty) {
|
newMxcController.text.isEmpty) {
|
||||||
await showOkAlertDialog(
|
await showOkAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
message: L10n.of(context).emoteWarnNeedToPick);
|
message: L10n.of(context).emoteWarnNeedToPick,
|
||||||
|
okLabel: L10n.of(context).ok,
|
||||||
|
useRootNavigator: false,
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final emoteCode = ':${newEmoteController.text}:';
|
final emoteCode = ':${newEmoteController.text}:';
|
||||||
@ -243,14 +246,20 @@ class _EmotesSettingsState extends State<EmotesSettings> {
|
|||||||
e.emote == emoteCode && e.mxc != mxc) !=
|
e.emote == emoteCode && e.mxc != mxc) !=
|
||||||
-1) {
|
-1) {
|
||||||
await showOkAlertDialog(
|
await showOkAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
message: L10n.of(context).emoteExists);
|
message: L10n.of(context).emoteExists,
|
||||||
|
okLabel: L10n.of(context).ok,
|
||||||
|
useRootNavigator: false,
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!RegExp(r'^:[-\w]+:$').hasMatch(emoteCode)) {
|
if (!RegExp(r'^:[-\w]+:$').hasMatch(emoteCode)) {
|
||||||
await showOkAlertDialog(
|
await showOkAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
message: L10n.of(context).emoteInvalid);
|
message: L10n.of(context).emoteInvalid,
|
||||||
|
okLabel: L10n.of(context).ok,
|
||||||
|
useRootNavigator: false,
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
emotes.add(_EmoteEntry(emote: emoteCode, mxc: mxc));
|
emotes.add(_EmoteEntry(emote: emoteCode, mxc: mxc));
|
||||||
@ -344,18 +353,22 @@ class _EmotesSettingsState extends State<EmotesSettings> {
|
|||||||
-1) {
|
-1) {
|
||||||
controller.text = emote.emoteClean;
|
controller.text = emote.emoteClean;
|
||||||
showOkAlertDialog(
|
showOkAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
message:
|
message: L10n.of(context).emoteExists,
|
||||||
L10n.of(context).emoteExists);
|
okLabel: L10n.of(context).ok,
|
||||||
|
useRootNavigator: false,
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!RegExp(r'^:[-\w]+:$')
|
if (!RegExp(r'^:[-\w]+:$')
|
||||||
.hasMatch(emoteCode)) {
|
.hasMatch(emoteCode)) {
|
||||||
controller.text = emote.emoteClean;
|
controller.text = emote.emoteClean;
|
||||||
showOkAlertDialog(
|
showOkAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
message:
|
message: L10n.of(context).emoteInvalid,
|
||||||
L10n.of(context).emoteInvalid);
|
okLabel: L10n.of(context).ok,
|
||||||
|
useRootNavigator: false,
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setState(() {
|
setState(() {
|
||||||
|
@ -88,6 +88,7 @@ class _SignUpPasswordState extends State<SignUpPassword> {
|
|||||||
context: context,
|
context: context,
|
||||||
okLabel: L10n.of(context).next,
|
okLabel: L10n.of(context).next,
|
||||||
cancelLabel: L10n.of(context).cancel,
|
cancelLabel: L10n.of(context).cancel,
|
||||||
|
useRootNavigator: false,
|
||||||
)) {
|
)) {
|
||||||
_signUpAction(
|
_signUpAction(
|
||||||
context,
|
context,
|
||||||
|
Loading…
Reference in New Issue
Block a user