refactor: Use non nullable localizations builder and lazy load on web

This commit is contained in:
krille-chan 2024-10-06 08:35:37 +02:00
parent 8cedd2a45a
commit 0d4b7d67cc
No known key found for this signature in database
111 changed files with 879 additions and 883 deletions

View file

@ -3,3 +3,5 @@ template-arb-file: intl_en.arb
output-localization-file: l10n.dart
output-class: L10n
preferred-supported-locales: ["en"]
use-deferred-loading: true
nullable-getter: false

View file

@ -42,10 +42,10 @@ class ArchiveController extends State<Archive> {
if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.yes,
cancelLabel: L10n.of(context)!.cancel,
message: L10n.of(context)!.clearArchive,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).cancel,
message: L10n.of(context).clearArchive,
) !=
OkCancelResult.ok) {
return;

View file

@ -20,14 +20,14 @@ class ArchiveView extends StatelessWidget {
builder: (BuildContext context, snapshot) => Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
title: Text(L10n.of(context)!.archive),
title: Text(L10n.of(context).archive),
actions: [
if (snapshot.data?.isNotEmpty ?? false)
Padding(
padding: const EdgeInsets.all(8.0),
child: TextButton.icon(
onPressed: controller.forgetAllAction,
label: Text(L10n.of(context)!.clearArchive),
label: Text(L10n.of(context).clearArchive),
icon: const Icon(Icons.cleaning_services_outlined),
),
),
@ -40,7 +40,7 @@ class ArchiveView extends StatelessWidget {
if (snapshot.hasError) {
return Center(
child: Text(
L10n.of(context)!.oopsSomethingWentWrong,
L10n.of(context).oopsSomethingWentWrong,
textAlign: TextAlign.center,
),
);

View file

@ -61,12 +61,12 @@ class BootstrapDialogState extends State<BootstrapDialog> {
String _getSecureStorageLocalizedName() {
if (PlatformInfos.isAndroid) {
return L10n.of(context)!.storeInAndroidKeystore;
return L10n.of(context).storeInAndroidKeystore;
}
if (PlatformInfos.isIOS || PlatformInfos.isMacOS) {
return L10n.of(context)!.storeInAppleKeyChain;
return L10n.of(context).storeInAppleKeyChain;
}
return L10n.of(context)!.storeSecurlyOnThisDevice;
return L10n.of(context).storeSecurlyOnThisDevice;
}
@override
@ -92,12 +92,12 @@ class BootstrapDialogState extends State<BootstrapDialog> {
_wipe ??= widget.wipe;
final buttons = <Widget>[];
Widget body = const CircularProgressIndicator.adaptive();
titleText = L10n.of(context)!.loadingPleaseWait;
titleText = L10n.of(context).loadingPleaseWait;
if (bootstrap.newSsssKey?.recoveryKey != null &&
_recoveryKeyStored == false) {
final key = bootstrap.newSsssKey!.recoveryKey;
titleText = L10n.of(context)!.recoveryKey;
titleText = L10n.of(context).recoveryKey;
return Scaffold(
appBar: AppBar(
centerTitle: true,
@ -105,7 +105,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
icon: const Icon(Icons.close),
onPressed: Navigator.of(context).pop,
),
title: Text(L10n.of(context)!.recoveryKey),
title: Text(L10n.of(context).recoveryKey),
),
body: Center(
child: ConstrainedBox(
@ -123,7 +123,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
color: theme.colorScheme.primary,
),
),
subtitle: Text(L10n.of(context)!.chatBackupDescription),
subtitle: Text(L10n.of(context).chatBackupDescription),
),
const Divider(
height: 32,
@ -153,7 +153,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
},
title: Text(_getSecureStorageLocalizedName()),
subtitle:
Text(L10n.of(context)!.storeInSecureStorageDescription),
Text(L10n.of(context).storeInSecureStorageDescription),
),
const SizedBox(height: 16),
CheckboxListTile.adaptive(
@ -164,13 +164,13 @@ class BootstrapDialogState extends State<BootstrapDialog> {
FluffyShare.share(key!, context);
setState(() => _recoveryKeyCopied = true);
},
title: Text(L10n.of(context)!.copyToClipboard),
subtitle: Text(L10n.of(context)!.saveKeyManuallyDescription),
title: Text(L10n.of(context).copyToClipboard),
subtitle: Text(L10n.of(context).saveKeyManuallyDescription),
),
const SizedBox(height: 16),
ElevatedButton.icon(
icon: const Icon(Icons.check_outlined),
label: Text(L10n.of(context)!.next),
label: Text(L10n.of(context).next),
onPressed:
(_recoveryKeyCopied || _storeInSecureStorage == true)
? () {
@ -227,7 +227,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
icon: const Icon(Icons.close),
onPressed: Navigator.of(context).pop,
),
title: Text(L10n.of(context)!.chatBackup),
title: Text(L10n.of(context).chatBackup),
),
body: Center(
child: ConstrainedBox(
@ -245,7 +245,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
color: theme.colorScheme.primary,
),
subtitle: Text(
L10n.of(context)!.pleaseEnterRecoveryKeyDescription,
L10n.of(context).pleaseEnterRecoveryKeyDescription,
),
),
const Divider(height: 32),
@ -265,7 +265,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
fontFamily: theme.textTheme.bodyLarge?.fontFamily,
),
prefixIcon: const Icon(Icons.key_outlined),
labelText: L10n.of(context)!.recoveryKey,
labelText: L10n.of(context).recoveryKey,
hintText: 'Es** **** **** ****',
errorText: _recoveryKeyInputError,
errorMaxLines: 2,
@ -280,7 +280,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
icon: _recoveryKeyInputLoading
? const CircularProgressIndicator.adaptive()
: const Icon(Icons.lock_open_outlined),
label: Text(L10n.of(context)!.unlockOldMessages),
label: Text(L10n.of(context).unlockOldMessages),
onPressed: _recoveryKeyInputLoading
? null
: () async {
@ -323,7 +323,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
} on FormatException catch (_) {
setState(
() => _recoveryKeyInputError =
L10n.of(context)!.wrongRecoveryKey,
L10n.of(context).wrongRecoveryKey,
);
} catch (e, s) {
ErrorReporter(
@ -347,7 +347,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
const Expanded(child: Divider()),
Padding(
padding: const EdgeInsets.all(12.0),
child: Text(L10n.of(context)!.or),
child: Text(L10n.of(context).or),
),
const Expanded(child: Divider()),
],
@ -355,17 +355,17 @@ class BootstrapDialogState extends State<BootstrapDialog> {
const SizedBox(height: 16),
ElevatedButton.icon(
icon: const Icon(Icons.cast_connected_outlined),
label: Text(L10n.of(context)!.transferFromAnotherDevice),
label: Text(L10n.of(context).transferFromAnotherDevice),
onPressed: _recoveryKeyInputLoading
? null
: () async {
final consent = await showOkCancelAlertDialog(
context: context,
title: L10n.of(context)!.verifyOtherDevice,
message: L10n.of(context)!
title: L10n.of(context).verifyOtherDevice,
message: L10n.of(context)
.verifyOtherDeviceDescription,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
fullyCapitalizedForMaterial: false,
);
if (consent != OkCancelResult.ok) return;
@ -391,7 +391,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
foregroundColor: theme.colorScheme.onErrorContainer,
),
icon: const Icon(Icons.delete_outlined),
label: Text(L10n.of(context)!.recoveryKeyLost),
label: Text(L10n.of(context).recoveryKeyLost),
onPressed: _recoveryKeyInputLoading
? null
: () async {
@ -399,10 +399,10 @@ class BootstrapDialogState extends State<BootstrapDialog> {
await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.recoveryKeyLost,
message: L10n.of(context)!.wipeChatBackup,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).recoveryKeyLost,
message: L10n.of(context).wipeChatBackup,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
isDestructiveAction: true,
)) {
setState(() => _createBootstrap(true));
@ -440,18 +440,18 @@ class BootstrapDialogState extends State<BootstrapDialog> {
);
break;
case BootstrapState.error:
titleText = L10n.of(context)!.oopsSomethingWentWrong;
titleText = L10n.of(context).oopsSomethingWentWrong;
body = const Icon(Icons.error_outline, color: Colors.red, size: 80);
buttons.add(
OutlinedButton(
onPressed: () =>
Navigator.of(context, rootNavigator: false).pop<bool>(false),
child: Text(L10n.of(context)!.close),
child: Text(L10n.of(context).close),
),
);
break;
case BootstrapState.done:
titleText = L10n.of(context)!.everythingReady;
titleText = L10n.of(context).everythingReady;
body = Column(
mainAxisSize: MainAxisSize.min,
children: [
@ -462,7 +462,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
),
const SizedBox(height: 16),
Text(
L10n.of(context)!.yourChatBackupHasBeenSetUp,
L10n.of(context).yourChatBackupHasBeenSetUp,
style: const TextStyle(fontSize: 20),
),
const SizedBox(height: 16),
@ -472,7 +472,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
OutlinedButton(
onPressed: () =>
Navigator.of(context, rootNavigator: false).pop<bool>(false),
child: Text(L10n.of(context)!.close),
child: Text(L10n.of(context).close),
),
);
break;
@ -487,7 +487,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
Navigator.of(context, rootNavigator: false).pop<bool>(true),
),
),
title: Text(titleText ?? L10n.of(context)!.loadingPleaseWait),
title: Text(titleText ?? L10n.of(context).loadingPleaseWait),
),
body: Center(
child: Column(

View file

@ -43,14 +43,14 @@ class AddWidgetTileState extends State<AddWidgetTile> {
if (name.length < 3) {
setState(() {
nameError = L10n.of(context)!.widgetNameError;
nameError = L10n.of(context).widgetNameError;
});
return;
}
if (uri == null || uri.scheme != 'https') {
setState(() {
urlError = L10n.of(context)!.widgetUrlError;
urlError = L10n.of(context).widgetUrlError;
});
return;
}
@ -75,7 +75,7 @@ class AddWidgetTileState extends State<AddWidgetTile> {
Navigator.of(context).pop();
} catch (e) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(L10n.of(context)!.errorAddingWidget)),
SnackBar(content: Text(L10n.of(context).errorAddingWidget)),
);
}
}

View file

@ -13,7 +13,7 @@ class AddWidgetTileView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ExpansionTile(
title: Text(L10n.of(context)!.addWidget),
title: Text(L10n.of(context).addWidget),
leading: const Icon(Icons.add),
initiallyExpanded: controller.initiallyExpanded,
children: [
@ -21,10 +21,10 @@ class AddWidgetTileView extends StatelessWidget {
groupValue: controller.widgetType,
padding: const EdgeInsets.all(8),
children: {
'm.etherpad': Text(L10n.of(context)!.widgetEtherpad),
'm.jitsi': Text(L10n.of(context)!.widgetJitsi),
'm.video': Text(L10n.of(context)!.widgetVideo),
'm.custom': Text(L10n.of(context)!.widgetCustom),
'm.etherpad': Text(L10n.of(context).widgetEtherpad),
'm.jitsi': Text(L10n.of(context).widgetJitsi),
'm.video': Text(L10n.of(context).widgetVideo),
'm.custom': Text(L10n.of(context).widgetCustom),
}.map(
(key, value) => MapEntry(
key,
@ -43,7 +43,7 @@ class AddWidgetTileView extends StatelessWidget {
autofocus: true,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.label),
label: Text(L10n.of(context)!.widgetName),
label: Text(L10n.of(context).widgetName),
errorText: controller.nameError,
),
),
@ -54,7 +54,7 @@ class AddWidgetTileView extends StatelessWidget {
controller: controller.urlController,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.add_link),
label: Text(L10n.of(context)!.link),
label: Text(L10n.of(context).link),
errorText: controller.urlError,
),
),
@ -63,7 +63,7 @@ class AddWidgetTileView extends StatelessWidget {
children: [
TextButton(
onPressed: controller.addWidget,
child: Text(L10n.of(context)!.addWidget),
child: Text(L10n.of(context).addWidget),
),
],
),

View file

@ -56,12 +56,11 @@ class ChatPage extends StatelessWidget {
final room = Matrix.of(context).client.getRoomById(roomId);
if (room == null) {
return Scaffold(
appBar: AppBar(title: Text(L10n.of(context)!.oopsSomethingWentWrong)),
appBar: AppBar(title: Text(L10n.of(context).oopsSomethingWentWrong)),
body: Center(
child: Padding(
padding: const EdgeInsets.all(16),
child:
Text(L10n.of(context)!.youAreNoLongerParticipatingInThisChat),
child: Text(L10n.of(context).youAreNoLongerParticipatingInThisChat),
),
),
);
@ -446,7 +445,7 @@ class ChatController extends State<ChatPageWithRoom>
final commandMatch = RegExp(r'^\/(\w+)').firstMatch(sendController.text);
if (commandMatch != null &&
!sendingClient.commands.keys.contains(commandMatch[1]!.toLowerCase())) {
final l10n = L10n.of(context)!;
final l10n = L10n.of(context);
final dialogResult = await showOkCancelAlertDialog(
context: context,
title: l10n.commandInvalid,
@ -564,9 +563,9 @@ class ChatController extends State<ChatPageWithRoom>
if (info.version.sdkInt < 19) {
showOkAlertDialog(
context: context,
title: L10n.of(context)!.unsupportedAndroidVersion,
message: L10n.of(context)!.unsupportedAndroidVersionLong,
okLabel: L10n.of(context)!.close,
title: L10n.of(context).unsupportedAndroidVersion,
message: L10n.of(context).unsupportedAndroidVersionLong,
okLabel: L10n.of(context).close,
);
return;
}
@ -646,12 +645,12 @@ class ChatController extends State<ChatPageWithRoom>
if (selectedEvents.length == 1) {
return selectedEvents.first
.getDisplayEvent(timeline!)
.calcLocalizedBodyFallback(MatrixLocals(L10n.of(context)!));
.calcLocalizedBodyFallback(MatrixLocals(L10n.of(context)));
}
for (final event in selectedEvents) {
if (copyString.isNotEmpty) copyString += '\n\n';
copyString += event.getDisplayEvent(timeline!).calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
withSenderNamePrefix: true,
);
}
@ -670,32 +669,32 @@ class ChatController extends State<ChatPageWithRoom>
final event = selectedEvents.single;
final score = await showConfirmationDialog<int>(
context: context,
title: L10n.of(context)!.reportMessage,
message: L10n.of(context)!.howOffensiveIsThisContent,
cancelLabel: L10n.of(context)!.cancel,
okLabel: L10n.of(context)!.ok,
title: L10n.of(context).reportMessage,
message: L10n.of(context).howOffensiveIsThisContent,
cancelLabel: L10n.of(context).cancel,
okLabel: L10n.of(context).ok,
actions: [
AlertDialogAction(
key: -100,
label: L10n.of(context)!.extremeOffensive,
label: L10n.of(context).extremeOffensive,
),
AlertDialogAction(
key: -50,
label: L10n.of(context)!.offensive,
label: L10n.of(context).offensive,
),
AlertDialogAction(
key: 0,
label: L10n.of(context)!.inoffensive,
label: L10n.of(context).inoffensive,
),
],
);
if (score == null) return;
final reason = await showTextInputDialog(
context: context,
title: L10n.of(context)!.whyDoYouWantToReportThis,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
textFields: [DialogTextField(hintText: L10n.of(context)!.reason)],
title: L10n.of(context).whyDoYouWantToReportThis,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
textFields: [DialogTextField(hintText: L10n.of(context).reason)],
);
if (reason == null || reason.single.isEmpty) return;
final result = await showFutureLoadingDialog(
@ -713,7 +712,7 @@ class ChatController extends State<ChatPageWithRoom>
selectedEvents.clear();
});
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(L10n.of(context)!.contentHasBeenReported)),
SnackBar(content: Text(L10n.of(context).contentHasBeenReported)),
);
}
@ -740,16 +739,16 @@ class ChatController extends State<ChatPageWithRoom>
final reasonInput = selectedEvents.any((event) => event.status.isSent)
? await showTextInputDialog(
context: context,
title: L10n.of(context)!.redactMessage,
message: L10n.of(context)!.redactMessageDescription,
title: L10n.of(context).redactMessage,
message: L10n.of(context).redactMessageDescription,
isDestructiveAction: true,
textFields: [
DialogTextField(
hintText: L10n.of(context)!.optionalRedactReason,
hintText: L10n.of(context).optionalRedactReason,
),
],
okLabel: L10n.of(context)!.remove,
cancelLabel: L10n.of(context)!.cancel,
okLabel: L10n.of(context).remove,
cancelLabel: L10n.of(context).cancel,
)
: <String>[];
if (reasonInput == null) return;
@ -1015,7 +1014,7 @@ class ChatController extends State<ChatPageWithRoom>
editEvent = selectedEvents.first;
sendController.text =
editEvent!.getDisplayEvent(timeline!).calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
withSenderNamePrefix: false,
hideReply: true,
);
@ -1028,13 +1027,13 @@ class ChatController extends State<ChatPageWithRoom>
if (OkCancelResult.ok !=
await showOkCancelAlertDialog(
context: context,
title: L10n.of(context)!.goToTheNewRoom,
title: L10n.of(context).goToTheNewRoom,
message: room
.getState(EventTypes.RoomTombstone)!
.parsedTombstoneContent
.body,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
)) {
return;
}
@ -1117,10 +1116,10 @@ class ChatController extends State<ChatPageWithRoom>
unpinEvent(String eventId) async {
final response = await showOkCancelAlertDialog(
context: context,
title: L10n.of(context)!.unpin,
message: L10n.of(context)!.confirmEventUnpin,
okLabel: L10n.of(context)!.unpin,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).unpin,
message: L10n.of(context).confirmEventUnpin,
okLabel: L10n.of(context).unpin,
cancelLabel: L10n.of(context).cancel,
);
if (response == OkCancelResult.ok) {
final events = room.pinnedEventIds
@ -1214,26 +1213,26 @@ class ChatController extends State<ChatPageWithRoom>
Navigator.pop(context);
showOkAlertDialog(
context: context,
title: L10n.of(context)!.unsupportedAndroidVersion,
message: L10n.of(context)!.unsupportedAndroidVersionLong,
okLabel: L10n.of(context)!.close,
title: L10n.of(context).unsupportedAndroidVersion,
message: L10n.of(context).unsupportedAndroidVersionLong,
okLabel: L10n.of(context).close,
);
}
});
}
final callType = await showModalActionSheet<CallType>(
context: context,
title: L10n.of(context)!.warning,
message: L10n.of(context)!.videoCallsBetaWarning,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).warning,
message: L10n.of(context).videoCallsBetaWarning,
cancelLabel: L10n.of(context).cancel,
actions: [
SheetAction(
label: L10n.of(context)!.voiceCall,
label: L10n.of(context).voiceCall,
icon: Icons.phone_outlined,
key: CallType.kVoice,
),
SheetAction(
label: L10n.of(context)!.videoCall,
label: L10n.of(context).videoCall,
icon: Icons.video_call_outlined,
key: CallType.kVideo,
),

View file

@ -36,7 +36,7 @@ class ChatAppBarTitle extends StatelessWidget {
child: Avatar(
mxContent: room.avatar,
name: room.getLocalizedDisplayname(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
),
size: 32,
),
@ -47,7 +47,7 @@ class ChatAppBarTitle extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
room.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)),
room.getLocalizedDisplayname(MatrixLocals(L10n.of(context))),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
@ -63,13 +63,13 @@ class ChatAppBarTitle extends StatelessWidget {
final style = Theme.of(context).textTheme.bodySmall;
if (presence?.currentlyActive == true) {
return Text(
L10n.of(context)!.currentlyActive,
L10n.of(context).currentlyActive,
style: style,
);
}
if (lastActiveTimestamp != null) {
return Text(
L10n.of(context)!.lastActiveAgo(
L10n.of(context).lastActiveAgo(
lastActiveTimestamp.localizedTimeShort(context),
),
style: style,

View file

@ -30,8 +30,8 @@ class ChatEmojiPicker extends StatelessWidget {
children: [
TabBar(
tabs: [
Tab(text: L10n.of(context)!.emojis),
Tab(text: L10n.of(context)!.stickers),
Tab(text: L10n.of(context).emojis),
Tab(text: L10n.of(context).stickers),
],
),
Expanded(
@ -97,7 +97,7 @@ class NoRecent extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Text(
L10n.of(context)!.emoteKeyboardNoRecents,
L10n.of(context).emoteKeyboardNoRecents,
style: Theme.of(context).textTheme.bodyLarge,
);
}

View file

@ -44,7 +44,7 @@ class ChatInputRow extends StatelessWidget {
child: Row(
children: <Widget>[
const Icon(Icons.delete),
Text(L10n.of(context)!.delete),
Text(L10n.of(context).delete),
],
),
),
@ -57,7 +57,7 @@ class ChatInputRow extends StatelessWidget {
child: Row(
children: <Widget>[
const Icon(Icons.keyboard_arrow_left_outlined),
Text(L10n.of(context)!.forward),
Text(L10n.of(context).forward),
],
),
),
@ -73,7 +73,7 @@ class ChatInputRow extends StatelessWidget {
onPressed: controller.replyAction,
child: Row(
children: <Widget>[
Text(L10n.of(context)!.reply),
Text(L10n.of(context).reply),
const Icon(Icons.keyboard_arrow_right),
],
),
@ -85,7 +85,7 @@ class ChatInputRow extends StatelessWidget {
onPressed: controller.sendAgainAction,
child: Row(
children: <Widget>[
Text(L10n.of(context)!.tryToSendAgain),
Text(L10n.of(context).tryToSendAgain),
const SizedBox(width: 4),
const Icon(Icons.send_outlined, size: 16),
],
@ -103,7 +103,7 @@ class ChatInputRow extends StatelessWidget {
},
onKeysPressed: () =>
controller.onAddPopupMenuButtonSelected('file'),
helpLabel: L10n.of(context)!.sendFile,
helpLabel: L10n.of(context).sendFile,
child: AnimatedContainer(
duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve,
@ -125,7 +125,7 @@ class ChatInputRow extends StatelessWidget {
foregroundColor: Colors.white,
child: Icon(Icons.attachment_outlined),
),
title: Text(L10n.of(context)!.sendFile),
title: Text(L10n.of(context).sendFile),
contentPadding: const EdgeInsets.all(0),
),
),
@ -137,7 +137,7 @@ class ChatInputRow extends StatelessWidget {
foregroundColor: Colors.white,
child: Icon(Icons.image_outlined),
),
title: Text(L10n.of(context)!.sendImage),
title: Text(L10n.of(context).sendImage),
contentPadding: const EdgeInsets.all(0),
),
),
@ -150,7 +150,7 @@ class ChatInputRow extends StatelessWidget {
foregroundColor: Colors.white,
child: Icon(Icons.camera_alt_outlined),
),
title: Text(L10n.of(context)!.openCamera),
title: Text(L10n.of(context).openCamera),
contentPadding: const EdgeInsets.all(0),
),
),
@ -163,7 +163,7 @@ class ChatInputRow extends StatelessWidget {
foregroundColor: Colors.white,
child: Icon(Icons.videocam_outlined),
),
title: Text(L10n.of(context)!.openVideoCamera),
title: Text(L10n.of(context).openVideoCamera),
contentPadding: const EdgeInsets.all(0),
),
),
@ -176,7 +176,7 @@ class ChatInputRow extends StatelessWidget {
foregroundColor: Colors.white,
child: Icon(Icons.gps_fixed_outlined),
),
title: Text(L10n.of(context)!.shareLocation),
title: Text(L10n.of(context).shareLocation),
contentPadding: const EdgeInsets.all(0),
),
),
@ -194,9 +194,9 @@ class ChatInputRow extends StatelessWidget {
LogicalKeyboardKey.keyE,
},
onKeysPressed: controller.emojiPickerAction,
helpLabel: L10n.of(context)!.emojis,
helpLabel: L10n.of(context).emojis,
child: IconButton(
tooltip: L10n.of(context)!.emojis,
tooltip: L10n.of(context).emojis,
icon: PageTransitionSwitcher(
transitionBuilder: (
Widget child,
@ -255,7 +255,7 @@ class ChatInputRow extends StatelessWidget {
bottom: 6.0,
top: 3.0,
),
hintText: L10n.of(context)!.writeAMessage,
hintText: L10n.of(context).writeAMessage,
hintMaxLines: 1,
border: InputBorder.none,
enabledBorder: InputBorder.none,
@ -272,7 +272,7 @@ class ChatInputRow extends StatelessWidget {
child: PlatformInfos.platformCanRecord &&
controller.sendController.text.isEmpty
? FloatingActionButton.small(
tooltip: L10n.of(context)!.voiceMessage,
tooltip: L10n.of(context).voiceMessage,
onPressed: controller.voiceMessageAction,
elevation: 0,
heroTag: null,
@ -284,7 +284,7 @@ class ChatInputRow extends StatelessWidget {
child: const Icon(Icons.mic_none_outlined),
)
: FloatingActionButton.small(
tooltip: L10n.of(context)!.send,
tooltip: L10n.of(context).send,
onPressed: controller.send,
elevation: 0,
heroTag: null,

View file

@ -38,12 +38,12 @@ class ChatView extends StatelessWidget {
if (controller.canEditSelectedEvents)
IconButton(
icon: const Icon(Icons.edit_outlined),
tooltip: L10n.of(context)!.edit,
tooltip: L10n.of(context).edit,
onPressed: controller.editSelectedEventAction,
),
IconButton(
icon: const Icon(Icons.copy_outlined),
tooltip: L10n.of(context)!.copy,
tooltip: L10n.of(context).copy,
onPressed: controller.copyEventsAction,
),
if (controller.canSaveSelectedEvent)
@ -51,7 +51,7 @@ class ChatView extends StatelessWidget {
Builder(
builder: (context) => IconButton(
icon: Icon(Icons.adaptive.share),
tooltip: L10n.of(context)!.share,
tooltip: L10n.of(context).share,
onPressed: () => controller.saveSelectedEvent(context),
),
),
@ -59,12 +59,12 @@ class ChatView extends StatelessWidget {
IconButton(
icon: const Icon(Icons.push_pin_outlined),
onPressed: controller.pinEvent,
tooltip: L10n.of(context)!.pinMessage,
tooltip: L10n.of(context).pinMessage,
),
if (controller.canRedactSelectedEvents)
IconButton(
icon: const Icon(Icons.delete_outlined),
tooltip: L10n.of(context)!.redactMessage,
tooltip: L10n.of(context).redactMessage,
onPressed: controller.redactEventsAction,
),
if (controller.selectedEvents.length == 1)
@ -88,7 +88,7 @@ class ChatView extends StatelessWidget {
children: [
const Icon(Icons.info_outlined),
const SizedBox(width: 12),
Text(L10n.of(context)!.messageInfo),
Text(L10n.of(context).messageInfo),
],
),
),
@ -103,7 +103,7 @@ class ChatView extends StatelessWidget {
color: Colors.red,
),
const SizedBox(width: 12),
Text(L10n.of(context)!.reportMessage),
Text(L10n.of(context).reportMessage),
],
),
),
@ -117,7 +117,7 @@ class ChatView extends StatelessWidget {
IconButton(
onPressed: controller.onPhoneButtonTap,
icon: const Icon(Icons.call_outlined),
tooltip: L10n.of(context)!.placeCall,
tooltip: L10n.of(context).placeCall,
),
EncryptionButton(controller.room),
ChatSettingsPopupMenu(controller.room, true),
@ -180,7 +180,7 @@ class ChatView extends StatelessWidget {
? IconButton(
icon: const Icon(Icons.close),
onPressed: controller.clearSelectedEvents,
tooltip: L10n.of(context)!.close,
tooltip: L10n.of(context).close,
color: theme.colorScheme.primary,
)
: StreamBuilder<Object>(
@ -213,7 +213,7 @@ class ChatView extends StatelessWidget {
),
trailing: TextButton(
onPressed: controller.goToNewRoomAction,
child: Text(L10n.of(context)!.goToTheNewRoom),
child: Text(L10n.of(context).goToTheNewRoom),
),
),
if (scrollUpBannerEventId != null)
@ -221,13 +221,13 @@ class ChatView extends StatelessWidget {
leading: IconButton(
color: theme.colorScheme.onSurfaceVariant,
icon: const Icon(Icons.close),
tooltip: L10n.of(context)!.close,
tooltip: L10n.of(context).close,
onPressed: () {
controller.discardScrollUpBannerEventId();
controller.setReadMarker();
},
),
title: L10n.of(context)!.jumpToLastReadMessage,
title: L10n.of(context).jumpToLastReadMessage,
trailing: TextButton(
onPressed: () {
controller.scrollToEventId(
@ -235,7 +235,7 @@ class ChatView extends StatelessWidget {
);
controller.discardScrollUpBannerEventId();
},
child: Text(L10n.of(context)!.jump),
child: Text(L10n.of(context).jump),
),
),
],
@ -333,7 +333,7 @@ class ChatView extends StatelessWidget {
),
onPressed: controller.leaveChat,
label: Text(
L10n.of(context)!.leave,
L10n.of(context).leave,
),
),
TextButton.icon(
@ -347,7 +347,7 @@ class ChatView extends StatelessWidget {
),
onPressed: controller.recreateChat,
label: Text(
L10n.of(context)!.reopenChat,
L10n.of(context).reopenChat,
),
),
],

View file

@ -25,8 +25,8 @@ class EncryptionButton extends StatelessWidget {
: Future.value(EncryptionHealthState.allVerified),
builder: (BuildContext context, snapshot) => IconButton(
tooltip: room.encrypted
? L10n.of(context)!.encrypted
: L10n.of(context)!.encryptionNotEnabled,
? L10n.of(context).encrypted
: L10n.of(context).encryptionNotEnabled,
icon: Icon(
room.encrypted ? Icons.lock_outlined : Icons.lock_open_outlined,
size: 20,

View file

@ -14,7 +14,7 @@ extension EventInfoDialogExtension on Event {
void showInfoDialog(BuildContext context) => showAdaptiveBottomSheet(
context: context,
builder: (context) =>
EventInfoDialog(l10n: L10n.of(context)!, event: this),
EventInfoDialog(l10n: L10n.of(context), event: this),
);
}
@ -40,11 +40,11 @@ class EventInfoDialog extends StatelessWidget {
final originalSource = event.originalSource;
return Scaffold(
appBar: AppBar(
title: Text(L10n.of(context)!.messageInfo),
title: Text(L10n.of(context).messageInfo),
leading: IconButton(
icon: const Icon(Icons.arrow_downward_outlined),
onPressed: Navigator.of(context, rootNavigator: false).pop,
tooltip: L10n.of(context)!.close,
tooltip: L10n.of(context).close,
),
),
body: ListView(
@ -56,20 +56,20 @@ class EventInfoDialog extends StatelessWidget {
client: event.room.client,
presenceUserId: event.senderId,
),
title: Text(L10n.of(context)!.sender),
title: Text(L10n.of(context).sender),
subtitle: Text(
'${event.senderFromMemoryOrFallback.calcDisplayname()} [${event.senderId}]',
),
),
ListTile(
title: Text('${L10n.of(context)!.time}:'),
title: Text('${L10n.of(context).time}:'),
subtitle: Text(event.originServerTs.localizedTime(context)),
),
ListTile(
title: Text('${L10n.of(context)!.status}:'),
title: Text('${L10n.of(context).status}:'),
subtitle: Text(event.status.name),
),
ListTile(title: Text('${L10n.of(context)!.sourceCode}:')),
ListTile(title: Text('${L10n.of(context).sourceCode}:')),
Padding(
padding: const EdgeInsets.all(12.0),
child: Material(
@ -88,7 +88,7 @@ class EventInfoDialog extends StatelessWidget {
),
),
if (originalSource != null) ...[
ListTile(title: Text('${L10n.of(context)!.encrypted}:')),
ListTile(title: Text('${L10n.of(context).encrypted}:')),
Padding(
padding: const EdgeInsets.all(12.0),
child: Material(

View file

@ -72,19 +72,19 @@ class _CuteContentState extends State<CuteContent> {
generateLabel(User? user) {
switch (widget.event.content['cute_type']) {
case 'googly_eyes':
return L10n.of(context)?.googlyEyesContent(
return L10n.of(context).googlyEyesContent(
user?.displayName ??
widget.event.senderFromMemoryOrFallback.displayName ??
'',
);
case 'cuddle':
return L10n.of(context)?.cuddleContent(
return L10n.of(context).cuddleContent(
user?.displayName ??
widget.event.senderFromMemoryOrFallback.displayName ??
'',
);
case 'hug':
return L10n.of(context)?.hugContent(
return L10n.of(context).hugContent(
user?.displayName ??
widget.event.senderFromMemoryOrFallback.displayName ??
'',

View file

@ -484,7 +484,7 @@ class Message extends StatelessWidget {
horizontal: 8,
),
child: Text(
L10n.of(context)!.readUpToHere,
L10n.of(context).readUpToHere,
style: TextStyle(color: theme.colorScheme.primary),
),
),

View file

@ -38,7 +38,7 @@ class MessageContent extends StatelessWidget {
});
void _verifyOrRequestKey(BuildContext context) async {
final l10n = L10n.of(context)!;
final l10n = L10n.of(context);
if (event.content['can_request_session'] != true) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
@ -184,7 +184,7 @@ class MessageContent extends StatelessWidget {
textColor: buttonTextColor,
onPressed: () => _verifyOrRequestKey(context),
icon: '🔒',
label: L10n.of(context)!.encrypted,
label: L10n.of(context).encrypted,
fontSize: fontSize,
);
case MessageTypes.Location:
@ -213,7 +213,7 @@ class MessageContent extends StatelessWidget {
onPressed:
UrlLauncher(context, geoUri.toString()).launchUrl,
label: Text(
L10n.of(context)!.openInMaps,
L10n.of(context).openInMaps,
style: TextStyle(color: textColor),
),
),
@ -233,11 +233,11 @@ class MessageContent extends StatelessWidget {
event.redactedBecause?.content.tryGet<String>('reason');
final redactedBy = snapshot.data?.calcDisplayname() ??
event.redactedBecause?.senderId.localpart ??
L10n.of(context)!.user;
L10n.of(context).user;
return _ButtonContent(
label: reason == null
? L10n.of(context)!.redactedBy(redactedBy)
: L10n.of(context)!.redactedByBecause(
? L10n.of(context).redactedBy(redactedBy)
: L10n.of(context).redactedByBecause(
redactedBy,
reason,
),
@ -254,7 +254,7 @@ class MessageContent extends StatelessWidget {
event.numberEmotes <= 10;
return Linkify(
text: event.calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
hideReply: true,
),
style: TextStyle(
@ -277,7 +277,7 @@ class MessageContent extends StatelessWidget {
future: event.fetchSenderUser(),
builder: (context, snapshot) {
return _ButtonContent(
label: L10n.of(context)!.startedACall(
label: L10n.of(context).startedACall(
snapshot.data?.calcDisplayname() ??
event.senderFromMemoryOrFallback.calcDisplayname(),
),
@ -293,7 +293,7 @@ class MessageContent extends StatelessWidget {
future: event.fetchSenderUser(),
builder: (context, snapshot) {
return _ButtonContent(
label: L10n.of(context)!.userSentUnknownEvent(
label: L10n.of(context).userSentUnknownEvent(
snapshot.data?.calcDisplayname() ??
event.senderFromMemoryOrFallback.calcDisplayname(),
event.type,

View file

@ -72,7 +72,7 @@ class ReplyContent extends StatelessWidget {
),
Text(
displayEvent.calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
withSenderNamePrefix: false,
hideReply: true,
),

View file

@ -21,7 +21,7 @@ class StateMessage extends StatelessWidget {
padding: const EdgeInsets.all(8),
child: Text(
event.calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
),
textAlign: TextAlign.center,
style: TextStyle(

View file

@ -58,10 +58,10 @@ class VerificationRequestContent extends StatelessWidget {
canceled
? 'Error ${cancel.first.content.tryGet<String>('code')}: ${cancel.first.content.tryGet<String>('reason')}'
: (fullyDone
? L10n.of(context)!.verifySuccess
? L10n.of(context).verifySuccess
: (started
? L10n.of(context)!.loadingPleaseWait
: L10n.of(context)!.newVerificationRequest)),
? L10n.of(context).loadingPleaseWait
: L10n.of(context).newVerificationRequest)),
),
],
),

View file

@ -137,8 +137,8 @@ class EventVideoPlayerState extends State<EventVideoPlayer> {
)
: const Icon(Icons.play_circle_outlined),
tooltip: _isDownloading
? L10n.of(context)!.loadingPleaseWait
: L10n.of(context)!.videoWithSize(
? L10n.of(context).loadingPleaseWait
: L10n.of(context).videoWithSize(
widget.event.sizeString ?? '?MB',
),
onPressed: _isDownloading ? null : _downloadAction,

View file

@ -226,7 +226,7 @@ class InputBar extends StatelessWidget {
const padding = EdgeInsets.all(4.0);
if (suggestion['type'] == 'command') {
final command = suggestion['name']!;
final hint = commandHint(L10n.of(context)!, command);
final hint = commandHint(L10n.of(context), command);
return Tooltip(
message: hint,
waitDuration: const Duration(days: 1), // don't show on hover

View file

@ -32,13 +32,13 @@ class PinnedEvents extends StatelessWidget {
? events.single?.eventId
: await showConfirmationDialog<String>(
context: context,
title: L10n.of(context)!.pinMessage,
title: L10n.of(context).pinMessage,
actions: events
.map(
(event) => AlertDialogAction(
key: event?.eventId ?? '',
label: event?.calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
withSenderNamePrefix: true,
hideReply: true,
) ??
@ -67,17 +67,17 @@ class PinnedEvents extends StatelessWidget {
final event = snapshot.data;
return ChatAppBarListTile(
title: event?.calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
withSenderNamePrefix: true,
hideReply: true,
) ??
L10n.of(context)!.loadingPleaseWait,
L10n.of(context).loadingPleaseWait,
leading: IconButton(
splashRadius: 18,
iconSize: 18,
color: theme.colorScheme.onSurfaceVariant,
icon: const Icon(Icons.push_pin),
tooltip: L10n.of(context)!.unpin,
tooltip: L10n.of(context).unpin,
onPressed: controller.room.canSendEvent(EventTypes.RoomPinnedEvents)
? () => controller.unpinEvent(event!.eventId)
: null,

View file

@ -137,7 +137,7 @@ class RecordingDialogState extends State<RecordingDialog> {
final time =
'${_duration.inMinutes.toString().padLeft(2, '0')}:${(_duration.inSeconds % 60).toString().padLeft(2, '0')}';
final content = error
? Text(L10n.of(context)!.oopsSomethingWentWrong)
? Text(L10n.of(context).oopsSomethingWentWrong)
: Row(
children: [
Container(
@ -185,7 +185,7 @@ class RecordingDialogState extends State<RecordingDialog> {
CupertinoDialogAction(
onPressed: () => Navigator.of(context, rootNavigator: false).pop(),
child: Text(
L10n.of(context)!.cancel.toUpperCase(),
L10n.of(context).cancel.toUpperCase(),
style: TextStyle(
color: theme.textTheme.bodyMedium?.color?.withAlpha(150),
),
@ -194,7 +194,7 @@ class RecordingDialogState extends State<RecordingDialog> {
if (error != true)
CupertinoDialogAction(
onPressed: _stopAndSend,
child: Text(L10n.of(context)!.send.toUpperCase()),
child: Text(L10n.of(context).send.toUpperCase()),
),
],
);
@ -205,7 +205,7 @@ class RecordingDialogState extends State<RecordingDialog> {
TextButton(
onPressed: () => Navigator.of(context, rootNavigator: false).pop(),
child: Text(
L10n.of(context)!.cancel.toUpperCase(),
L10n.of(context).cancel.toUpperCase(),
style: TextStyle(
color: theme.textTheme.bodyMedium?.color?.withAlpha(150),
),
@ -217,7 +217,7 @@ class RecordingDialogState extends State<RecordingDialog> {
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(L10n.of(context)!.send.toUpperCase()),
Text(L10n.of(context).send.toUpperCase()),
const SizedBox(width: 4),
const Icon(Icons.send_outlined, size: 15),
],

View file

@ -29,7 +29,7 @@ class ReplyDisplay extends StatelessWidget {
child: Row(
children: <Widget>[
IconButton(
tooltip: L10n.of(context)!.close,
tooltip: L10n.of(context).close,
icon: const Icon(Icons.close),
onPressed: controller.cancelReplyEventAction,
),
@ -71,7 +71,7 @@ class _EditContent extends StatelessWidget {
Container(width: 15.0),
Text(
event.calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
withSenderNamePrefix: false,
hideReply: true,
),

View file

@ -40,7 +40,7 @@ class SendFileDialogState extends State<SendFileDialog> {
Future<void> _send() async {
final scaffoldMessenger = ScaffoldMessenger.of(widget.outerContext);
final l10n = L10n.of(context)!;
final l10n = L10n.of(context);
try {
scaffoldMessenger.showLoadingSnackBar(l10n.prepareSendingAttachment);
@ -146,7 +146,7 @@ class SendFileDialogState extends State<SendFileDialog> {
Widget build(BuildContext context) {
final theme = Theme.of(context);
var sendStr = L10n.of(context)!.sendFile;
var sendStr = L10n.of(context).sendFile;
final uniqueMimeType = widget.files
.map((file) => file.mimeType ?? lookupMimeType(file.path))
.toSet()
@ -154,21 +154,21 @@ class SendFileDialogState extends State<SendFileDialog> {
final fileName = widget.files.length == 1
? widget.files.single.name
: L10n.of(context)!.countFiles(widget.files.length.toString());
: L10n.of(context).countFiles(widget.files.length.toString());
if (uniqueMimeType?.startsWith('image') ?? false) {
sendStr = L10n.of(context)!.sendImage;
sendStr = L10n.of(context).sendImage;
} else if (uniqueMimeType?.startsWith('audio') ?? false) {
sendStr = L10n.of(context)!.sendAudio;
sendStr = L10n.of(context).sendAudio;
} else if (uniqueMimeType?.startsWith('video') ?? false) {
sendStr = L10n.of(context)!.sendVideo;
sendStr = L10n.of(context).sendVideo;
}
return FutureBuilder<String>(
future: _calcCombinedFileSize(),
builder: (context, snapshot) {
final sizeString =
snapshot.data ?? L10n.of(context)!.calculatingFileSize;
snapshot.data ?? L10n.of(context).calculatingFileSize;
Widget contentWidget;
if (uniqueMimeType?.startsWith('image') ?? false) {
@ -210,7 +210,7 @@ class SendFileDialogState extends State<SendFileDialog> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
L10n.of(context)!.sendOriginal,
L10n.of(context).sendOriginal,
style: const TextStyle(fontWeight: FontWeight.bold),
),
Text(sizeString),
@ -270,7 +270,7 @@ class SendFileDialogState extends State<SendFileDialog> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
L10n.of(context)!.sendOriginal,
L10n.of(context).sendOriginal,
style:
const TextStyle(fontWeight: FontWeight.bold),
),
@ -293,11 +293,11 @@ class SendFileDialogState extends State<SendFileDialog> {
// just close the dialog
Navigator.of(context, rootNavigator: false).pop();
},
child: Text(L10n.of(context)!.cancel),
child: Text(L10n.of(context).cancel),
),
TextButton(
onPressed: _send,
child: Text(L10n.of(context)!.send),
child: Text(L10n.of(context).send),
),
],
);

View file

@ -93,12 +93,12 @@ class SendLocationDialogState extends State<SendLocationDialog> {
longitude: position!.longitude,
);
} else if (disabled) {
contentWidget = Text(L10n.of(context)!.locationDisabledNotice);
contentWidget = Text(L10n.of(context).locationDisabledNotice);
} else if (denied) {
contentWidget = Text(L10n.of(context)!.locationPermissionDeniedNotice);
contentWidget = Text(L10n.of(context).locationPermissionDeniedNotice);
} else if (error != null) {
contentWidget =
Text(L10n.of(context)!.errorObtainingLocation(error.toString()));
Text(L10n.of(context).errorObtainingLocation(error.toString()));
} else {
contentWidget = Row(
mainAxisSize: MainAxisSize.min,
@ -106,22 +106,22 @@ class SendLocationDialogState extends State<SendLocationDialog> {
children: [
const CupertinoActivityIndicator(),
const SizedBox(width: 12),
Text(L10n.of(context)!.obtainingLocation),
Text(L10n.of(context).obtainingLocation),
],
);
}
return AlertDialog.adaptive(
title: Text(L10n.of(context)!.shareLocation),
title: Text(L10n.of(context).shareLocation),
content: contentWidget,
actions: [
TextButton(
onPressed: Navigator.of(context, rootNavigator: false).pop,
child: Text(L10n.of(context)!.cancel),
child: Text(L10n.of(context).cancel),
),
if (position != null)
TextButton(
onPressed: isSending ? null : sendAction,
child: Text(L10n.of(context)!.send),
child: Text(L10n.of(context).send),
),
],
);

View file

@ -117,7 +117,7 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
child: TextField(
autofocus: false,
decoration: InputDecoration(
hintText: L10n.of(context)!.search,
hintText: L10n.of(context).search,
prefixIcon: const Icon(Icons.search_outlined),
contentPadding: EdgeInsets.zero,
),
@ -131,7 +131,7 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(L10n.of(context)!.noEmotesFound),
Text(L10n.of(context).noEmotesFound),
const SizedBox(height: 12),
OutlinedButton.icon(
onPressed: () => UrlLauncher(
@ -139,7 +139,7 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
'https://matrix.to/#/#fluffychat-stickers:janian.de',
).launchUrl(),
icon: const Icon(Icons.explore_outlined),
label: Text(L10n.of(context)!.discover),
label: Text(L10n.of(context).discover),
),
],
),

View file

@ -151,7 +151,7 @@ class ChatAccessSettingsController extends State<ChatAccessSettings> {
if (capabilities == null) return;
final newVersion = await showConfirmationDialog<String>(
context: context,
title: L10n.of(context)!.replaceRoomWithNewerVersion,
title: L10n.of(context).replaceRoomWithNewerVersion,
actions: capabilities.mRoomVersions!.available.entries
.where((r) => r.key != roomVersion)
.map(
@ -168,10 +168,10 @@ class ChatAccessSettingsController extends State<ChatAccessSettings> {
await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
okLabel: L10n.of(context)!.yes,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context)!.areYouSure,
message: L10n.of(context)!.roomUpgradeDescription,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).cancel,
title: L10n.of(context).areYouSure,
message: L10n.of(context).roomUpgradeDescription,
isDestructiveAction: true,
)) {
return;
@ -190,12 +190,12 @@ class ChatAccessSettingsController extends State<ChatAccessSettings> {
final input = await showTextInputDialog(
context: context,
title: L10n.of(context)!.editRoomAliases,
title: L10n.of(context).editRoomAliases,
textFields: [
DialogTextField(
prefixText: '#',
suffixText: domain,
hintText: L10n.of(context)!.alias,
hintText: L10n.of(context).alias,
),
],
);
@ -214,10 +214,10 @@ class ChatAccessSettingsController extends State<ChatAccessSettings> {
final canonicalAliasConsent = await showOkCancelAlertDialog(
context: context,
title: L10n.of(context)!.setAsCanonicalAlias,
title: L10n.of(context).setAsCanonicalAlias,
message: alias,
okLabel: L10n.of(context)!.yes,
cancelLabel: L10n.of(context)!.no,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).no,
);
final altAliases = room

View file

@ -20,7 +20,7 @@ class ChatAccessSettingsPageView extends StatelessWidget {
return Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
title: Text(L10n.of(context)!.accessAndVisibility),
title: Text(L10n.of(context).accessAndVisibility),
),
body: MaxWidthBody(
child: StreamBuilder<Object>(
@ -38,7 +38,7 @@ class ChatAccessSettingsPageView extends StatelessWidget {
children: [
ListTile(
title: Text(
L10n.of(context)!.visibilityOfTheChatHistory,
L10n.of(context).visibilityOfTheChatHistory,
style: TextStyle(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
@ -49,7 +49,7 @@ class ChatAccessSettingsPageView extends StatelessWidget {
RadioListTile<HistoryVisibility>.adaptive(
title: Text(
historyVisibility
.getLocalizedString(MatrixLocals(L10n.of(context)!)),
.getLocalizedString(MatrixLocals(L10n.of(context))),
),
value: historyVisibility,
groupValue: room.historyVisibility,
@ -61,7 +61,7 @@ class ChatAccessSettingsPageView extends StatelessWidget {
Divider(color: theme.dividerColor),
ListTile(
title: Text(
L10n.of(context)!.whoIsAllowedToJoinThisGroup,
L10n.of(context).whoIsAllowedToJoinThisGroup,
style: TextStyle(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
@ -72,7 +72,7 @@ class ChatAccessSettingsPageView extends StatelessWidget {
if (joinRule != JoinRules.private)
RadioListTile<JoinRules>.adaptive(
title: Text(
joinRule.localizedString(L10n.of(context)!),
joinRule.localizedString(L10n.of(context)),
),
value: joinRule,
groupValue: room.joinRules,
@ -86,7 +86,7 @@ class ChatAccessSettingsPageView extends StatelessWidget {
.contains(room.joinRules)) ...[
ListTile(
title: Text(
L10n.of(context)!.areGuestsAllowedToJoin,
L10n.of(context).areGuestsAllowedToJoin,
style: TextStyle(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
@ -97,7 +97,7 @@ class ChatAccessSettingsPageView extends StatelessWidget {
RadioListTile<GuestAccess>.adaptive(
title: Text(
guestAccess.getLocalizedString(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
),
),
value: guestAccess,
@ -110,7 +110,7 @@ class ChatAccessSettingsPageView extends StatelessWidget {
Divider(color: theme.dividerColor),
ListTile(
title: Text(
L10n.of(context)!.publicChatAddresses,
L10n.of(context).publicChatAddresses,
style: TextStyle(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
@ -118,7 +118,7 @@ class ChatAccessSettingsPageView extends StatelessWidget {
),
trailing: IconButton(
icon: const Icon(Icons.add_outlined),
tooltip: L10n.of(context)!.createNewAddress,
tooltip: L10n.of(context).createNewAddress,
onPressed: controller.addAlias,
),
),
@ -171,7 +171,7 @@ class ChatAccessSettingsPageView extends StatelessWidget {
builder: (context, snapshot) => SwitchListTile.adaptive(
value: snapshot.data == Visibility.public,
title: Text(
L10n.of(context)!.chatCanBeDiscoveredViaSearchOnServer(
L10n.of(context).chatCanBeDiscoveredViaSearchOnServer(
room.client.userID!.domain!,
),
),
@ -180,7 +180,7 @@ class ChatAccessSettingsPageView extends StatelessWidget {
),
],
ListTile(
title: Text(L10n.of(context)!.globalChatId),
title: Text(L10n.of(context).globalChatId),
subtitle: SelectableText(room.id),
trailing: IconButton(
icon: const Icon(Icons.copy_outlined),
@ -188,7 +188,7 @@ class ChatAccessSettingsPageView extends StatelessWidget {
),
),
ListTile(
title: Text(L10n.of(context)!.roomVersion),
title: Text(L10n.of(context).roomVersion),
subtitle: SelectableText(
room
.getState(EventTypes.RoomCreate)!

View file

@ -43,14 +43,14 @@ class ChatDetailsController extends State<ChatDetails> {
final room = Matrix.of(context).client.getRoomById(roomId!)!;
final input = await showTextInputDialog(
context: context,
title: L10n.of(context)!.changeTheNameOfTheGroup,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).changeTheNameOfTheGroup,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
textFields: [
DialogTextField(
initialText: room.getLocalizedDisplayname(
MatrixLocals(
L10n.of(context)!,
L10n.of(context),
),
),
),
@ -63,7 +63,7 @@ class ChatDetailsController extends State<ChatDetails> {
);
if (success.error == null) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(L10n.of(context)!.displaynameHasBeenChanged)),
SnackBar(content: Text(L10n.of(context).displaynameHasBeenChanged)),
);
}
}
@ -72,12 +72,12 @@ class ChatDetailsController extends State<ChatDetails> {
final room = Matrix.of(context).client.getRoomById(roomId!)!;
final input = await showTextInputDialog(
context: context,
title: L10n.of(context)!.setChatDescription,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).setChatDescription,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
textFields: [
DialogTextField(
hintText: L10n.of(context)!.noChatDescriptionYet,
hintText: L10n.of(context).noChatDescriptionYet,
initialText: room.topic,
minLines: 4,
maxLines: 8,
@ -92,7 +92,7 @@ class ChatDetailsController extends State<ChatDetails> {
if (success.error == null) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(L10n.of(context)!.chatDescriptionHasBeenChanged),
content: Text(L10n.of(context).chatDescriptionHasBeenChanged),
),
);
}
@ -118,19 +118,19 @@ class ChatDetailsController extends State<ChatDetails> {
if (PlatformInfos.isMobile)
SheetAction(
key: AvatarAction.camera,
label: L10n.of(context)!.openCamera,
label: L10n.of(context).openCamera,
isDefaultAction: true,
icon: Icons.camera_alt_outlined,
),
SheetAction(
key: AvatarAction.file,
label: L10n.of(context)!.openGallery,
label: L10n.of(context).openGallery,
icon: Icons.photo_outlined,
),
if (room?.avatar != null)
SheetAction(
key: AvatarAction.remove,
label: L10n.of(context)!.delete,
label: L10n.of(context).delete,
isDestructiveAction: true,
icon: Icons.delete_outlined,
),
@ -139,7 +139,7 @@ class ChatDetailsController extends State<ChatDetails> {
? actions.single.key
: await showModalActionSheet<AvatarAction>(
context: context,
title: L10n.of(context)!.editRoomAvatar,
title: L10n.of(context).editRoomAvatar,
actions: actions,
);
if (action == null) return;

View file

@ -29,10 +29,10 @@ class ChatDetailsView extends StatelessWidget {
if (room == null) {
return Scaffold(
appBar: AppBar(
title: Text(L10n.of(context)!.oopsSomethingWentWrong),
title: Text(L10n.of(context).oopsSomethingWentWrong),
),
body: Center(
child: Text(L10n.of(context)!.youAreNoLongerParticipatingInThisChat),
child: Text(L10n.of(context).youAreNoLongerParticipatingInThisChat),
),
);
}
@ -49,7 +49,7 @@ class ChatDetailsView extends StatelessWidget {
final canRequestMoreMembers = members.length < actualMembersCount;
final iconColor = theme.textTheme.bodyLarge!.color;
final displayname = room.getLocalizedDisplayname(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
);
return Scaffold(
appBar: AppBar(
@ -59,7 +59,7 @@ class ChatDetailsView extends StatelessWidget {
actions: <Widget>[
if (room.canonicalAlias.isNotEmpty)
IconButton(
tooltip: L10n.of(context)!.share,
tooltip: L10n.of(context).share,
icon: Icon(Icons.adaptive.share_outlined),
onPressed: () => FluffyShare.share(
AppConfig.inviteLinkPrefix + room.canonicalAlias,
@ -69,7 +69,7 @@ class ChatDetailsView extends StatelessWidget {
if (controller.widget.embeddedCloseButton == null)
ChatSettingsPopupMenu(room, false),
],
title: Text(L10n.of(context)!.chatDetails),
title: Text(L10n.of(context).chatDetails),
backgroundColor: theme.appBarTheme.backgroundColor,
),
body: MaxWidthBody(
@ -150,7 +150,7 @@ class ChatDetailsView extends StatelessWidget {
),
label: Text(
room.isDirectChat
? L10n.of(context)!.directChat
? L10n.of(context).directChat
: displayname,
maxLines: 1,
overflow: TextOverflow.ellipsis,
@ -172,7 +172,7 @@ class ChatDetailsView extends StatelessWidget {
theme.colorScheme.secondary,
),
label: Text(
L10n.of(context)!.countParticipants(
L10n.of(context).countParticipants(
actualMembersCount,
),
maxLines: 1,
@ -189,7 +189,7 @@ class ChatDetailsView extends StatelessWidget {
if (!room.canChangeStateEvent(EventTypes.RoomTopic))
ListTile(
title: Text(
L10n.of(context)!.chatDescription,
L10n.of(context).chatDescription,
style: TextStyle(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
@ -201,7 +201,7 @@ class ChatDetailsView extends StatelessWidget {
padding: const EdgeInsets.all(16.0),
child: TextButton.icon(
onPressed: controller.setTopicAction,
label: Text(L10n.of(context)!.setChatDescription),
label: Text(L10n.of(context).setChatDescription),
icon: const Icon(Icons.edit_outlined),
style: TextButton.styleFrom(
backgroundColor:
@ -217,7 +217,7 @@ class ChatDetailsView extends StatelessWidget {
),
child: SelectableLinkify(
text: room.topic.isEmpty
? L10n.of(context)!.noChatDescriptionYet
? L10n.of(context).noChatDescriptionYet
: room.topic,
options: const LinkifyOptions(humanize: false),
linkStyle: const TextStyle(
@ -247,9 +247,8 @@ class ChatDetailsView extends StatelessWidget {
Icons.insert_emoticon_outlined,
),
),
title:
Text(L10n.of(context)!.customEmojisAndStickers),
subtitle: Text(L10n.of(context)!.setCustomEmotes),
title: Text(L10n.of(context).customEmojisAndStickers),
subtitle: Text(L10n.of(context).setCustomEmotes),
onTap: controller.goToEmoteSettings,
trailing: const Icon(Icons.chevron_right_outlined),
),
@ -261,10 +260,10 @@ class ChatDetailsView extends StatelessWidget {
child: const Icon(Icons.shield_outlined),
),
title: Text(
L10n.of(context)!.accessAndVisibility,
L10n.of(context).accessAndVisibility,
),
subtitle: Text(
L10n.of(context)!.accessAndVisibilityDescription,
L10n.of(context).accessAndVisibilityDescription,
),
onTap: () => context
.push('/rooms/${room.id}/details/access'),
@ -272,9 +271,9 @@ class ChatDetailsView extends StatelessWidget {
),
if (!room.isDirectChat)
ListTile(
title: Text(L10n.of(context)!.chatPermissions),
title: Text(L10n.of(context).chatPermissions),
subtitle: Text(
L10n.of(context)!.whoCanPerformWhichAction,
L10n.of(context).whoCanPerformWhichAction,
),
leading: CircleAvatar(
backgroundColor: theme.scaffoldBackgroundColor,
@ -290,7 +289,7 @@ class ChatDetailsView extends StatelessWidget {
Divider(color: theme.dividerColor),
ListTile(
title: Text(
L10n.of(context)!.countParticipants(
L10n.of(context).countParticipants(
actualMembersCount.toString(),
),
style: TextStyle(
@ -301,7 +300,7 @@ class ChatDetailsView extends StatelessWidget {
),
if (!room.isDirectChat && room.canInvite)
ListTile(
title: Text(L10n.of(context)!.inviteContact),
title: Text(L10n.of(context).inviteContact),
leading: CircleAvatar(
backgroundColor:
theme.colorScheme.primaryContainer,
@ -319,7 +318,7 @@ class ChatDetailsView extends StatelessWidget {
? ParticipantListItem(members[i - 1])
: ListTile(
title: Text(
L10n.of(context)!.loadCountMoreParticipants(
L10n.of(context).loadCountMoreParticipants(
(actualMembersCount - members.length).toString(),
),
),

View file

@ -17,17 +17,17 @@ class ParticipantListItem extends StatelessWidget {
final theme = Theme.of(context);
final membershipBatch = switch (user.membership) {
Membership.ban => L10n.of(context)!.banned,
Membership.invite => L10n.of(context)!.invited,
Membership.ban => L10n.of(context).banned,
Membership.invite => L10n.of(context).invited,
Membership.join => null,
Membership.knock => L10n.of(context)!.knocking,
Membership.leave => L10n.of(context)!.leftTheChat,
Membership.knock => L10n.of(context).knocking,
Membership.leave => L10n.of(context).leftTheChat,
};
final permissionBatch = user.powerLevel == 100
? L10n.of(context)!.admin
? L10n.of(context).admin
: user.powerLevel >= 50
? L10n.of(context)!.moderator
? L10n.of(context).moderator
: '';
return Opacity(

View file

@ -34,33 +34,33 @@ class ChatEncryptionSettingsController extends State<ChatEncryptionSettings> {
if (room.encrypted) {
showOkAlertDialog(
context: context,
title: L10n.of(context)!.sorryThatsNotPossible,
message: L10n.of(context)!.disableEncryptionWarning,
title: L10n.of(context).sorryThatsNotPossible,
message: L10n.of(context).disableEncryptionWarning,
);
return;
}
if (room.joinRules == JoinRules.public) {
showOkAlertDialog(
context: context,
title: L10n.of(context)!.sorryThatsNotPossible,
message: L10n.of(context)!.noEncryptionForPublicRooms,
title: L10n.of(context).sorryThatsNotPossible,
message: L10n.of(context).noEncryptionForPublicRooms,
);
return;
}
if (!room.canChangeStateEvent(EventTypes.Encryption)) {
showOkAlertDialog(
context: context,
title: L10n.of(context)!.sorryThatsNotPossible,
message: L10n.of(context)!.noPermission,
title: L10n.of(context).sorryThatsNotPossible,
message: L10n.of(context).noPermission,
);
return;
}
final consent = await showOkCancelAlertDialog(
context: context,
title: L10n.of(context)!.areYouSure,
message: L10n.of(context)!.enableEncryptionWarning,
okLabel: L10n.of(context)!.yes,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).areYouSure,
message: L10n.of(context).enableEncryptionWarning,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).cancel,
);
if (consent != OkCancelResult.ok) return;
await showFutureLoadingDialog(
@ -72,10 +72,10 @@ class ChatEncryptionSettingsController extends State<ChatEncryptionSettings> {
void startVerification() async {
final consent = await showOkCancelAlertDialog(
context: context,
title: L10n.of(context)!.verifyOtherUser,
message: L10n.of(context)!.verifyOtherUserDescription,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).verifyOtherUser,
message: L10n.of(context).verifyOtherUserDescription,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
fullyCapitalizedForMaterial: false,
);
if (consent != OkCancelResult.ok) return;

View file

@ -31,11 +31,11 @@ class ChatEncryptionSettingsView extends StatelessWidget {
icon: const Icon(Icons.close_outlined),
onPressed: () => context.go('/rooms/${controller.roomId!}'),
),
title: Text(L10n.of(context)!.encryption),
title: Text(L10n.of(context).encryption),
actions: [
TextButton(
onPressed: () => launchUrlString(AppConfig.encryptionTutorial),
child: Text(L10n.of(context)!.help),
child: Text(L10n.of(context).help),
),
],
),
@ -49,7 +49,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
backgroundColor: theme.colorScheme.primaryContainer,
child: const Icon(Icons.lock_outlined),
),
title: Text(L10n.of(context)!.encryptThisChat),
title: Text(L10n.of(context).encryptThisChat),
value: room.encrypted,
onChanged: controller.enableEncryption,
),
@ -67,7 +67,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
child: ElevatedButton.icon(
onPressed: controller.startVerification,
icon: const Icon(Icons.verified_outlined),
label: Text(L10n.of(context)!.verifyStart),
label: Text(L10n.of(context).verifyStart),
),
),
),
@ -75,7 +75,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
const SizedBox(height: 16),
ListTile(
title: Text(
L10n.of(context)!.deviceKeys,
L10n.of(context).deviceKeys,
style: const TextStyle(
fontWeight: FontWeight.bold,
),
@ -91,7 +91,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
if (snapshot.hasError) {
return Center(
child: Text(
'${L10n.of(context)!.oopsSomethingWentWrong}: ${snapshot.error}',
'${L10n.of(context).oopsSomethingWentWrong}: ${snapshot.error}',
),
);
}
@ -133,7 +133,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
const SizedBox(width: 4),
Text(
deviceKeys[i].deviceId ??
L10n.of(context)!.unknownDevice,
L10n.of(context).unknownDevice,
),
const SizedBox(width: 4),
Flexible(
@ -167,7 +167,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
),
subtitle: Text(
deviceKeys[i].ed25519Key?.beautified ??
L10n.of(context)!.unknownEncryptionAlgorithm,
L10n.of(context).unknownEncryptionAlgorithm,
style: TextStyle(
fontFamily: 'RobotoMono',
color: theme.colorScheme.secondary,
@ -183,7 +183,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
padding: const EdgeInsets.all(16.0),
child: Center(
child: Text(
L10n.of(context)!.encryptionNotEnabled,
L10n.of(context).encryptionNotEnabled,
style: const TextStyle(
fontStyle: FontStyle.italic,
),

View file

@ -62,15 +62,15 @@ extension LocalizedActiveFilter on ActiveFilter {
String toLocalizedString(BuildContext context) {
switch (this) {
case ActiveFilter.allChats:
return L10n.of(context)!.all;
return L10n.of(context).all;
case ActiveFilter.messages:
return L10n.of(context)!.messages;
return L10n.of(context).messages;
case ActiveFilter.unread:
return L10n.of(context)!.unread;
return L10n.of(context).unread;
case ActiveFilter.groups:
return L10n.of(context)!.groups;
return L10n.of(context).groups;
case ActiveFilter.spaces:
return L10n.of(context)!.spaces;
return L10n.of(context).spaces;
}
}
}
@ -128,25 +128,25 @@ class ChatListController extends State<ChatList>
final inviteAction = await showModalActionSheet<InviteActions>(
context: context,
message: room.isDirectChat
? L10n.of(context)!.invitePrivateChat
: L10n.of(context)!.inviteGroupChat,
title: room.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)),
? L10n.of(context).invitePrivateChat
: L10n.of(context).inviteGroupChat,
title: room.getLocalizedDisplayname(MatrixLocals(L10n.of(context))),
actions: [
SheetAction(
key: InviteActions.accept,
label: L10n.of(context)!.accept,
label: L10n.of(context).accept,
icon: Icons.check_outlined,
isDefaultAction: true,
),
SheetAction(
key: InviteActions.decline,
label: L10n.of(context)!.decline,
label: L10n.of(context).decline,
icon: Icons.close_outlined,
isDestructiveAction: true,
),
SheetAction(
key: InviteActions.block,
label: L10n.of(context)!.block,
label: L10n.of(context).block,
icon: Icons.block_outlined,
isDestructiveAction: true,
),
@ -181,7 +181,7 @@ class ChatListController extends State<ChatList>
if (room.membership == Membership.ban) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(L10n.of(context)!.youHaveBeenBannedFromThisChat),
content: Text(L10n.of(context).youHaveBeenBannedFromThisChat),
),
);
return;
@ -221,12 +221,12 @@ class ChatListController extends State<ChatList>
} else {
final consent = await showOkCancelAlertDialog(
context: context,
title: L10n.of(context)!.forward,
message: L10n.of(context)!.forwardMessageTo(
room.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)),
title: L10n.of(context).forward,
message: L10n.of(context).forwardMessageTo(
room.getLocalizedDisplayname(MatrixLocals(L10n.of(context))),
),
okLabel: L10n.of(context)!.forward,
cancelLabel: L10n.of(context)!.cancel,
okLabel: L10n.of(context).forward,
cancelLabel: L10n.of(context).cancel,
);
if (consent == OkCancelResult.cancel) {
Matrix.of(context).shareContent = null;
@ -276,10 +276,10 @@ class ChatListController extends State<ChatList>
void setServer() async {
final newServer = await showTextInputDialog(
useRootNavigator: false,
title: L10n.of(context)!.changeTheHomeserver,
title: L10n.of(context).changeTheHomeserver,
context: context,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
textFields: [
DialogTextField(
prefixText: 'https://',
@ -289,7 +289,7 @@ class ChatListController extends State<ChatList>
autocorrect: false,
validator: (server) => server?.contains('.') == true
? null
: L10n.of(context)!.invalidServerName,
: L10n.of(context).invalidServerName,
),
],
);
@ -569,7 +569,7 @@ class ChatListController extends State<ChatList>
);
final displayname =
room.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!));
room.getLocalizedDisplayname(MatrixLocals(L10n.of(context)));
final spacesWithPowerLevels = room.client.rooms
.where(
@ -618,8 +618,7 @@ class ChatListController extends State<ChatList>
const SizedBox(width: 12),
Expanded(
child: Text(
L10n.of(context)!
.goToSpace(space.getLocalizedDisplayname()),
L10n.of(context).goToSpace(space.getLocalizedDisplayname()),
),
),
],
@ -638,8 +637,8 @@ class ChatListController extends State<ChatList>
const SizedBox(width: 12),
Text(
room.pushRuleState == PushRuleState.notify
? L10n.of(context)!.muteChat
: L10n.of(context)!.unmuteChat,
? L10n.of(context).muteChat
: L10n.of(context).unmuteChat,
),
],
),
@ -657,8 +656,8 @@ class ChatListController extends State<ChatList>
const SizedBox(width: 12),
Text(
room.markedUnread
? L10n.of(context)!.markAsRead
: L10n.of(context)!.markAsUnread,
? L10n.of(context).markAsRead
: L10n.of(context).markAsUnread,
),
],
),
@ -672,8 +671,8 @@ class ChatListController extends State<ChatList>
const SizedBox(width: 12),
Text(
room.isFavourite
? L10n.of(context)!.unpin
: L10n.of(context)!.pin,
? L10n.of(context).unpin
: L10n.of(context).pin,
),
],
),
@ -686,7 +685,7 @@ class ChatListController extends State<ChatList>
children: [
const Icon(Icons.group_work_outlined),
const SizedBox(width: 12),
Text(L10n.of(context)!.addToSpace),
Text(L10n.of(context).addToSpace),
],
),
),
@ -697,7 +696,7 @@ class ChatListController extends State<ChatList>
children: [
const Icon(Icons.delete_outlined),
const SizedBox(width: 12),
Text(L10n.of(context)!.leave),
Text(L10n.of(context).leave),
],
),
),
@ -740,10 +739,10 @@ class ChatListController extends State<ChatList>
final confirmed = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.leave,
cancelLabel: L10n.of(context)!.no,
message: L10n.of(context)!.archiveRoomDescription,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).leave,
cancelLabel: L10n.of(context).no,
message: L10n.of(context).archiveRoomDescription,
isDestructiveAction: true,
);
if (confirmed == OkCancelResult.cancel) return;
@ -755,13 +754,13 @@ class ChatListController extends State<ChatList>
case ChatContextAction.addToSpace:
final space = await showConfirmationDialog(
context: context,
title: L10n.of(context)!.space,
title: L10n.of(context).space,
actions: spacesWithPowerLevels
.map(
(space) => AlertDialogAction(
key: space,
label: space
.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)),
.getLocalizedDisplayname(MatrixLocals(L10n.of(context))),
),
)
.toList(),
@ -776,7 +775,7 @@ class ChatListController extends State<ChatList>
void dismissStatusList() async {
final result = await showOkCancelAlertDialog(
title: L10n.of(context)!.hidePresences,
title: L10n.of(context).hidePresences,
context: context,
);
if (result == OkCancelResult.ok) {
@ -792,13 +791,13 @@ class ChatListController extends State<ChatList>
final input = await showTextInputDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.setStatus,
message: L10n.of(context)!.leaveEmptyToClearStatus,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).setStatus,
message: L10n.of(context).leaveEmptyToClearStatus,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
textFields: [
DialogTextField(
hintText: L10n.of(context)!.statusExampleMessage,
hintText: L10n.of(context).statusExampleMessage,
maxLines: 6,
minLines: 1,
maxLength: 255,
@ -880,22 +879,22 @@ class ChatListController extends State<ChatList>
}
void editBundlesForAccount(String? userId, String? activeBundle) async {
final l10n = L10n.of(context)!;
final l10n = L10n.of(context);
final client = Matrix.of(context)
.widget
.clients[Matrix.of(context).getClientIndexByMatrixId(userId!)];
final action = await showConfirmationDialog<EditBundleAction>(
context: context,
title: L10n.of(context)!.editBundlesForAccount,
title: L10n.of(context).editBundlesForAccount,
actions: [
AlertDialogAction(
key: EditBundleAction.addToBundle,
label: L10n.of(context)!.addToBundle,
label: L10n.of(context).addToBundle,
),
if (activeBundle != client.userID)
AlertDialogAction(
key: EditBundleAction.removeFromBundle,
label: L10n.of(context)!.removeFromBundle,
label: L10n.of(context).removeFromBundle,
),
],
);

View file

@ -83,17 +83,17 @@ class ChatListViewBody extends StatelessWidget {
[
if (controller.isSearchMode) ...[
SearchTitle(
title: L10n.of(context)!.publicRooms,
title: L10n.of(context).publicRooms,
icon: const Icon(Icons.explore_outlined),
),
PublicRoomsHorizontalList(publicRooms: publicRooms),
SearchTitle(
title: L10n.of(context)!.publicSpaces,
title: L10n.of(context).publicSpaces,
icon: const Icon(Icons.workspaces_outlined),
),
PublicRoomsHorizontalList(publicRooms: publicSpaces),
SearchTitle(
title: L10n.of(context)!.users,
title: L10n.of(context).users,
icon: const Icon(Icons.group_outlined),
),
AnimatedContainer(
@ -115,7 +115,7 @@ class ChatListViewBody extends StatelessWidget {
userSearchResult.results[i].displayName ??
userSearchResult
.results[i].userId.localpart ??
L10n.of(context)!.unknownDevice,
L10n.of(context).unknownDevice,
avatar: userSearchResult.results[i].avatarUrl,
onPressed: () => showAdaptiveBottomSheet(
context: context,
@ -146,8 +146,8 @@ class ChatListViewBody extends StatelessWidget {
color: theme.colorScheme.surface,
child: ListTile(
leading: const Icon(Icons.vpn_key),
title: Text(L10n.of(context)!.dehydrateTor),
subtitle: Text(L10n.of(context)!.dehydrateTorLong),
title: Text(L10n.of(context).dehydrateTor),
subtitle: Text(L10n.of(context).dehydrateTorLong),
trailing: const Icon(Icons.chevron_right_outlined),
onTap: controller.dehydrate,
),
@ -231,7 +231,7 @@ class ChatListViewBody extends StatelessWidget {
),
if (controller.isSearchMode)
SearchTitle(
title: L10n.of(context)!.chats,
title: L10n.of(context).chats,
icon: const Icon(Icons.forum_outlined),
),
if (client.prevBatch != null &&
@ -267,8 +267,8 @@ class ChatListViewBody extends StatelessWidget {
padding: const EdgeInsets.all(16.0),
child: Text(
client.rooms.isEmpty
? L10n.of(context)!.noChatsFoundHere
: L10n.of(context)!.noMoreChatsFound,
? L10n.of(context).noChatsFoundHere
: L10n.of(context).noMoreChatsFound,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
@ -343,7 +343,7 @@ class PublicRoomsHorizontalList extends StatelessWidget {
itemBuilder: (context, i) => _SearchItem(
title: publicRooms[i].name ??
publicRooms[i].canonicalAlias?.localpart ??
L10n.of(context)!.group,
L10n.of(context).group,
avatar: publicRooms[i].avatarUrl,
onPressed: () => showAdaptiveBottomSheet(
context: context,

View file

@ -35,14 +35,14 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget {
leading: selectMode == SelectMode.normal
? null
: IconButton(
tooltip: L10n.of(context)!.cancel,
tooltip: L10n.of(context).cancel,
icon: const Icon(Icons.close_outlined),
onPressed: controller.cancelAction,
color: theme.colorScheme.primary,
),
title: selectMode == SelectMode.share
? Text(
L10n.of(context)!.share,
L10n.of(context).share,
key: const ValueKey(SelectMode.share),
)
: TextField(
@ -61,7 +61,7 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget {
borderRadius: BorderRadius.circular(99),
),
contentPadding: EdgeInsets.zero,
hintText: L10n.of(context)!.searchChatsRooms,
hintText: L10n.of(context).searchChatsRooms,
hintStyle: TextStyle(
color: theme.colorScheme.onPrimaryContainer,
fontWeight: FontWeight.normal,
@ -69,7 +69,7 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget {
floatingLabelBehavior: FloatingLabelBehavior.never,
prefixIcon: controller.isSearchMode
? IconButton(
tooltip: L10n.of(context)!.cancel,
tooltip: L10n.of(context).cancel,
icon: const Icon(Icons.close_outlined),
onPressed: controller.cancelSearch,
color: theme.colorScheme.onPrimaryContainer,

View file

@ -47,10 +47,10 @@ class ChatListItem extends StatelessWidget {
final confirmed = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.yes,
cancelLabel: L10n.of(context)!.no,
message: L10n.of(context)!.archiveRoomDescription,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).no,
message: L10n.of(context).archiveRoomDescription,
);
if (confirmed == OkCancelResult.cancel) return;
await showFutureLoadingDialog(
@ -81,7 +81,7 @@ class ChatListItem extends StatelessWidget {
final backgroundColor =
activeChat ? theme.colorScheme.secondaryContainer : null;
final displayname = room.getLocalizedDisplayname(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
);
final filter = this.filter;
if (filter != null && !displayname.toLowerCase().contains(filter)) {
@ -272,7 +272,7 @@ class ChatListItem extends StatelessWidget {
Expanded(
child: room.isSpace && room.membership == Membership.join
? Text(
L10n.of(context)!.countChatsAndCountParticipants(
L10n.of(context).countChatsAndCountParticipants(
room.spaceChildren.length.toString(),
(room.summary.mJoinedMemberCount ?? 1).toString(),
),
@ -292,7 +292,7 @@ class ChatListItem extends StatelessWidget {
),
future: needLastEventSender
? lastEvent.calcLocalizedBody(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
hideReply: true,
hideEdit: true,
plaintextBody: true,
@ -304,7 +304,7 @@ class ChatListItem extends StatelessWidget {
: null,
initialData:
lastEvent?.calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
hideReply: true,
hideEdit: true,
plaintextBody: true,
@ -316,10 +316,10 @@ class ChatListItem extends StatelessWidget {
builder: (context, snapshot) => Text(
room.membership == Membership.invite
? isDirectChat
? L10n.of(context)!.invitePrivateChat
: L10n.of(context)!.inviteGroupChat
? L10n.of(context).invitePrivateChat
: L10n.of(context).inviteGroupChat
: snapshot.data ??
L10n.of(context)!.emptyChat,
L10n.of(context).emptyChat,
softWrap: false,
maxLines: 1,
overflow: TextOverflow.ellipsis,

View file

@ -85,7 +85,7 @@ class ChatListView extends StatelessWidget {
onTap: controller.clearActiveSpace,
icon: const Icon(Icons.forum_outlined),
selectedIcon: const Icon(Icons.forum),
toolTip: L10n.of(context)!.chats,
toolTip: L10n.of(context).chats,
unreadBadgeFilter: (room) => true,
);
}
@ -95,13 +95,13 @@ class ChatListView extends StatelessWidget {
isSelected: false,
onTap: () => context.go('/rooms/newspace'),
icon: const Icon(Icons.add),
toolTip: L10n.of(context)!.createNewSpace,
toolTip: L10n.of(context).createNewSpace,
);
}
final space = rootSpaces[i];
final displayname =
rootSpaces[i].getLocalizedDisplayname(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
);
final spaceChildrenIds =
space.spaceChildren.map((c) => c.roomId).toSet();
@ -144,7 +144,7 @@ class ChatListView extends StatelessWidget {
LogicalKeyboardKey.keyN,
},
onKeysPressed: () => context.go('/rooms/newprivatechat'),
helpLabel: L10n.of(context)!.newChat,
helpLabel: L10n.of(context).newChat,
child: selectMode == SelectMode.normal &&
!controller.isSearchMode &&
controller.activeSpaceId == null
@ -153,7 +153,7 @@ class ChatListView extends StatelessWidget {
context.go('/rooms/newprivatechat'),
icon: const Icon(Icons.add_outlined),
label: Text(
L10n.of(context)!.chat,
L10n.of(context).chat,
overflow: TextOverflow.fade,
),
)

View file

@ -34,7 +34,7 @@ class ClientChooserButton extends StatelessWidget {
children: [
const Icon(Icons.group_add_outlined),
const SizedBox(width: 18),
Text(L10n.of(context)!.createGroup),
Text(L10n.of(context).createGroup),
],
),
),
@ -44,7 +44,7 @@ class ClientChooserButton extends StatelessWidget {
children: [
const Icon(Icons.workspaces_outlined),
const SizedBox(width: 18),
Text(L10n.of(context)!.createNewSpace),
Text(L10n.of(context).createNewSpace),
],
),
),
@ -54,7 +54,7 @@ class ClientChooserButton extends StatelessWidget {
children: [
const Icon(Icons.edit_outlined),
const SizedBox(width: 18),
Text(L10n.of(context)!.setStatus),
Text(L10n.of(context).setStatus),
],
),
),
@ -64,7 +64,7 @@ class ClientChooserButton extends StatelessWidget {
children: [
Icon(Icons.adaptive.share_outlined),
const SizedBox(width: 18),
Text(L10n.of(context)!.inviteContact),
Text(L10n.of(context).inviteContact),
],
),
),
@ -86,7 +86,7 @@ class ClientChooserButton extends StatelessWidget {
children: [
const Icon(Icons.settings_outlined),
const SizedBox(width: 18),
Text(L10n.of(context)!.settings),
Text(L10n.of(context).settings),
],
),
),
@ -156,7 +156,7 @@ class ClientChooserButton extends StatelessWidget {
children: [
const Icon(Icons.person_add_outlined),
const SizedBox(width: 18),
Text(L10n.of(context)!.addAccount),
Text(L10n.of(context).addAccount),
],
),
),
@ -178,7 +178,7 @@ class ClientChooserButton extends StatelessWidget {
clientCount,
(index) => KeyBoardShortcuts(
keysToPress: _buildKeyboardShortcut(index + 1),
helpLabel: L10n.of(context)!.switchToAccount(index + 1),
helpLabel: L10n.of(context).switchToAccount(index + 1),
onKeysPressed: () => _handleKeyboardShortcut(
matrix,
index,
@ -192,7 +192,7 @@ class ClientChooserButton extends StatelessWidget {
LogicalKeyboardKey.controlLeft,
LogicalKeyboardKey.tab,
},
helpLabel: L10n.of(context)!.nextAccount,
helpLabel: L10n.of(context).nextAccount,
onKeysPressed: () => _nextAccount(matrix, context),
child: const SizedBox.shrink(),
),
@ -202,7 +202,7 @@ class ClientChooserButton extends StatelessWidget {
LogicalKeyboardKey.shiftLeft,
LogicalKeyboardKey.tab,
},
helpLabel: L10n.of(context)!.previousAccount,
helpLabel: L10n.of(context).previousAccount,
onKeysPressed: () => _previousAccount(matrix, context),
child: const SizedBox.shrink(),
),
@ -249,10 +249,10 @@ class ClientChooserButton extends StatelessWidget {
case SettingsAction.addAccount:
final consent = await showOkCancelAlertDialog(
context: context,
title: L10n.of(context)!.addAccount,
message: L10n.of(context)!.enableMultiAccounts,
okLabel: L10n.of(context)!.next,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).addAccount,
message: L10n.of(context).enableMultiAccounts,
okLabel: L10n.of(context).next,
cancelLabel: L10n.of(context).cancel,
);
if (consent != OkCancelResult.ok) return;
context.go('/rooms/settings/addaccount');

View file

@ -132,10 +132,10 @@ class _SpaceViewState extends State<SpaceView> {
final confirmed = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
message: L10n.of(context)!.archiveRoomDescription,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
message: L10n.of(context).archiveRoomDescription,
);
if (!mounted) return;
if (confirmed != OkCancelResult.ok) return;
@ -153,15 +153,15 @@ class _SpaceViewState extends State<SpaceView> {
void _addChatOrSubspace() async {
final roomType = await showConfirmationDialog(
context: context,
title: L10n.of(context)!.addChatOrSubSpace,
title: L10n.of(context).addChatOrSubSpace,
actions: [
AlertDialogAction(
key: AddRoomType.subspace,
label: L10n.of(context)!.createNewSpace,
label: L10n.of(context).createNewSpace,
),
AlertDialogAction(
key: AddRoomType.chat,
label: L10n.of(context)!.createGroup,
label: L10n.of(context).createGroup,
),
],
);
@ -170,32 +170,32 @@ class _SpaceViewState extends State<SpaceView> {
final names = await showTextInputDialog(
context: context,
title: roomType == AddRoomType.subspace
? L10n.of(context)!.createNewSpace
: L10n.of(context)!.createGroup,
? L10n.of(context).createNewSpace
: L10n.of(context).createGroup,
textFields: [
DialogTextField(
hintText: roomType == AddRoomType.subspace
? L10n.of(context)!.spaceName
: L10n.of(context)!.groupName,
? L10n.of(context).spaceName
: L10n.of(context).groupName,
minLines: 1,
maxLines: 1,
maxLength: 64,
validator: (text) {
if (text == null || text.isEmpty) {
return L10n.of(context)!.pleaseChoose;
return L10n.of(context).pleaseChoose;
}
return null;
},
),
DialogTextField(
hintText: L10n.of(context)!.chatDescription,
hintText: L10n.of(context).chatDescription,
minLines: 4,
maxLines: 8,
maxLength: 255,
),
],
okLabel: L10n.of(context)!.create,
cancelLabel: L10n.of(context)!.cancel,
okLabel: L10n.of(context).create,
cancelLabel: L10n.of(context).cancel,
);
if (names == null) return;
final client = Matrix.of(context).client;
@ -245,7 +245,7 @@ class _SpaceViewState extends State<SpaceView> {
final room = Matrix.of(context).client.getRoomById(widget.spaceId);
final displayname =
room?.getLocalizedDisplayname() ?? L10n.of(context)!.nothingFound;
room?.getLocalizedDisplayname() ?? L10n.of(context).nothingFound;
return Scaffold(
appBar: AppBar(
leading: Center(
@ -269,7 +269,7 @@ class _SpaceViewState extends State<SpaceView> {
subtitle: room == null
? null
: Text(
L10n.of(context)!.countChatsAndCountParticipants(
L10n.of(context).countChatsAndCountParticipants(
room.spaceChildren.length,
room.summary.mJoinedMemberCount ?? 1,
),
@ -288,7 +288,7 @@ class _SpaceViewState extends State<SpaceView> {
children: [
const Icon(Icons.settings_outlined),
const SizedBox(width: 12),
Text(L10n.of(context)!.settings),
Text(L10n.of(context).settings),
],
),
),
@ -299,7 +299,7 @@ class _SpaceViewState extends State<SpaceView> {
children: [
const Icon(Icons.person_add_outlined),
const SizedBox(width: 12),
Text(L10n.of(context)!.invite),
Text(L10n.of(context).invite),
],
),
),
@ -310,7 +310,7 @@ class _SpaceViewState extends State<SpaceView> {
children: [
const Icon(Icons.delete_outlined),
const SizedBox(width: 12),
Text(L10n.of(context)!.leave),
Text(L10n.of(context).leave),
],
),
),
@ -368,7 +368,7 @@ class _SpaceViewState extends State<SpaceView> {
borderRadius: BorderRadius.circular(99),
),
contentPadding: EdgeInsets.zero,
hintText: L10n.of(context)!.search,
hintText: L10n.of(context).search,
hintStyle: TextStyle(
color: theme.colorScheme.onPrimaryContainer,
fontWeight: FontWeight.normal,
@ -453,7 +453,7 @@ class _SpaceViewState extends State<SpaceView> {
child: Icon(Icons.add_outlined),
),
title: Text(
L10n.of(context)!.addChatOrSubSpace,
L10n.of(context).addChatOrSubSpace,
style: const TextStyle(fontSize: 14),
),
),
@ -461,7 +461,7 @@ class _SpaceViewState extends State<SpaceView> {
),
],
SearchTitle(
title: L10n.of(context)!.joinedChats,
title: L10n.of(context).joinedChats,
icon: const Icon(Icons.chat_outlined),
),
],
@ -486,7 +486,7 @@ class _SpaceViewState extends State<SpaceView> {
itemBuilder: (context, i) {
if (i == 0) {
return SearchTitle(
title: L10n.of(context)!.discover,
title: L10n.of(context).discover,
icon: const Icon(Icons.explore_outlined),
);
}
@ -497,7 +497,7 @@ class _SpaceViewState extends State<SpaceView> {
padding: const EdgeInsets.all(12.0),
child: Center(
child: Text(
L10n.of(context)!.noMoreChatsFound,
L10n.of(context).noMoreChatsFound,
style: const TextStyle(fontSize: 13),
),
),
@ -516,14 +516,14 @@ class _SpaceViewState extends State<SpaceView> {
AppConfig.borderRadius,
),
)
: Text(L10n.of(context)!.loadMore),
: Text(L10n.of(context).loadMore),
),
);
}
final item = _discoveredChildren[i];
final displayname = item.name ??
item.canonicalAlias ??
L10n.of(context)!.emptyChat;
L10n.of(context).emptyChat;
if (!displayname.toLowerCase().contains(filter)) {
return const SizedBox.shrink();
}
@ -564,7 +564,7 @@ class _SpaceViewState extends State<SpaceView> {
),
subtitle: Text(
item.topic ??
L10n.of(context)!.countParticipants(
L10n.of(context).countParticipants(
item.numJoinedMembers,
),
maxLines: 1,

View file

@ -20,10 +20,10 @@ class ChatMembersView extends StatelessWidget {
if (room == null) {
return Scaffold(
appBar: AppBar(
title: Text(L10n.of(context)!.oopsSomethingWentWrong),
title: Text(L10n.of(context).oopsSomethingWentWrong),
),
body: Center(
child: Text(L10n.of(context)!.youAreNoLongerParticipatingInThisChat),
child: Text(L10n.of(context).youAreNoLongerParticipatingInThisChat),
),
);
}
@ -40,7 +40,7 @@ class ChatMembersView extends StatelessWidget {
appBar: AppBar(
leading: const Center(child: BackButton()),
title: Text(
L10n.of(context)!.countParticipants(roomCount),
L10n.of(context).countParticipants(roomCount),
),
actions: [
if (room.canInvite)
@ -68,7 +68,7 @@ class ChatMembersView extends StatelessWidget {
OutlinedButton.icon(
onPressed: controller.refreshMembers,
icon: const Icon(Icons.refresh_outlined),
label: Text(L10n.of(context)!.tryAgain),
label: Text(L10n.of(context).tryAgain),
),
],
),
@ -102,7 +102,7 @@ class ChatMembersView extends StatelessWidget {
fontWeight: FontWeight.normal,
),
prefixIcon: const Icon(Icons.search_outlined),
hintText: L10n.of(context)!.search,
hintText: L10n.of(context).search,
),
),
)

View file

@ -31,7 +31,7 @@ class ChatPermissionsSettingsController extends State<ChatPermissionsSettings> {
final room = Matrix.of(context).client.getRoomById(roomId!)!;
if (!room.canSendEvent(EventTypes.RoomPowerLevels)) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(L10n.of(context)!.noPermission)),
SnackBar(content: Text(L10n.of(context).noPermission)),
);
return;
}

View file

@ -20,7 +20,7 @@ class ChatPermissionsSettingsView extends StatelessWidget {
return Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
title: Text(L10n.of(context)!.chatPermissions),
title: Text(L10n.of(context).chatPermissions),
),
body: MaxWidthBody(
child: StreamBuilder(
@ -31,7 +31,7 @@ class ChatPermissionsSettingsView extends StatelessWidget {
? null
: Matrix.of(context).client.getRoomById(roomId);
if (room == null) {
return Center(child: Text(L10n.of(context)!.noRoomsFound));
return Center(child: Text(L10n.of(context).noRoomsFound));
}
final powerLevelsContent = Map<String, Object?>.from(
room.getState(EventTypes.RoomPowerLevels)?.content ?? {},
@ -46,13 +46,13 @@ class ChatPermissionsSettingsView extends StatelessWidget {
ListTile(
leading: const Icon(Icons.info_outlined),
subtitle: Text(
L10n.of(context)!.chatPermissionsDescription,
L10n.of(context).chatPermissionsDescription,
),
),
Divider(color: theme.dividerColor),
ListTile(
title: Text(
L10n.of(context)!.chatPermissions,
L10n.of(context).chatPermissions,
style: TextStyle(
color: theme.colorScheme.primary,
fontWeight: FontWeight.bold,
@ -77,7 +77,7 @@ class ChatPermissionsSettingsView extends StatelessWidget {
Divider(color: theme.dividerColor),
ListTile(
title: Text(
L10n.of(context)!.notifications,
L10n.of(context).notifications,
style: TextStyle(
color: theme.colorScheme.primary,
fontWeight: FontWeight.bold,
@ -112,7 +112,7 @@ class ChatPermissionsSettingsView extends StatelessWidget {
Divider(color: theme.dividerColor),
ListTile(
title: Text(
L10n.of(context)!.configureChat,
L10n.of(context).configureChat,
style: TextStyle(
color: theme.colorScheme.primary,
fontWeight: FontWeight.bold,

View file

@ -25,45 +25,45 @@ class PermissionsListTile extends StatelessWidget {
if (category == null) {
switch (permissionKey) {
case 'users_default':
return L10n.of(context)!.defaultPermissionLevel;
return L10n.of(context).defaultPermissionLevel;
case 'events_default':
return L10n.of(context)!.sendMessages;
return L10n.of(context).sendMessages;
case 'state_default':
return L10n.of(context)!.changeGeneralChatSettings;
return L10n.of(context).changeGeneralChatSettings;
case 'ban':
return L10n.of(context)!.banFromChat;
return L10n.of(context).banFromChat;
case 'kick':
return L10n.of(context)!.kickFromChat;
return L10n.of(context).kickFromChat;
case 'redact':
return L10n.of(context)!.deleteMessage;
return L10n.of(context).deleteMessage;
case 'invite':
return L10n.of(context)!.inviteOtherUsers;
return L10n.of(context).inviteOtherUsers;
}
} else if (category == 'notifications') {
switch (permissionKey) {
case 'rooms':
return L10n.of(context)!.sendRoomNotifications;
return L10n.of(context).sendRoomNotifications;
}
} else if (category == 'events') {
switch (permissionKey) {
case EventTypes.RoomName:
return L10n.of(context)!.changeTheNameOfTheGroup;
return L10n.of(context).changeTheNameOfTheGroup;
case EventTypes.RoomTopic:
return L10n.of(context)!.changeTheDescriptionOfTheGroup;
return L10n.of(context).changeTheDescriptionOfTheGroup;
case EventTypes.RoomPowerLevels:
return L10n.of(context)!.changeTheChatPermissions;
return L10n.of(context).changeTheChatPermissions;
case EventTypes.HistoryVisibility:
return L10n.of(context)!.changeTheVisibilityOfChatHistory;
return L10n.of(context).changeTheVisibilityOfChatHistory;
case EventTypes.RoomCanonicalAlias:
return L10n.of(context)!.changeTheCanonicalRoomAlias;
return L10n.of(context).changeTheCanonicalRoomAlias;
case EventTypes.RoomAvatar:
return L10n.of(context)!.editRoomAvatar;
return L10n.of(context).editRoomAvatar;
case EventTypes.RoomTombstone:
return L10n.of(context)!.replaceRoomWithNewerVersion;
return L10n.of(context).replaceRoomWithNewerVersion;
case EventTypes.Encryption:
return L10n.of(context)!.enableEncryption;
return L10n.of(context).enableEncryption;
case 'm.room.server_acl':
return L10n.of(context)!.editBlockedServers;
return L10n.of(context).editBlockedServers;
}
}
return permissionKey;
@ -96,13 +96,13 @@ class PermissionsListTile extends StatelessWidget {
DropdownMenuItem(
value: permission < 50 ? permission : 0,
child: Text(
L10n.of(context)!.userLevel(permission < 50 ? permission : 0),
L10n.of(context).userLevel(permission < 50 ? permission : 0),
),
),
DropdownMenuItem(
value: permission < 100 && permission >= 50 ? permission : 50,
child: Text(
L10n.of(context)!.moderatorLevel(
L10n.of(context).moderatorLevel(
permission < 100 && permission >= 50 ? permission : 50,
),
),
@ -110,13 +110,13 @@ class PermissionsListTile extends StatelessWidget {
DropdownMenuItem(
value: permission >= 100 ? permission : 100,
child: Text(
L10n.of(context)!
L10n.of(context)
.adminLevel(permission >= 100 ? permission : 100),
),
),
DropdownMenuItem(
value: null,
child: Text(L10n.of(context)!.custom),
child: Text(L10n.of(context).custom),
),
],
),

View file

@ -37,9 +37,9 @@ class ChatSearchFilesTab extends StatelessWidget {
const CircularProgressIndicator.adaptive(strokeWidth: 2),
const SizedBox(height: 8),
Text(
L10n.of(context)!.searchIn(
L10n.of(context).searchIn(
room.getLocalizedDisplayname(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
),
),
),
@ -53,7 +53,7 @@ class ChatSearchFilesTab extends StatelessWidget {
children: [
const Icon(Icons.file_present_outlined, size: 64),
const SizedBox(height: 8),
Text(L10n.of(context)!.nothingFound),
Text(L10n.of(context).nothingFound),
],
);
}
@ -93,7 +93,7 @@ class ChatSearchFilesTab extends StatelessWidget {
icon: const Icon(
Icons.arrow_downward_outlined,
),
label: Text(L10n.of(context)!.searchMore),
label: Text(L10n.of(context).searchMore),
),
),
);
@ -101,7 +101,7 @@ class ChatSearchFilesTab extends StatelessWidget {
final event = events[i];
final filename = event.content.tryGet<String>('filename') ??
event.content.tryGet<String>('body') ??
L10n.of(context)!.unknownEvent('File');
L10n.of(context).unknownEvent('File');
final filetype = (filename.contains('.')
? filename.split('.').last.toUpperCase()
: event.content

View file

@ -37,9 +37,9 @@ class ChatSearchImagesTab extends StatelessWidget {
const CircularProgressIndicator.adaptive(strokeWidth: 2),
const SizedBox(height: 8),
Text(
L10n.of(context)!.searchIn(
L10n.of(context).searchIn(
room.getLocalizedDisplayname(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
),
),
),
@ -52,7 +52,7 @@ class ChatSearchImagesTab extends StatelessWidget {
children: [
const Icon(Icons.photo_outlined, size: 64),
const SizedBox(height: 8),
Text(L10n.of(context)!.nothingFound),
Text(L10n.of(context).nothingFound),
],
);
}
@ -102,7 +102,7 @@ class ChatSearchImagesTab extends StatelessWidget {
icon: const Icon(
Icons.arrow_downward_outlined,
),
label: Text(L10n.of(context)!.searchMore),
label: Text(L10n.of(context).searchMore),
),
),
);

View file

@ -41,9 +41,9 @@ class ChatSearchMessageTab extends StatelessWidget {
const Icon(Icons.search_outlined, size: 64),
const SizedBox(height: 8),
Text(
L10n.of(context)!.searchIn(
L10n.of(context).searchIn(
room.getLocalizedDisplayname(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
),
),
),
@ -90,7 +90,7 @@ class ChatSearchMessageTab extends StatelessWidget {
icon: const Icon(
Icons.arrow_downward_outlined,
),
label: Text(L10n.of(context)!.searchMore),
label: Text(L10n.of(context).searchMore),
),
),
);
@ -98,7 +98,7 @@ class ChatSearchMessageTab extends StatelessWidget {
final event = events[i];
final sender = event.senderFromMemoryOrFallback;
final displayname = sender.calcDisplayname(
i18n: MatrixLocals(L10n.of(context)!),
i18n: MatrixLocals(L10n.of(context)),
);
return _MessageSearchResultListTile(
sender: sender,
@ -164,7 +164,7 @@ class _MessageSearchResultListTile extends StatelessWidget {
plaintextBody: true,
removeMarkdown: true,
MatrixLocals(
L10n.of(context)!,
L10n.of(context),
),
)
.trim(),

View file

@ -20,12 +20,11 @@ class ChatSearchView extends StatelessWidget {
final room = controller.room;
if (room == null) {
return Scaffold(
appBar: AppBar(title: Text(L10n.of(context)!.oopsSomethingWentWrong)),
appBar: AppBar(title: Text(L10n.of(context).oopsSomethingWentWrong)),
body: Center(
child: Padding(
padding: const EdgeInsets.all(16),
child:
Text(L10n.of(context)!.youAreNoLongerParticipatingInThisChat),
child: Text(L10n.of(context).youAreNoLongerParticipatingInThisChat),
),
),
);
@ -38,8 +37,8 @@ class ChatSearchView extends StatelessWidget {
leading: const Center(child: BackButton()),
titleSpacing: 0,
title: Text(
L10n.of(context)!.searchIn(
room.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)),
L10n.of(context).searchIn(
room.getLocalizedDisplayname(MatrixLocals(L10n.of(context))),
),
),
),
@ -59,7 +58,7 @@ class ChatSearchView extends StatelessWidget {
autofocus: true,
enabled: controller.tabController.index == 0,
decoration: InputDecoration(
hintText: L10n.of(context)!.search,
hintText: L10n.of(context).search,
suffixIcon: const Icon(Icons.search_outlined),
filled: true,
fillColor: theme.colorScheme.secondaryContainer,
@ -77,9 +76,9 @@ class ChatSearchView extends StatelessWidget {
TabBar(
controller: controller.tabController,
tabs: [
Tab(child: Text(L10n.of(context)!.messages)),
Tab(child: Text(L10n.of(context)!.gallery)),
Tab(child: Text(L10n.of(context)!.files)),
Tab(child: Text(L10n.of(context).messages)),
Tab(child: Text(L10n.of(context).gallery)),
Tab(child: Text(L10n.of(context).files)),
],
),
Expanded(

View file

@ -35,10 +35,10 @@ class DevicesSettingsController extends State<DevicesSettings> {
void removeDevicesAction(List<Device> devices) async {
if (await showOkCancelAlertDialog(
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.yes,
cancelLabel: L10n.of(context)!.cancel,
message: L10n.of(context)!.removeDevicesDescription,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).cancel,
message: L10n.of(context).removeDevicesDescription,
) ==
OkCancelResult.cancel) return;
final matrix = Matrix.of(context);
@ -70,9 +70,9 @@ class DevicesSettingsController extends State<DevicesSettings> {
void renameDeviceAction(Device device) async {
final displayName = await showTextInputDialog(
context: context,
title: L10n.of(context)!.changeDeviceName,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).changeDeviceName,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
textFields: [
DialogTextField(
hintText: device.displayName,
@ -94,10 +94,10 @@ class DevicesSettingsController extends State<DevicesSettings> {
void verifyDeviceAction(Device device) async {
final consent = await showOkCancelAlertDialog(
context: context,
title: L10n.of(context)!.verifyOtherDevice,
message: L10n.of(context)!.verifyOtherDeviceDescription,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).verifyOtherDevice,
message: L10n.of(context).verifyOtherDeviceDescription,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
fullyCapitalizedForMaterial: false,
);
if (consent != OkCancelResult.ok) return;

View file

@ -16,7 +16,7 @@ class DevicesSettingsView extends StatelessWidget {
return Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
title: Text(L10n.of(context)!.devices),
title: Text(L10n.of(context).devices),
),
body: MaxWidthBody(
child: FutureBuilder<bool>(
@ -56,7 +56,7 @@ class DevicesSettingsView extends StatelessWidget {
),
alignment: Alignment.centerLeft,
child: Text(
L10n.of(context)!.thisDevice,
L10n.of(context).thisDevice,
style: TextStyle(
fontWeight: FontWeight.bold,
color: theme.colorScheme.primary,
@ -84,7 +84,7 @@ class DevicesSettingsView extends StatelessWidget {
child: TextButton.icon(
label: Text(
controller.errorDeletingDevices ??
L10n.of(context)!.removeAllOtherDevices,
L10n.of(context).removeAllOtherDevices,
),
style: TextButton.styleFrom(
foregroundColor:
@ -109,7 +109,7 @@ class DevicesSettingsView extends StatelessWidget {
Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text(L10n.of(context)!.noOtherDevicesFound),
child: Text(L10n.of(context).noOtherDevicesFound),
),
),
],

View file

@ -55,30 +55,30 @@ class UserDeviceListItem extends StatelessWidget {
actions: [
SheetAction(
key: UserDeviceListItemAction.rename,
label: L10n.of(context)!.changeDeviceName,
label: L10n.of(context).changeDeviceName,
),
if (!isOwnDevice && keys != null) ...{
SheetAction(
key: UserDeviceListItemAction.verify,
label: L10n.of(context)!.verifyStart,
label: L10n.of(context).verifyStart,
),
if (!keys.blocked)
SheetAction(
key: UserDeviceListItemAction.block,
label: L10n.of(context)!.blockDevice,
label: L10n.of(context).blockDevice,
isDestructiveAction: true,
),
if (keys.blocked)
SheetAction(
key: UserDeviceListItemAction.unblock,
label: L10n.of(context)!.unblockDevice,
label: L10n.of(context).unblockDevice,
isDestructiveAction: true,
),
},
if (!isOwnDevice)
SheetAction(
key: UserDeviceListItemAction.remove,
label: L10n.of(context)!.delete,
label: L10n.of(context).delete,
isDestructiveAction: true,
),
],
@ -119,7 +119,7 @@ class UserDeviceListItem extends StatelessWidget {
overflow: TextOverflow.ellipsis,
),
subtitle: Text(
L10n.of(context)!.lastActiveAgo(
L10n.of(context).lastActiveAgo(
DateTime.fromMillisecondsSinceEpoch(userDevice.lastSeenTs ?? 0)
.localizedTimeShort(context),
),
@ -129,10 +129,10 @@ class UserDeviceListItem extends StatelessWidget {
? null
: Text(
keys.blocked
? L10n.of(context)!.blocked
? L10n.of(context).blocked
: keys.verified
? L10n.of(context)!.verified
: L10n.of(context)!.unverified,
? L10n.of(context).verified
: L10n.of(context).unverified,
style: TextStyle(
color: keys.blocked
? Colors.red

View file

@ -134,7 +134,7 @@ class MyCallingPage extends State<Calling> {
Room? get room => call.room;
String get displayName => call.room.getLocalizedDisplayname(
MatrixLocals(L10n.of(widget.context)!),
MatrixLocals(L10n.of(widget.context)),
);
String get callId => widget.callId;
@ -296,14 +296,14 @@ class MyCallingPage extends State<Calling> {
channelId: 'notification_channel_id',
channelName: 'Foreground Notification',
channelDescription:
L10n.of(widget.context)!.foregroundServiceRunning,
L10n.of(widget.context).foregroundServiceRunning,
),
iosNotificationOptions: const IOSNotificationOptions(),
foregroundTaskOptions: const ForegroundTaskOptions(),
);
FlutterForegroundTask.startService(
notificationTitle: L10n.of(widget.context)!.screenSharingTitle,
notificationText: L10n.of(widget.context)!.screenSharingDetail,
notificationTitle: L10n.of(widget.context).screenSharingTitle,
notificationText: L10n.of(widget.context).screenSharingDetail,
);
} else {
FlutterForegroundTask.stopService();
@ -457,7 +457,7 @@ class MyCallingPage extends State<Calling> {
var title = '';
if (call.localHold) {
title = '${call.room.getLocalizedDisplayname(
MatrixLocals(L10n.of(widget.context)!),
MatrixLocals(L10n.of(widget.context)),
)} held the call.';
} else if (call.remoteOnHold) {
title = 'You held the call.';

View file

@ -49,8 +49,8 @@ class HomeserverPickerController extends State<HomeserverPicker> {
(e, s) async {
await showOkAlertDialog(
context: context,
title: L10n.of(context)!.indexedDbErrorTitle,
message: L10n.of(context)!.indexedDbErrorLong,
title: L10n.of(context).indexedDbErrorTitle,
message: L10n.of(context).indexedDbErrorLong,
);
_checkTorBrowser();
},

View file

@ -24,7 +24,7 @@ class HomeserverPickerView extends StatelessWidget {
appBar: controller.widget.addMultiAccount
? AppBar(
centerTitle: true,
title: Text(L10n.of(context)!.addAccount),
title: Text(L10n.of(context).addAccount),
)
: null,
body: Column(
@ -46,8 +46,8 @@ class HomeserverPickerView extends StatelessWidget {
color: theme.colorScheme.surface,
child: ListTile(
leading: const Icon(Icons.vpn_key),
title: Text(L10n.of(context)!.hydrateTor),
subtitle: Text(L10n.of(context)!.hydrateTorLong),
title: Text(L10n.of(context).hydrateTor),
subtitle: Text(L10n.of(context).hydrateTorLong),
trailing: const Icon(Icons.chevron_right_outlined),
onTap: controller.restoreBackup,
),
@ -95,16 +95,16 @@ class HomeserverPickerView extends StatelessWidget {
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
),
hintText: AppConfig.defaultHomeserver,
labelText: L10n.of(context)!.homeserver,
labelText: L10n.of(context).homeserver,
errorText: controller.error,
suffixIcon: IconButton(
onPressed: () {
showDialog(
context: context,
builder: (context) => AlertDialog.adaptive(
title: Text(L10n.of(context)!.whatIsAHomeserver),
title: Text(L10n.of(context).whatIsAHomeserver),
content: Linkify(
text: L10n.of(context)!.homeserverDescription,
text: L10n.of(context).homeserverDescription,
),
actions: [
TextButton(
@ -112,12 +112,12 @@ class HomeserverPickerView extends StatelessWidget {
Uri.https('servers.joinmatrix.org'),
),
child: Text(
L10n.of(context)!.discoverHomeservers,
L10n.of(context).discoverHomeservers,
),
),
TextButton(
onPressed: Navigator.of(context).pop,
child: Text(L10n.of(context)!.close),
child: Text(L10n.of(context).close),
),
],
),
@ -144,7 +144,7 @@ class HomeserverPickerView extends StatelessWidget {
onPressed: controller.isLoggingIn || controller.isLoading
? null
: controller.restoreBackup,
child: Text(L10n.of(context)!.hydrate),
child: Text(L10n.of(context).hydrate),
),
if (controller.supportsPasswordLogin && controller.supportsSso)
TextButton(
@ -155,7 +155,7 @@ class HomeserverPickerView extends StatelessWidget {
onPressed: controller.isLoggingIn || controller.isLoading
? null
: controller.login,
child: Text(L10n.of(context)!.loginWithMatrixId),
child: Text(L10n.of(context).loginWithMatrixId),
),
const SizedBox(height: 8.0),
if (controller.supportsPasswordLogin || controller.supportsSso)
@ -169,7 +169,7 @@ class HomeserverPickerView extends StatelessWidget {
: controller.supportsSso
? controller.ssoLoginAction
: controller.login,
child: Text(L10n.of(context)!.next),
child: Text(L10n.of(context).next),
),
],
),

View file

@ -25,7 +25,7 @@ class ImageViewerView extends StatelessWidget {
icon: const Icon(Icons.close),
onPressed: Navigator.of(context).pop,
color: Colors.white,
tooltip: L10n.of(context)!.close,
tooltip: L10n.of(context).close,
),
backgroundColor: Colors.transparent,
actions: [
@ -36,7 +36,7 @@ class ImageViewerView extends StatelessWidget {
icon: const Icon(Icons.reply_outlined),
onPressed: controller.forwardAction,
color: Colors.white,
tooltip: L10n.of(context)!.share,
tooltip: L10n.of(context).share,
),
const SizedBox(width: 8),
IconButton(
@ -46,7 +46,7 @@ class ImageViewerView extends StatelessWidget {
icon: const Icon(Icons.download_outlined),
onPressed: () => controller.saveFileAction(context),
color: Colors.white,
tooltip: L10n.of(context)!.downloadFile,
tooltip: L10n.of(context).downloadFile,
),
const SizedBox(width: 8),
if (PlatformInfos.isMobile)
@ -59,7 +59,7 @@ class ImageViewerView extends StatelessWidget {
backgroundColor: Colors.black.withOpacity(0.5),
),
onPressed: () => controller.shareFileAction(context),
tooltip: L10n.of(context)!.share,
tooltip: L10n.of(context).share,
color: Colors.white,
icon: Icon(Icons.adaptive.share_outlined),
),

View file

@ -57,15 +57,15 @@ class InvitationSelectionController extends State<InvitationSelection> {
if (OkCancelResult.ok !=
await showOkCancelAlertDialog(
context: context,
title: L10n.of(context)!.inviteContact,
message: L10n.of(context)!.inviteContactToGroupQuestion(
title: L10n.of(context).inviteContact,
message: L10n.of(context).inviteContactToGroupQuestion(
displayname,
room.getLocalizedDisplayname(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
),
),
okLabel: L10n.of(context)!.invite,
cancelLabel: L10n.of(context)!.cancel,
okLabel: L10n.of(context).invite,
cancelLabel: L10n.of(context).cancel,
)) {
return;
}
@ -76,7 +76,7 @@ class InvitationSelectionController extends State<InvitationSelection> {
if (success.error == null) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(L10n.of(context)!.contactHasBeenInvitedToTheGroup),
content: Text(L10n.of(context).contactHasBeenInvitedToTheGroup),
),
);
}

View file

@ -20,21 +20,21 @@ class InvitationSelectionView extends StatelessWidget {
if (room == null) {
return Scaffold(
appBar: AppBar(
title: Text(L10n.of(context)!.oopsSomethingWentWrong),
title: Text(L10n.of(context).oopsSomethingWentWrong),
),
body: Center(
child: Text(L10n.of(context)!.youAreNoLongerParticipatingInThisChat),
child: Text(L10n.of(context).youAreNoLongerParticipatingInThisChat),
),
);
}
final groupName = room.name.isEmpty ? L10n.of(context)!.group : room.name;
final groupName = room.name.isEmpty ? L10n.of(context).group : room.name;
final theme = Theme.of(context);
return Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
titleSpacing: 0,
title: Text(L10n.of(context)!.inviteContact),
title: Text(L10n.of(context).inviteContact),
),
body: MaxWidthBody(
innerPadding: const EdgeInsets.symmetric(vertical: 8),
@ -55,7 +55,7 @@ class InvitationSelectionView extends StatelessWidget {
color: theme.colorScheme.onPrimaryContainer,
fontWeight: FontWeight.normal,
),
hintText: L10n.of(context)!.inviteContactToGroup(groupName),
hintText: L10n.of(context).inviteContactToGroup(groupName),
prefixIcon: controller.loading
? const Padding(
padding: EdgeInsets.symmetric(
@ -91,7 +91,7 @@ class InvitationSelectionView extends StatelessWidget {
displayname: controller
.foundProfiles[i].displayName ??
controller.foundProfiles[i].userId.localpart ??
L10n.of(context)!.user,
L10n.of(context).user,
userId: controller.foundProfiles[i].userId,
isMember: participants
.contains(controller.foundProfiles[i].userId),
@ -100,7 +100,7 @@ class InvitationSelectionView extends StatelessWidget {
controller.foundProfiles[i].userId,
controller.foundProfiles[i].displayName ??
controller.foundProfiles[i].userId.localpart ??
L10n.of(context)!.user,
L10n.of(context).user,
),
),
)
@ -124,7 +124,7 @@ class InvitationSelectionView extends StatelessWidget {
avatarUrl: contacts[i].avatarUrl,
displayname: contacts[i].displayName ??
contacts[i].id.localpart ??
L10n.of(context)!.user,
L10n.of(context).user,
userId: contacts[i].id,
isMember: participants.contains(contacts[i].id),
onTap: () => controller.inviteAction(
@ -132,7 +132,7 @@ class InvitationSelectionView extends StatelessWidget {
contacts[i].id,
contacts[i].displayName ??
contacts[i].id.localpart ??
L10n.of(context)!.user,
L10n.of(context).user,
),
),
);
@ -189,7 +189,7 @@ class _InviteContactListTile extends StatelessWidget {
),
onTap: isMember ? null : onTap,
trailing: isMember
? Text(L10n.of(context)!.participant)
? Text(L10n.of(context).participant)
: const Icon(Icons.person_add_outlined),
),
);

View file

@ -87,7 +87,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
await showOkAlertDialog(
useRootNavigator: false,
context: context,
message: L10n.of(context)!.incorrectPassphraseOrKey,
message: L10n.of(context).incorrectPassphraseOrKey,
);
}
}
@ -106,7 +106,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
}
final displayName =
user?.calcDisplayname() ?? widget.request.userId.localpart!;
var title = Text(L10n.of(context)!.verifyTitle);
var title = Text(L10n.of(context).verifyTitle);
Widget body;
final buttons = <Widget>[];
@ -124,7 +124,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
L10n.of(context)!.askSSSSSign,
L10n.of(context).askSSSSSign,
style: const TextStyle(fontSize: 20),
),
Container(height: 10),
@ -140,7 +140,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
maxLines: 1,
obscureText: true,
decoration: InputDecoration(
hintText: L10n.of(context)!.passphraseOrKey,
hintText: L10n.of(context).passphraseOrKey,
prefixStyle: TextStyle(color: theme.colorScheme.primary),
suffixStyle: TextStyle(color: theme.colorScheme.primary),
border: const OutlineInputBorder(),
@ -152,7 +152,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
buttons.add(
TextButton(
child: Text(
L10n.of(context)!.submit,
L10n.of(context).submit,
),
onPressed: () => checkInput(textEditingController.text),
),
@ -160,14 +160,14 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
buttons.add(
TextButton(
child: Text(
L10n.of(context)!.skip,
L10n.of(context).skip,
),
onPressed: () => widget.request.openSSSS(skip: true),
),
);
break;
case KeyVerificationState.askAccept:
title = Text(L10n.of(context)!.newVerificationRequest);
title = Text(L10n.of(context).newVerificationRequest);
body = Column(
mainAxisSize: MainAxisSize.min,
children: [
@ -179,7 +179,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
),
const SizedBox(height: 16),
Text(
L10n.of(context)!.askVerificationRequest(displayName),
L10n.of(context).askVerificationRequest(displayName),
),
],
);
@ -187,7 +187,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
TextButton.icon(
icon: const Icon(Icons.close),
style: TextButton.styleFrom(foregroundColor: Colors.red),
label: Text(L10n.of(context)!.reject),
label: Text(L10n.of(context).reject),
onPressed: () => widget.request
.rejectVerification()
.then((_) => Navigator.of(context, rootNavigator: false).pop()),
@ -196,7 +196,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
buttons.add(
TextButton.icon(
icon: const Icon(Icons.check),
label: Text(L10n.of(context)!.accept),
label: Text(L10n.of(context).accept),
onPressed: () => widget.request.acceptVerification(),
),
);
@ -222,7 +222,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
),
const SizedBox(height: 16),
Text(
L10n.of(context)!.waitingPartnerAcceptRequest,
L10n.of(context).waitingPartnerAcceptRequest,
textAlign: TextAlign.center,
),
],
@ -231,7 +231,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
buttons.add(
TextButton.icon(
icon: const Icon(Icons.close),
label: Text(L10n.of(context)!.cancel),
label: Text(L10n.of(context).cancel),
onPressed: () => widget.request.cancel(),
),
);
@ -244,7 +244,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
if (widget.request.sasTypes.contains('emoji')) {
title = Text(
L10n.of(context)!.compareEmojiMatch,
L10n.of(context).compareEmojiMatch,
maxLines: 1,
style: const TextStyle(fontSize: 16),
);
@ -254,7 +254,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
.toList(),
);
} else {
title = Text(L10n.of(context)!.compareNumbersMatch);
title = Text(L10n.of(context).compareNumbersMatch);
final numbers = widget.request.sasNumbers;
final numbstr = '${numbers[0]}-${numbers[1]}-${numbers[2]}';
compareWidget =
@ -275,22 +275,22 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
style: TextButton.styleFrom(
foregroundColor: Colors.red,
),
label: Text(L10n.of(context)!.theyDontMatch),
label: Text(L10n.of(context).theyDontMatch),
onPressed: () => widget.request.rejectSas(),
),
);
buttons.add(
TextButton.icon(
icon: const Icon(Icons.check_outlined),
label: Text(L10n.of(context)!.theyMatch),
label: Text(L10n.of(context).theyMatch),
onPressed: () => widget.request.acceptSas(),
),
);
break;
case KeyVerificationState.waitingSas:
final acceptText = widget.request.sasTypes.contains('emoji')
? L10n.of(context)!.waitingPartnerEmoji
: L10n.of(context)!.waitingPartnerNumbers;
? L10n.of(context).waitingPartnerEmoji
: L10n.of(context).waitingPartnerNumbers;
body = Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
@ -314,7 +314,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
),
const SizedBox(height: 10),
Text(
L10n.of(context)!.verifySuccess,
L10n.of(context).verifySuccess,
textAlign: TextAlign.center,
),
],
@ -322,7 +322,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
buttons.add(
TextButton(
child: Text(
L10n.of(context)!.close,
L10n.of(context).close,
),
onPressed: () => Navigator.of(context, rootNavigator: false).pop(),
),
@ -345,7 +345,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
buttons.add(
TextButton(
child: Text(
L10n.of(context)!.close,
L10n.of(context).close,
),
onPressed: () => Navigator.of(context, rootNavigator: false).pop(),
),

View file

@ -33,12 +33,12 @@ class LoginController extends State<Login> {
void login() async {
final matrix = Matrix.of(context);
if (usernameController.text.isEmpty) {
setState(() => usernameError = L10n.of(context)!.pleaseEnterYourUsername);
setState(() => usernameError = L10n.of(context).pleaseEnterYourUsername);
} else {
setState(() => usernameError = null);
}
if (passwordController.text.isEmpty) {
setState(() => passwordError = L10n.of(context)!.pleaseEnterYourPassword);
setState(() => passwordError = L10n.of(context).pleaseEnterYourPassword);
} else {
setState(() => passwordError = null);
}
@ -128,10 +128,9 @@ class LoginController extends State<Login> {
final dialogResult = await showOkCancelAlertDialog(
context: context,
useRootNavigator: false,
message:
L10n.of(context)!.noMatrixServer(newDomain, oldHomeserver!),
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
message: L10n.of(context).noMatrixServer(newDomain, oldHomeserver!),
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
);
if (dialogResult == OkCancelResult.ok) {
if (mounted) setState(() => usernameError = null);
@ -159,16 +158,16 @@ class LoginController extends State<Login> {
final input = await showTextInputDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.passwordForgotten,
message: L10n.of(context)!.enterAnEmailAddress,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).passwordForgotten,
message: L10n.of(context).enterAnEmailAddress,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
fullyCapitalizedForMaterial: false,
textFields: [
DialogTextField(
initialText:
usernameController.text.isEmail ? usernameController.text : '',
hintText: L10n.of(context)!.enterAnEmailAddress,
hintText: L10n.of(context).enterAnEmailAddress,
keyboardType: TextInputType.emailAddress,
),
],
@ -188,10 +187,10 @@ class LoginController extends State<Login> {
final password = await showTextInputDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.passwordForgotten,
message: L10n.of(context)!.chooseAStrongPassword,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).passwordForgotten,
message: L10n.of(context).chooseAStrongPassword,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
fullyCapitalizedForMaterial: false,
textFields: [
const DialogTextField(
@ -206,9 +205,9 @@ class LoginController extends State<Login> {
final ok = await showOkAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.weSentYouAnEmail,
message: L10n.of(context)!.pleaseClickOnLink,
okLabel: L10n.of(context)!.iHaveClickedOnLink,
title: L10n.of(context).weSentYouAnEmail,
message: L10n.of(context).pleaseClickOnLink,
okLabel: L10n.of(context).iHaveClickedOnLink,
fullyCapitalizedForMaterial: false,
);
if (ok != OkCancelResult.ok) return;
@ -233,7 +232,7 @@ class LoginController extends State<Login> {
);
if (success.error == null) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(L10n.of(context)!.passwordHasBeenChanged)),
SnackBar(content: Text(L10n.of(context).passwordHasBeenChanged)),
);
usernameController.text = input.single;
passwordController.text = password.single;

View file

@ -20,7 +20,7 @@ class LoginView extends StatelessWidget {
.homeserver
.toString()
.replaceFirst('https://', '');
final title = L10n.of(context)!.logInTo(homeserver);
final title = L10n.of(context).logInTo(homeserver);
final titleParts = title.split(homeserver);
return LoginScaffold(
@ -68,7 +68,7 @@ class LoginView extends StatelessWidget {
errorText: controller.usernameError,
errorStyle: const TextStyle(color: Colors.orange),
hintText: '@username:localpart',
labelText: L10n.of(context)!.emailOrUsername,
labelText: L10n.of(context).emailOrUsername,
),
),
),
@ -98,7 +98,7 @@ class LoginView extends StatelessWidget {
),
),
hintText: '******',
labelText: L10n.of(context)!.password,
labelText: L10n.of(context).password,
),
),
),
@ -113,7 +113,7 @@ class LoginView extends StatelessWidget {
onPressed: controller.loading ? null : controller.login,
child: controller.loading
? const LinearProgressIndicator()
: Text(L10n.of(context)!.login),
: Text(L10n.of(context).login),
),
),
const SizedBox(height: 16),
@ -126,7 +126,7 @@ class LoginView extends StatelessWidget {
style: TextButton.styleFrom(
foregroundColor: theme.colorScheme.error,
),
child: Text(L10n.of(context)!.passwordForgotten),
child: Text(L10n.of(context).passwordForgotten),
),
),
const SizedBox(height: 16),

View file

@ -26,7 +26,7 @@ class NewGroupView extends StatelessWidget {
onPressed: controller.loading ? null : Navigator.of(context).pop,
),
),
title: Text(L10n.of(context)!.createGroup),
title: Text(L10n.of(context).createGroup),
),
body: MaxWidthBody(
child: Column(
@ -61,7 +61,7 @@ class NewGroupView extends StatelessWidget {
readOnly: controller.loading,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.people_outlined),
labelText: L10n.of(context)!.groupName,
labelText: L10n.of(context).groupName,
),
),
),
@ -69,7 +69,7 @@ class NewGroupView extends StatelessWidget {
SwitchListTile.adaptive(
contentPadding: const EdgeInsets.symmetric(horizontal: 32),
secondary: const Icon(Icons.public_outlined),
title: Text(L10n.of(context)!.groupIsPublic),
title: Text(L10n.of(context).groupIsPublic),
value: controller.publicGroup,
onChanged: controller.loading ? null : controller.setPublicGroup,
),
@ -80,7 +80,7 @@ class NewGroupView extends StatelessWidget {
contentPadding:
const EdgeInsets.symmetric(horizontal: 32),
secondary: const Icon(Icons.search_outlined),
title: Text(L10n.of(context)!.groupCanBeFoundViaSearch),
title: Text(L10n.of(context).groupCanBeFoundViaSearch),
value: controller.groupCanBeFound,
onChanged: controller.loading
? null
@ -95,7 +95,7 @@ class NewGroupView extends StatelessWidget {
color: theme.colorScheme.onSurface,
),
title: Text(
L10n.of(context)!.enableEncryption,
L10n.of(context).enableEncryption,
style: TextStyle(
color: theme.colorScheme.onSurface,
),
@ -112,7 +112,7 @@ class NewGroupView extends StatelessWidget {
controller.loading ? null : controller.submitAction,
child: controller.loading
? const LinearProgressIndicator()
: Text(L10n.of(context)!.createGroupAndInviteUsers),
: Text(L10n.of(context).createGroupAndInviteUsers),
),
),
),

View file

@ -74,7 +74,7 @@ class NewPrivateChatController extends State<NewPrivateChat> {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
L10n.of(context)!.unsupportedAndroidVersionLong,
L10n.of(context).unsupportedAndroidVersionLong,
),
),
);
@ -94,7 +94,7 @@ class NewPrivateChatController extends State<NewPrivateChat> {
ClipboardData(text: Matrix.of(context).client.userID!),
);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(L10n.of(context)!.copiedToClipboard)),
SnackBar(content: Text(L10n.of(context).copiedToClipboard)),
);
}

View file

@ -29,13 +29,13 @@ class NewPrivateChatView extends StatelessWidget {
appBar: AppBar(
scrolledUnderElevation: 0,
leading: const Center(child: BackButton()),
title: Text(L10n.of(context)!.newChat),
title: Text(L10n.of(context).newChat),
backgroundColor: theme.scaffoldBackgroundColor,
actions: [
TextButton(
onPressed:
UrlLauncher(context, AppConfig.startChatTutorial).launchUrl,
child: Text(L10n.of(context)!.help),
child: Text(L10n.of(context).help),
),
],
),
@ -53,7 +53,7 @@ class NewPrivateChatView extends StatelessWidget {
controller: controller.controller,
onChanged: controller.searchUsers,
decoration: InputDecoration(
hintText: L10n.of(context)!.searchForUsers,
hintText: L10n.of(context).searchForUsers,
filled: true,
fillColor: theme.colorScheme.secondaryContainer,
border: OutlineInputBorder(
@ -110,7 +110,7 @@ class NewPrivateChatView extends StatelessWidget {
TextSpan(
children: [
TextSpan(
text: L10n.of(context)!.yourGlobalUserIdIs,
text: L10n.of(context).yourGlobalUserIdIs,
),
TextSpan(
text: Matrix.of(context).client.userID,
@ -133,7 +133,7 @@ class NewPrivateChatView extends StatelessWidget {
foregroundColor: theme.colorScheme.onSecondaryContainer,
child: Icon(Icons.adaptive.share_outlined),
),
title: Text(L10n.of(context)!.shareInviteLink),
title: Text(L10n.of(context).shareInviteLink),
onTap: controller.inviteAction,
),
ListTile(
@ -142,7 +142,7 @@ class NewPrivateChatView extends StatelessWidget {
foregroundColor: theme.colorScheme.onTertiaryContainer,
child: const Icon(Icons.group_add_outlined),
),
title: Text(L10n.of(context)!.createGroup),
title: Text(L10n.of(context).createGroup),
onTap: () => context.go('/rooms/newgroup'),
),
if (PlatformInfos.isMobile)
@ -152,7 +152,7 @@ class NewPrivateChatView extends StatelessWidget {
foregroundColor: theme.colorScheme.onPrimaryContainer,
child: const Icon(Icons.qr_code_scanner_outlined),
),
title: Text(L10n.of(context)!.scanQrCode),
title: Text(L10n.of(context).scanQrCode),
onTap: controller.openScannerAction,
),
Center(
@ -207,7 +207,7 @@ class NewPrivateChatView extends StatelessWidget {
OutlinedButton.icon(
onPressed: controller.searchUsers,
icon: const Icon(Icons.refresh_outlined),
label: Text(L10n.of(context)!.tryAgain),
label: Text(L10n.of(context).tryAgain),
),
],
);
@ -225,7 +225,7 @@ class NewPrivateChatView extends StatelessWidget {
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
L10n.of(context)!.noUsersFoundWithQuery(
L10n.of(context).noUsersFoundWithQuery(
controller.controller.text,
),
style: TextStyle(

View file

@ -35,9 +35,9 @@ class QrScannerModalState extends State<QrScannerModal> {
leading: IconButton(
icon: const Icon(Icons.close_outlined),
onPressed: Navigator.of(context).pop,
tooltip: L10n.of(context)!.close,
tooltip: L10n.of(context).close,
),
title: Text(L10n.of(context)!.scanQrCode),
title: Text(L10n.of(context).scanQrCode),
),
body: Stack(
children: [

View file

@ -52,7 +52,7 @@ class NewSpaceController extends State<NewSpace> {
});
if (nameController.text.isEmpty) {
setState(() {
nameError = L10n.of(context)!.pleaseChoose;
nameError = L10n.of(context).pleaseChoose;
});
return;
}

View file

@ -16,7 +16,7 @@ class NewSpaceView extends StatelessWidget {
final avatar = controller.avatar;
return Scaffold(
appBar: AppBar(
title: Text(L10n.of(context)!.createNewSpace),
title: Text(L10n.of(context).createNewSpace),
),
body: MaxWidthBody(
child: Column(
@ -51,7 +51,7 @@ class NewSpaceView extends StatelessWidget {
readOnly: controller.loading,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.people_outlined),
labelText: L10n.of(context)!.spaceName,
labelText: L10n.of(context).spaceName,
errorText: controller.nameError,
),
),
@ -59,7 +59,7 @@ class NewSpaceView extends StatelessWidget {
const SizedBox(height: 16),
SwitchListTile.adaptive(
contentPadding: const EdgeInsets.symmetric(horizontal: 32),
title: Text(L10n.of(context)!.spaceIsPublic),
title: Text(L10n.of(context).spaceIsPublic),
value: controller.publicGroup,
onChanged: controller.setPublicGroup,
),
@ -69,7 +69,7 @@ class NewSpaceView extends StatelessWidget {
padding: EdgeInsets.symmetric(horizontal: 16.0),
child: Icon(Icons.info_outlined),
),
subtitle: Text(L10n.of(context)!.newSpaceDescription),
subtitle: Text(L10n.of(context).newSpaceDescription),
),
Padding(
padding: const EdgeInsets.all(16.0),
@ -80,7 +80,7 @@ class NewSpaceView extends StatelessWidget {
controller.loading ? null : controller.submitAction,
child: controller.loading
? const LinearProgressIndicator()
: Text(L10n.of(context)!.createNewSpace),
: Text(L10n.of(context).createNewSpace),
),
),
),

View file

@ -36,9 +36,9 @@ class SettingsController extends State<Settings> {
final input = await showTextInputDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.editDisplayname,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).editDisplayname,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
textFields: [
DialogTextField(
initialText: profile?.displayName ??
@ -63,11 +63,11 @@ class SettingsController extends State<Settings> {
if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSureYouWantToLogout,
message: L10n.of(context)!.noBackupWarning,
title: L10n.of(context).areYouSureYouWantToLogout,
message: L10n.of(context).noBackupWarning,
isDestructiveAction: noBackup,
okLabel: L10n.of(context)!.logout,
cancelLabel: L10n.of(context)!.cancel,
okLabel: L10n.of(context).logout,
cancelLabel: L10n.of(context).cancel,
) ==
OkCancelResult.cancel) {
return;
@ -85,19 +85,19 @@ class SettingsController extends State<Settings> {
if (PlatformInfos.isMobile)
SheetAction(
key: AvatarAction.camera,
label: L10n.of(context)!.openCamera,
label: L10n.of(context).openCamera,
isDefaultAction: true,
icon: Icons.camera_alt_outlined,
),
SheetAction(
key: AvatarAction.file,
label: L10n.of(context)!.openGallery,
label: L10n.of(context).openGallery,
icon: Icons.photo_outlined,
),
if (profile?.avatarUrl != null)
SheetAction(
key: AvatarAction.remove,
label: L10n.of(context)!.removeYourAvatar,
label: L10n.of(context).removeYourAvatar,
isDestructiveAction: true,
icon: Icons.delete_outlined,
),
@ -106,7 +106,7 @@ class SettingsController extends State<Settings> {
? actions.single.key
: await showModalActionSheet<AvatarAction>(
context: context,
title: L10n.of(context)!.changeYourAvatar,
title: L10n.of(context).changeYourAvatar,
actions: actions,
);
if (action == null) return;
@ -189,9 +189,9 @@ class SettingsController extends State<Settings> {
if (showChatBackupBanner != true) {
showOkAlertDialog(
context: context,
title: L10n.of(context)!.chatBackup,
message: L10n.of(context)!.onlineKeyBackupEnabled,
okLabel: L10n.of(context)!.close,
title: L10n.of(context).chatBackup,
message: L10n.of(context).onlineKeyBackupEnabled,
okLabel: L10n.of(context).close,
);
return;
}

View file

@ -28,7 +28,7 @@ class SettingsView extends StatelessWidget {
onPressed: () => context.go('/rooms'),
),
),
title: Text(L10n.of(context)!.settings),
title: Text(L10n.of(context).settings),
),
body: ListTileTheme(
iconColor: theme.colorScheme.onSurface,
@ -40,7 +40,7 @@ class SettingsView extends StatelessWidget {
builder: (context, snapshot) {
final profile = snapshot.data;
final mxid =
Matrix.of(context).client.userID ?? L10n.of(context)!.user;
Matrix.of(context).client.userID ?? L10n.of(context).user;
final displayname =
profile?.displayName ?? mxid.localpart ?? mxid;
return Row(
@ -118,7 +118,7 @@ class SettingsView extends StatelessWidget {
if (showChatBackupBanner == null)
ListTile(
leading: const Icon(Icons.backup_outlined),
title: Text(L10n.of(context)!.chatBackup),
title: Text(L10n.of(context).chatBackup),
trailing: const CircularProgressIndicator.adaptive(),
)
else
@ -126,7 +126,7 @@ class SettingsView extends StatelessWidget {
controlAffinity: ListTileControlAffinity.trailing,
value: controller.showChatBackupBanner == false,
secondary: const Icon(Icons.backup_outlined),
title: Text(L10n.of(context)!.chatBackup),
title: Text(L10n.of(context).chatBackup),
onChanged: controller.firstRunBootstrapAction,
),
Divider(
@ -134,49 +134,49 @@ class SettingsView extends StatelessWidget {
),
ListTile(
leading: const Icon(Icons.format_paint_outlined),
title: Text(L10n.of(context)!.changeTheme),
title: Text(L10n.of(context).changeTheme),
onTap: () => context.go('/rooms/settings/style'),
),
ListTile(
leading: const Icon(Icons.notifications_outlined),
title: Text(L10n.of(context)!.notifications),
title: Text(L10n.of(context).notifications),
onTap: () => context.go('/rooms/settings/notifications'),
),
ListTile(
leading: const Icon(Icons.devices_outlined),
title: Text(L10n.of(context)!.devices),
title: Text(L10n.of(context).devices),
onTap: () => context.go('/rooms/settings/devices'),
),
ListTile(
leading: const Icon(Icons.forum_outlined),
title: Text(L10n.of(context)!.chat),
title: Text(L10n.of(context).chat),
onTap: () => context.go('/rooms/settings/chat'),
),
ListTile(
leading: const Icon(Icons.shield_outlined),
title: Text(L10n.of(context)!.security),
title: Text(L10n.of(context).security),
onTap: () => context.go('/rooms/settings/security'),
),
Divider(color: theme.dividerColor),
ListTile(
leading: const Icon(Icons.help_outline_outlined),
title: Text(L10n.of(context)!.help),
title: Text(L10n.of(context).help),
onTap: () => launchUrlString(AppConfig.supportUrl),
),
ListTile(
leading: const Icon(Icons.shield_sharp),
title: Text(L10n.of(context)!.privacy),
title: Text(L10n.of(context).privacy),
onTap: () => launchUrlString(AppConfig.privacyUrl),
),
ListTile(
leading: const Icon(Icons.info_outline_rounded),
title: Text(L10n.of(context)!.about),
title: Text(L10n.of(context).about),
onTap: () => PlatformInfos.showDialog(context),
),
Divider(color: theme.dividerColor),
ListTile(
leading: const Icon(Icons.logout_outlined),
title: Text(L10n.of(context)!.logout),
title: Text(L10n.of(context).logout),
onTap: controller.logoutAction,
),
],

View file

@ -22,12 +22,12 @@ class Settings3PidController extends State<Settings3Pid> {
final input = await showTextInputDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.enterAnEmailAddress,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).enterAnEmailAddress,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
textFields: [
DialogTextField(
hintText: L10n.of(context)!.enterAnEmailAddress,
hintText: L10n.of(context).enterAnEmailAddress,
keyboardType: TextInputType.emailAddress,
),
],
@ -46,9 +46,9 @@ class Settings3PidController extends State<Settings3Pid> {
final ok = await showOkAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.weSentYouAnEmail,
message: L10n.of(context)!.pleaseClickOnLink,
okLabel: L10n.of(context)!.iHaveClickedOnLink,
title: L10n.of(context).weSentYouAnEmail,
message: L10n.of(context).pleaseClickOnLink,
okLabel: L10n.of(context).iHaveClickedOnLink,
);
if (ok != OkCancelResult.ok) return;
final success = await showFutureLoadingDialog(
@ -71,9 +71,9 @@ class Settings3PidController extends State<Settings3Pid> {
if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.yes,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).cancel,
) !=
OkCancelResult.ok) {
return;

View file

@ -20,12 +20,12 @@ class Settings3PidView extends StatelessWidget {
return Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
title: Text(L10n.of(context)!.passwordRecovery),
title: Text(L10n.of(context).passwordRecovery),
actions: [
IconButton(
icon: const Icon(Icons.add_outlined),
onPressed: controller.add3PidAction,
tooltip: L10n.of(context)!.addEmail,
tooltip: L10n.of(context).addEmail,
),
],
),
@ -66,8 +66,8 @@ class Settings3PidView extends StatelessWidget {
),
title: Text(
identifier.isEmpty
? L10n.of(context)!.noPasswordRecoveryDescription
: L10n.of(context)!
? L10n.of(context).noPasswordRecoveryDescription
: L10n.of(context)
.withTheseAddressesRecoveryDescription,
),
),
@ -83,7 +83,7 @@ class Settings3PidView extends StatelessWidget {
),
title: Text(identifier[i].address),
trailing: IconButton(
tooltip: L10n.of(context)!.delete,
tooltip: L10n.of(context).delete,
icon: const Icon(Icons.delete_forever_outlined),
color: Colors.red,
onPressed: () => controller.delete3Pid(identifier[i]),

View file

@ -21,54 +21,54 @@ class SettingsChatView extends StatelessWidget {
final theme = Theme.of(context);
return Scaffold(
appBar: AppBar(title: Text(L10n.of(context)!.chat)),
appBar: AppBar(title: Text(L10n.of(context).chat)),
body: ListTileTheme(
iconColor: theme.textTheme.bodyLarge!.color,
child: MaxWidthBody(
child: Column(
children: [
SettingsSwitchListTile.adaptive(
title: L10n.of(context)!.formattedMessages,
subtitle: L10n.of(context)!.formattedMessagesDescription,
title: L10n.of(context).formattedMessages,
subtitle: L10n.of(context).formattedMessagesDescription,
onChanged: (b) => AppConfig.renderHtml = b,
storeKey: SettingKeys.renderHtml,
defaultValue: AppConfig.renderHtml,
),
SettingsSwitchListTile.adaptive(
title: L10n.of(context)!.hideMemberChangesInPublicChats,
subtitle: L10n.of(context)!.hideMemberChangesInPublicChatsBody,
title: L10n.of(context).hideMemberChangesInPublicChats,
subtitle: L10n.of(context).hideMemberChangesInPublicChatsBody,
onChanged: (b) => AppConfig.hideUnimportantStateEvents = b,
storeKey: SettingKeys.hideUnimportantStateEvents,
defaultValue: AppConfig.hideUnimportantStateEvents,
),
SettingsSwitchListTile.adaptive(
title: L10n.of(context)!.hideRedactedMessages,
subtitle: L10n.of(context)!.hideRedactedMessagesBody,
title: L10n.of(context).hideRedactedMessages,
subtitle: L10n.of(context).hideRedactedMessagesBody,
onChanged: (b) => AppConfig.hideRedactedEvents = b,
storeKey: SettingKeys.hideRedactedEvents,
defaultValue: AppConfig.hideRedactedEvents,
),
SettingsSwitchListTile.adaptive(
title: L10n.of(context)!.hideInvalidOrUnknownMessageFormats,
title: L10n.of(context).hideInvalidOrUnknownMessageFormats,
onChanged: (b) => AppConfig.hideUnknownEvents = b,
storeKey: SettingKeys.hideUnknownEvents,
defaultValue: AppConfig.hideUnknownEvents,
),
if (PlatformInfos.isMobile)
SettingsSwitchListTile.adaptive(
title: L10n.of(context)!.autoplayImages,
title: L10n.of(context).autoplayImages,
onChanged: (b) => AppConfig.autoplayImages = b,
storeKey: SettingKeys.autoplayImages,
defaultValue: AppConfig.autoplayImages,
),
SettingsSwitchListTile.adaptive(
title: L10n.of(context)!.sendOnEnter,
title: L10n.of(context).sendOnEnter,
onChanged: (b) => AppConfig.sendOnEnter = b,
storeKey: SettingKeys.sendOnEnter,
defaultValue: AppConfig.sendOnEnter ?? !PlatformInfos.isMobile,
),
SettingsSwitchListTile.adaptive(
title: L10n.of(context)!.swipeRightToLeftToReply,
title: L10n.of(context).swipeRightToLeftToReply,
onChanged: (b) => AppConfig.swipeRightToLeftToReply = b,
storeKey: SettingKeys.swipeRightToLeftToReply,
defaultValue: AppConfig.swipeRightToLeftToReply,
@ -76,7 +76,7 @@ class SettingsChatView extends StatelessWidget {
Divider(color: theme.dividerColor),
ListTile(
title: Text(
L10n.of(context)!.customEmojisAndStickers,
L10n.of(context).customEmojisAndStickers,
style: TextStyle(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
@ -84,8 +84,8 @@ class SettingsChatView extends StatelessWidget {
),
),
ListTile(
title: Text(L10n.of(context)!.customEmojisAndStickers),
subtitle: Text(L10n.of(context)!.customEmojisAndStickersBody),
title: Text(L10n.of(context).customEmojisAndStickers),
subtitle: Text(L10n.of(context).customEmojisAndStickersBody),
onTap: () => context.go('/rooms/settings/chat/emotes'),
trailing: const Padding(
padding: EdgeInsets.all(16.0),
@ -95,7 +95,7 @@ class SettingsChatView extends StatelessWidget {
Divider(color: theme.dividerColor),
ListTile(
title: Text(
L10n.of(context)!.calls,
L10n.of(context).calls,
style: TextStyle(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
@ -103,7 +103,7 @@ class SettingsChatView extends StatelessWidget {
),
),
SettingsSwitchListTile.adaptive(
title: L10n.of(context)!.experimentalVideoCalls,
title: L10n.of(context).experimentalVideoCalls,
onChanged: (b) {
AppConfig.experimentalVoip = b;
Matrix.of(context).createVoipPlugin();
@ -114,7 +114,7 @@ class SettingsChatView extends StatelessWidget {
),
if (PlatformInfos.isMobile)
ListTile(
title: Text(L10n.of(context)!.callingPermissions),
title: Text(L10n.of(context).callingPermissions),
onTap: () =>
CallKeepManager().checkoutPhoneAccountSetting(context),
trailing: const Padding(

View file

@ -44,7 +44,7 @@ class _ImportEmoteArchiveDialogState extends State<ImportEmoteArchiveDialog> {
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text(L10n.of(context)!.importEmojis),
title: Text(L10n.of(context).importEmojis),
content: _loading
? Center(
child: CircularProgressIndicator(
@ -73,7 +73,7 @@ class _ImportEmoteArchiveDialogState extends State<ImportEmoteArchiveDialog> {
actions: [
TextButton(
onPressed: _loading ? null : Navigator.of(context).pop,
child: Text(L10n.of(context)!.cancel),
child: Text(L10n.of(context).cancel),
),
TextButton(
onPressed: _loading
@ -81,7 +81,7 @@ class _ImportEmoteArchiveDialogState extends State<ImportEmoteArchiveDialog> {
: _importMap.isNotEmpty
? _addEmotePack
: null,
child: Text(L10n.of(context)!.importNow),
child: Text(L10n.of(context).importNow),
),
],
);
@ -121,10 +121,10 @@ class _ImportEmoteArchiveDialogState extends State<ImportEmoteArchiveDialog> {
final result = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.emoteExists,
title: L10n.of(context).emoteExists,
message: imageCode,
cancelLabel: L10n.of(context)!.replace,
okLabel: L10n.of(context)!.skip,
cancelLabel: L10n.of(context).replace,
okLabel: L10n.of(context).skip,
);
completer.complete(result);
});
@ -242,7 +242,7 @@ class _EmojiImportPreviewState extends State<_EmojiImportPreview> {
IconButton(
onPressed: widget.onRemove,
icon: const Icon(Icons.remove_circle),
tooltip: L10n.of(context)!.remove,
tooltip: L10n.of(context).remove,
),
ValueListenableBuilder(
valueListenable: hasErrorNotifier,
@ -278,7 +278,7 @@ class _EmojiImportPreviewState extends State<_EmojiImportPreview> {
minLines: 1,
maxLines: 1,
decoration: InputDecoration(
hintText: L10n.of(context)!.emoteShortcode,
hintText: L10n.of(context).emoteShortcode,
prefixText: ': ',
suffixText: ':',
border: const OutlineInputBorder(),
@ -329,7 +329,7 @@ class _ImageFileError extends StatelessWidget {
children: [
const Icon(Icons.error),
Text(
L10n.of(context)!.notAnImage,
L10n.of(context).notAnImage,
textAlign: TextAlign.center,
style: theme.textTheme.labelSmall,
),

View file

@ -139,8 +139,8 @@ class EmotesSettingsController extends State<EmotesSettings> {
showOkAlertDialog(
useRootNavigator: false,
context: context,
message: L10n.of(context)!.emoteExists,
okLabel: L10n.of(context)!.ok,
message: L10n.of(context).emoteExists,
okLabel: L10n.of(context).ok,
);
return;
}
@ -149,8 +149,8 @@ class EmotesSettingsController extends State<EmotesSettings> {
showOkAlertDialog(
useRootNavigator: false,
context: context,
message: L10n.of(context)!.emoteInvalid,
okLabel: L10n.of(context)!.ok,
message: L10n.of(context).emoteInvalid,
okLabel: L10n.of(context).ok,
);
return;
}
@ -185,8 +185,8 @@ class EmotesSettingsController extends State<EmotesSettings> {
await showOkAlertDialog(
useRootNavigator: false,
context: context,
message: L10n.of(context)!.emoteWarnNeedToPick,
okLabel: L10n.of(context)!.ok,
message: L10n.of(context).emoteWarnNeedToPick,
okLabel: L10n.of(context).ok,
);
return;
}
@ -195,8 +195,8 @@ class EmotesSettingsController extends State<EmotesSettings> {
await showOkAlertDialog(
useRootNavigator: false,
context: context,
message: L10n.of(context)!.emoteExists,
okLabel: L10n.of(context)!.ok,
message: L10n.of(context).emoteExists,
okLabel: L10n.of(context).ok,
);
return;
}
@ -204,8 +204,8 @@ class EmotesSettingsController extends State<EmotesSettings> {
await showOkAlertDialog(
useRootNavigator: false,
context: context,
message: L10n.of(context)!.emoteInvalid,
okLabel: L10n.of(context)!.ok,
message: L10n.of(context).emoteInvalid,
okLabel: L10n.of(context).ok,
);
return;
}

View file

@ -26,7 +26,7 @@ class EmotesSettingsView extends StatelessWidget {
return Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
title: Text(L10n.of(context)!.customEmojisAndStickers),
title: Text(L10n.of(context).customEmojisAndStickers),
actions: [
PopupMenuButton<PopupMenuEmojiActions>(
onSelected: (value) {
@ -43,11 +43,11 @@ class EmotesSettingsView extends StatelessWidget {
itemBuilder: (context) => [
PopupMenuItem(
value: PopupMenuEmojiActions.import,
child: Text(L10n.of(context)!.importFromZipFile),
child: Text(L10n.of(context).importFromZipFile),
),
PopupMenuItem(
value: PopupMenuEmojiActions.export,
child: Text(L10n.of(context)!.exportEmotePack),
child: Text(L10n.of(context).exportEmotePack),
),
],
),
@ -83,7 +83,7 @@ class EmotesSettingsView extends StatelessWidget {
minLines: 1,
maxLines: 1,
decoration: InputDecoration(
hintText: L10n.of(context)!.emoteShortcode,
hintText: L10n.of(context).emoteShortcode,
prefixText: ': ',
suffixText: ':',
prefixStyle: TextStyle(
@ -114,7 +114,7 @@ class EmotesSettingsView extends StatelessWidget {
),
if (controller.room != null)
SwitchListTile.adaptive(
title: Text(L10n.of(context)!.enableEmotesGlobally),
title: Text(L10n.of(context).enableEmotesGlobally),
value: controller.isGloballyActive(client),
onChanged: controller.setIsGloballyActive,
),
@ -125,7 +125,7 @@ class EmotesSettingsView extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.all(16),
child: Text(
L10n.of(context)!.noEmotesFound,
L10n.of(context).noEmotesFound,
style: const TextStyle(fontSize: 20),
),
),
@ -186,7 +186,7 @@ class EmotesSettingsView extends StatelessWidget {
minLines: 1,
maxLines: 1,
decoration: InputDecoration(
hintText: L10n.of(context)!.emoteShortcode,
hintText: L10n.of(context).emoteShortcode,
prefixText: ': ',
suffixText: ':',
prefixStyle: TextStyle(
@ -269,7 +269,7 @@ class _ImagePickerState extends State<_ImagePicker> {
if (widget.controller.value == null) {
return ElevatedButton(
onPressed: () => widget.onPressed(widget.controller),
child: Text(L10n.of(context)!.pickImage),
child: Text(L10n.of(context).pickImage),
);
} else {
return _EmoteImage(widget.controller.value!.url);

View file

@ -35,7 +35,7 @@ class SettingsIgnoreListController extends State<SettingsIgnoreList> {
if (userId.isEmpty) return;
if (!userId.isValidMatrixId || userId.sigil != '@') {
setState(() {
errorText = L10n.of(context)!.invalidInput;
errorText = L10n.of(context).invalidInput;
});
return;
}

View file

@ -22,7 +22,7 @@ class SettingsIgnoreListView extends StatelessWidget {
return Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
title: Text(L10n.of(context)!.blockedUsers),
title: Text(L10n.of(context).blockedUsers),
),
body: MaxWidthBody(
withScrolling: false,
@ -43,9 +43,9 @@ class SettingsIgnoreListView extends StatelessWidget {
errorText: controller.errorText,
hintText: '@bad_guy:domain.abc',
floatingLabelBehavior: FloatingLabelBehavior.always,
labelText: L10n.of(context)!.blockUsername,
labelText: L10n.of(context).blockUsername,
suffixIcon: IconButton(
tooltip: L10n.of(context)!.block,
tooltip: L10n.of(context).block,
icon: const Icon(Icons.add),
onPressed: () => controller.ignoreUser(context),
),
@ -53,7 +53,7 @@ class SettingsIgnoreListView extends StatelessWidget {
),
const SizedBox(height: 16),
Text(
L10n.of(context)!.blockListDescription,
L10n.of(context).blockListDescription,
style: const TextStyle(color: Colors.orange),
),
],
@ -89,7 +89,7 @@ class SettingsIgnoreListView extends StatelessWidget {
subtitle:
Text(s.data?.userId ?? client.ignoredUsers[i]),
trailing: IconButton(
tooltip: L10n.of(context)!.delete,
tooltip: L10n.of(context).delete,
icon: const Icon(Icons.delete_outlined),
onPressed: () => showFutureLoadingDialog(
context: context,

View file

@ -18,7 +18,7 @@ class MultipleEmotesSettingsView extends StatelessWidget {
return Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
title: Text(L10n.of(context)!.emotePacks),
title: Text(L10n.of(context).emotePacks),
),
body: StreamBuilder(
stream: room.client.onRoomState.stream

View file

@ -19,37 +19,37 @@ class NotificationSettingsItem {
NotificationSettingsItem(
PushRuleKind.underride,
'.m.rule.message',
(c) => L10n.of(c)!.allRooms,
(c) => L10n.of(c).allRooms,
),
NotificationSettingsItem(
PushRuleKind.underride,
'.m.rule.room_one_to_one',
(c) => L10n.of(c)!.directChats,
(c) => L10n.of(c).directChats,
),
NotificationSettingsItem(
PushRuleKind.override,
'.m.rule.contains_display_name',
(c) => L10n.of(c)!.containsDisplayName,
(c) => L10n.of(c).containsDisplayName,
),
NotificationSettingsItem(
PushRuleKind.content,
'.m.rule.contains_user_name',
(c) => L10n.of(c)!.containsUserName,
(c) => L10n.of(c).containsUserName,
),
NotificationSettingsItem(
PushRuleKind.override,
'.m.rule.invite_for_me',
(c) => L10n.of(c)!.inviteForMe,
(c) => L10n.of(c).inviteForMe,
),
NotificationSettingsItem(
PushRuleKind.override,
'.m.rule.member_event',
(c) => L10n.of(c)!.memberChanges,
(c) => L10n.of(c).memberChanges,
),
NotificationSettingsItem(
PushRuleKind.override,
'.m.rule.suppress_notices',
(c) => L10n.of(c)!.botMessages,
(c) => L10n.of(c).botMessages,
),
];
}
@ -145,7 +145,7 @@ class SettingsNotificationsController extends State<SettingsNotifications> {
message: '${pusher.appDisplayName} (${pusher.appId})',
actions: [
SheetAction(
label: L10n.of(context)!.delete,
label: L10n.of(context).delete,
isDestructiveAction: true,
key: true,
),

View file

@ -18,7 +18,7 @@ class SettingsNotificationsView extends StatelessWidget {
return Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
title: Text(L10n.of(context)!.notifications),
title: Text(L10n.of(context).notifications),
),
body: MaxWidthBody(
child: StreamBuilder(
@ -36,7 +36,7 @@ class SettingsNotificationsView extends StatelessWidget {
SwitchListTile.adaptive(
value: !Matrix.of(context).client.allPushNotificationsMuted,
title: Text(
L10n.of(context)!.notificationsEnabledForThisAccount,
L10n.of(context).notificationsEnabledForThisAccount,
),
onChanged: controller.isLoading
? null
@ -45,7 +45,7 @@ class SettingsNotificationsView extends StatelessWidget {
Divider(color: theme.dividerColor),
ListTile(
title: Text(
L10n.of(context)!.notifyMeFor,
L10n.of(context).notifyMeFor,
style: TextStyle(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
@ -68,7 +68,7 @@ class SettingsNotificationsView extends StatelessWidget {
Divider(color: theme.dividerColor),
ListTile(
title: Text(
L10n.of(context)!.devices,
L10n.of(context).devices,
style: TextStyle(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
@ -98,7 +98,7 @@ class SettingsNotificationsView extends StatelessWidget {
return Center(
child: Padding(
padding: const EdgeInsets.only(bottom: 16.0),
child: Text(L10n.of(context)!.noOtherDevicesFound),
child: Text(L10n.of(context).noOtherDevicesFound),
),
);
}

View file

@ -31,20 +31,20 @@ class SettingsPasswordController extends State<SettingsPassword> {
});
if (oldPasswordController.text.isEmpty) {
setState(() {
oldPasswordError = L10n.of(context)!.pleaseEnterYourPassword;
oldPasswordError = L10n.of(context).pleaseEnterYourPassword;
});
return;
}
if (newPassword1Controller.text.isEmpty ||
newPassword1Controller.text.length < 6) {
setState(() {
newPassword1Error = L10n.of(context)!.pleaseChooseAStrongPassword;
newPassword1Error = L10n.of(context).pleaseChooseAStrongPassword;
});
return;
}
if (newPassword1Controller.text != newPassword2Controller.text) {
setState(() {
newPassword2Error = L10n.of(context)!.passwordsDoNotMatch;
newPassword2Error = L10n.of(context).passwordsDoNotMatch;
});
return;
}
@ -60,7 +60,7 @@ class SettingsPasswordController extends State<SettingsPassword> {
);
scaffoldMessenger.showSnackBar(
SnackBar(
content: Text(L10n.of(context)!.passwordHasBeenChanged),
content: Text(L10n.of(context).passwordHasBeenChanged),
),
);
if (mounted) context.pop();

View file

@ -16,7 +16,7 @@ class SettingsPasswordView extends StatelessWidget {
return Scaffold(
appBar: AppBar(
title: Text(L10n.of(context)!.changePassword),
title: Text(L10n.of(context).changePassword),
),
body: ListTileTheme(
iconColor: theme.colorScheme.onSurface,
@ -35,7 +35,7 @@ class SettingsPasswordView extends StatelessWidget {
decoration: InputDecoration(
prefixIcon: const Icon(Icons.lock_outlined),
hintText: '********',
labelText: L10n.of(context)!.pleaseEnterYourCurrentPassword,
labelText: L10n.of(context).pleaseEnterYourCurrentPassword,
errorText: controller.oldPasswordError,
),
),
@ -48,7 +48,7 @@ class SettingsPasswordView extends StatelessWidget {
decoration: InputDecoration(
prefixIcon: const Icon(Icons.lock_reset_outlined),
hintText: '********',
labelText: L10n.of(context)!.newPassword,
labelText: L10n.of(context).newPassword,
errorText: controller.newPassword1Error,
),
),
@ -61,7 +61,7 @@ class SettingsPasswordView extends StatelessWidget {
decoration: InputDecoration(
prefixIcon: const Icon(Icons.repeat_outlined),
hintText: '********',
labelText: L10n.of(context)!.repeatPassword,
labelText: L10n.of(context).repeatPassword,
errorText: controller.newPassword2Error,
),
),
@ -73,12 +73,12 @@ class SettingsPasswordView extends StatelessWidget {
controller.loading ? null : controller.changePassword,
child: controller.loading
? const LinearProgressIndicator()
: Text(L10n.of(context)!.changePassword),
: Text(L10n.of(context).changePassword),
),
),
const SizedBox(height: 16),
TextButton(
child: Text(L10n.of(context)!.passwordRecoverySettings),
child: Text(L10n.of(context).passwordRecoverySettings),
onPressed: () => context.go('/rooms/settings/security/3pid'),
),
],

View file

@ -25,9 +25,9 @@ class SettingsSecurityController extends State<SettingsSecurity> {
final newLock = await showTextInputDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.pleaseChooseAPasscode,
message: L10n.of(context)!.pleaseEnter4Digits,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).pleaseChooseAPasscode,
message: L10n.of(context).pleaseEnter4Digits,
cancelLabel: L10n.of(context).cancel,
textFields: [
DialogTextField(
validator: (text) {
@ -35,7 +35,7 @@ class SettingsSecurityController extends State<SettingsSecurity> {
(text.length == 4 && int.tryParse(text)! >= 0)) {
return null;
}
return L10n.of(context)!.pleaseEnter4Digits;
return L10n.of(context).pleaseEnter4Digits;
},
keyboardType: TextInputType.number,
obscureText: true,
@ -54,10 +54,10 @@ class SettingsSecurityController extends State<SettingsSecurity> {
if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.warning,
message: L10n.of(context)!.deactivateAccountWarning,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).warning,
message: L10n.of(context).deactivateAccountWarning,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
isDestructiveAction: true,
) ==
OkCancelResult.cancel) {
@ -67,17 +67,17 @@ class SettingsSecurityController extends State<SettingsSecurity> {
final mxids = await showTextInputDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.confirmMatrixId,
title: L10n.of(context).confirmMatrixId,
textFields: [
DialogTextField(
validator: (text) => text == supposedMxid
? null
: L10n.of(context)!.supposedMxid(supposedMxid),
: L10n.of(context).supposedMxid(supposedMxid),
),
],
isDestructiveAction: true,
okLabel: L10n.of(context)!.delete,
cancelLabel: L10n.of(context)!.cancel,
okLabel: L10n.of(context).delete,
cancelLabel: L10n.of(context).cancel,
);
if (mxids == null || mxids.length != 1 || mxids.single != supposedMxid) {
return;
@ -85,9 +85,9 @@ class SettingsSecurityController extends State<SettingsSecurity> {
final input = await showTextInputDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.pleaseEnterYourPassword,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).pleaseEnterYourPassword,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
isDestructiveAction: true,
textFields: [
const DialogTextField(

View file

@ -21,7 +21,7 @@ class SettingsSecurityView extends StatelessWidget {
final theme = Theme.of(context);
return Scaffold(
appBar: AppBar(title: Text(L10n.of(context)!.security)),
appBar: AppBar(title: Text(L10n.of(context).security)),
body: ListTileTheme(
iconColor: theme.colorScheme.onSurface,
child: MaxWidthBody(
@ -45,7 +45,7 @@ class SettingsSecurityView extends StatelessWidget {
children: [
ListTile(
title: Text(
L10n.of(context)!.privacy,
L10n.of(context).privacy,
style: TextStyle(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
@ -53,25 +53,25 @@ class SettingsSecurityView extends StatelessWidget {
),
),
SettingsSwitchListTile.adaptive(
title: L10n.of(context)!.sendTypingNotifications,
title: L10n.of(context).sendTypingNotifications,
subtitle:
L10n.of(context)!.sendTypingNotificationsDescription,
L10n.of(context).sendTypingNotificationsDescription,
onChanged: (b) => AppConfig.sendTypingNotifications = b,
storeKey: SettingKeys.sendTypingNotifications,
defaultValue: AppConfig.sendTypingNotifications,
),
SettingsSwitchListTile.adaptive(
title: L10n.of(context)!.sendReadReceipts,
subtitle: L10n.of(context)!.sendReadReceiptsDescription,
title: L10n.of(context).sendReadReceipts,
subtitle: L10n.of(context).sendReadReceiptsDescription,
onChanged: (b) => AppConfig.sendPublicReadReceipts = b,
storeKey: SettingKeys.sendPublicReadReceipts,
defaultValue: AppConfig.sendPublicReadReceipts,
),
ListTile(
trailing: const Icon(Icons.chevron_right_outlined),
title: Text(L10n.of(context)!.blockedUsers),
title: Text(L10n.of(context).blockedUsers),
subtitle: Text(
L10n.of(context)!.thereAreCountUsersBlocked(
L10n.of(context).thereAreCountUsersBlocked(
Matrix.of(context).client.ignoredUsers.length,
),
),
@ -82,15 +82,15 @@ class SettingsSecurityView extends StatelessWidget {
if (PlatformInfos.isMobile)
ListTile(
trailing: const Icon(Icons.chevron_right_outlined),
title: Text(L10n.of(context)!.appLock),
subtitle: Text(L10n.of(context)!.appLockDescription),
title: Text(L10n.of(context).appLock),
subtitle: Text(L10n.of(context).appLockDescription),
onTap: controller.setAppLockAction,
),
},
Divider(color: theme.dividerColor),
ListTile(
title: Text(
L10n.of(context)!.account,
L10n.of(context).account,
style: TextStyle(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
@ -98,7 +98,7 @@ class SettingsSecurityView extends StatelessWidget {
),
),
ListTile(
title: Text(L10n.of(context)!.yourPublicKey),
title: Text(L10n.of(context).yourPublicKey),
leading: const Icon(Icons.vpn_key_outlined),
subtitle: SelectableText(
Matrix.of(context).client.fingerprintKey.beautified,
@ -110,7 +110,7 @@ class SettingsSecurityView extends StatelessWidget {
ListTile(
leading: const Icon(Icons.password_outlined),
trailing: const Icon(Icons.chevron_right_outlined),
title: Text(L10n.of(context)!.changePassword),
title: Text(L10n.of(context).changePassword),
onTap: () =>
context.go('/rooms/settings/security/password'),
),
@ -118,7 +118,7 @@ class SettingsSecurityView extends StatelessWidget {
iconColor: Colors.orange,
leading: const Icon(Icons.delete_sweep_outlined),
title: Text(
L10n.of(context)!.dehydrate,
L10n.of(context).dehydrate,
style: const TextStyle(color: Colors.orange),
),
onTap: controller.dehydrateAction,
@ -128,7 +128,7 @@ class SettingsSecurityView extends StatelessWidget {
iconColor: Colors.red,
leading: const Icon(Icons.delete_outlined),
title: Text(
L10n.of(context)!.deleteAccount,
L10n.of(context).deleteAccount,
style: const TextStyle(color: Colors.red),
),
onTap: controller.deleteAccountAction,

View file

@ -27,7 +27,7 @@ class SettingsStyleView extends StatelessWidget {
return Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
title: Text(L10n.of(context)!.changeTheme),
title: Text(L10n.of(context).changeTheme),
),
backgroundColor: theme.colorScheme.surface,
body: MaxWidthBody(
@ -35,7 +35,7 @@ class SettingsStyleView extends StatelessWidget {
children: [
ListTile(
title: Text(
L10n.of(context)!.setColorTheme,
L10n.of(context).setColorTheme,
style: TextStyle(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
@ -95,7 +95,7 @@ class SettingsStyleView extends StatelessWidget {
),
),
Text(
L10n.of(context)!.systemTheme,
L10n.of(context).systemTheme,
textAlign: TextAlign.center,
style: TextStyle(
color: theme
@ -140,7 +140,7 @@ class SettingsStyleView extends StatelessWidget {
),
ListTile(
title: Text(
L10n.of(context)!.setTheme,
L10n.of(context).setTheme,
style: TextStyle(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
@ -150,19 +150,19 @@ class SettingsStyleView extends StatelessWidget {
RadioListTile<ThemeMode>(
groupValue: controller.currentTheme,
value: ThemeMode.system,
title: Text(L10n.of(context)!.systemTheme),
title: Text(L10n.of(context).systemTheme),
onChanged: controller.switchTheme,
),
RadioListTile<ThemeMode>(
groupValue: controller.currentTheme,
value: ThemeMode.light,
title: Text(L10n.of(context)!.lightTheme),
title: Text(L10n.of(context).lightTheme),
onChanged: controller.switchTheme,
),
RadioListTile<ThemeMode>(
groupValue: controller.currentTheme,
value: ThemeMode.dark,
title: Text(L10n.of(context)!.darkTheme),
title: Text(L10n.of(context).darkTheme),
onChanged: controller.switchTheme,
),
Divider(
@ -170,7 +170,7 @@ class SettingsStyleView extends StatelessWidget {
),
ListTile(
title: Text(
L10n.of(context)!.overview,
L10n.of(context).overview,
style: TextStyle(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
@ -178,13 +178,13 @@ class SettingsStyleView extends StatelessWidget {
),
),
SettingsSwitchListTile.adaptive(
title: L10n.of(context)!.presencesToggle,
title: L10n.of(context).presencesToggle,
onChanged: (b) => AppConfig.showPresences = b,
storeKey: SettingKeys.showPresences,
defaultValue: AppConfig.showPresences,
),
SettingsSwitchListTile.adaptive(
title: L10n.of(context)!.separateChatTypes,
title: L10n.of(context).separateChatTypes,
onChanged: (b) => AppConfig.separateChatTypes = b,
storeKey: SettingKeys.separateChatTypes,
defaultValue: AppConfig.separateChatTypes,
@ -194,7 +194,7 @@ class SettingsStyleView extends StatelessWidget {
),
ListTile(
title: Text(
L10n.of(context)!.messagesStyle,
L10n.of(context).messagesStyle,
style: TextStyle(
color: theme.colorScheme.secondary,
fontWeight: FontWeight.bold,
@ -270,7 +270,7 @@ class SettingsStyleView extends StatelessWidget {
),
),
ListTile(
title: Text(L10n.of(context)!.wallpaper),
title: Text(L10n.of(context).wallpaper),
leading: const Icon(Icons.photo_outlined),
trailing: accountConfig.wallpaperUrl == null
? null
@ -286,7 +286,7 @@ class SettingsStyleView extends StatelessWidget {
curve: FluffyThemes.animationCurve,
child: accountConfig.wallpaperUrl != null
? SwitchListTile.adaptive(
title: Text(L10n.of(context)!.transparent),
title: Text(L10n.of(context).transparent),
secondary: const Icon(Icons.blur_linear_outlined),
value: !wallpaperOpacityIsDefault,
onChanged: (_) =>
@ -301,7 +301,7 @@ class SettingsStyleView extends StatelessWidget {
},
),
ListTile(
title: Text(L10n.of(context)!.fontSize),
title: Text(L10n.of(context).fontSize),
trailing: Text('× ${AppConfig.fontSizeFactor}'),
),
Slider.adaptive(

View file

@ -98,22 +98,22 @@ class UserBottomSheetController extends State<UserBottomSheet> {
final score = await showConfirmationDialog<int>(
context: context,
title: L10n.of(context)!.reportUser,
message: L10n.of(context)!.howOffensiveIsThisContent,
cancelLabel: L10n.of(context)!.cancel,
okLabel: L10n.of(context)!.ok,
title: L10n.of(context).reportUser,
message: L10n.of(context).howOffensiveIsThisContent,
cancelLabel: L10n.of(context).cancel,
okLabel: L10n.of(context).ok,
actions: [
AlertDialogAction(
key: -100,
label: L10n.of(context)!.extremeOffensive,
label: L10n.of(context).extremeOffensive,
),
AlertDialogAction(
key: -50,
label: L10n.of(context)!.offensive,
label: L10n.of(context).offensive,
),
AlertDialogAction(
key: 0,
label: L10n.of(context)!.inoffensive,
label: L10n.of(context).inoffensive,
),
],
);
@ -121,10 +121,10 @@ class UserBottomSheetController extends State<UserBottomSheet> {
final reason = await showTextInputDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.whyDoYouWantToReportThis,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
textFields: [DialogTextField(hintText: L10n.of(context)!.reason)],
title: L10n.of(context).whyDoYouWantToReportThis,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
textFields: [DialogTextField(hintText: L10n.of(context).reason)],
);
if (reason == null || reason.single.isEmpty) return;
@ -139,7 +139,7 @@ class UserBottomSheetController extends State<UserBottomSheet> {
);
if (result.error != null) return;
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(L10n.of(context)!.contentHasBeenReported)),
SnackBar(content: Text(L10n.of(context).contentHasBeenReported)),
);
break;
case UserBottomSheetAction.mention:
@ -152,10 +152,10 @@ class UserBottomSheetController extends State<UserBottomSheet> {
if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.yes,
cancelLabel: L10n.of(context)!.no,
message: L10n.of(context)!.banUserDescription,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).no,
message: L10n.of(context).banUserDescription,
) ==
OkCancelResult.ok) {
await showFutureLoadingDialog(
@ -170,10 +170,10 @@ class UserBottomSheetController extends State<UserBottomSheet> {
if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.yes,
cancelLabel: L10n.of(context)!.no,
message: L10n.of(context)!.unbanUserDescription,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).no,
message: L10n.of(context).unbanUserDescription,
) ==
OkCancelResult.ok) {
await showFutureLoadingDialog(
@ -188,10 +188,10 @@ class UserBottomSheetController extends State<UserBottomSheet> {
if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.yes,
cancelLabel: L10n.of(context)!.no,
message: L10n.of(context)!.kickUserDescription,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).no,
message: L10n.of(context).kickUserDescription,
) ==
OkCancelResult.ok) {
await showFutureLoadingDialog(
@ -300,10 +300,10 @@ class UserBottomSheetController extends State<UserBottomSheet> {
final consent = await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.yes,
cancelLabel: L10n.of(context)!.no,
message: L10n.of(context)!.makeAdminDescription,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).no,
message: L10n.of(context).makeAdminDescription,
);
if (consent != OkCancelResult.ok) return;
}

View file

@ -79,7 +79,7 @@ class UserBottomSheetView extends StatelessWidget {
title: Padding(
padding: const EdgeInsets.only(bottom: 12.0),
child: Text(
L10n.of(context)!
L10n.of(context)
.userWouldLikeToChangeTheChat(displayname),
),
),
@ -92,7 +92,7 @@ class UserBottomSheetView extends StatelessWidget {
),
onPressed: controller.knockAccept,
icon: const Icon(Icons.check_outlined),
label: Text(L10n.of(context)!.accept),
label: Text(L10n.of(context).accept),
),
const SizedBox(width: 12),
TextButton.icon(
@ -104,7 +104,7 @@ class UserBottomSheetView extends StatelessWidget {
),
onPressed: controller.knockDecline,
icon: const Icon(Icons.cancel_outlined),
label: Text(L10n.of(context)!.decline),
label: Text(L10n.of(context).decline),
),
],
),
@ -181,13 +181,13 @@ class UserBottomSheetView extends StatelessWidget {
const SizedBox(width: 12),
if (presence.currentlyActive == true)
Text(
L10n.of(context)!.currentlyActive,
L10n.of(context).currentlyActive,
overflow: TextOverflow.ellipsis,
style: theme.textTheme.bodySmall,
)
else if (lastActiveTimestamp != null)
Text(
L10n.of(context)!.lastActiveAgo(
L10n.of(context).lastActiveAgo(
lastActiveTimestamp
.localizedTimeShort(context),
),
@ -238,7 +238,7 @@ class UserBottomSheetView extends StatelessWidget {
UserBottomSheetAction.message,
),
icon: const Icon(Icons.chat_outlined),
label: Text(L10n.of(context)!.startConversation),
label: Text(L10n.of(context).startConversation),
)
: TextField(
controller: controller.sendController,
@ -250,7 +250,7 @@ class UserBottomSheetView extends StatelessWidget {
decoration: InputDecoration(
errorText: controller.sendError
?.toLocalizedString(context),
hintText: L10n.of(context)!.sendMessages,
hintText: L10n.of(context).sendMessages,
suffix: controller.isSending
? const SizedBox(
width: 16,
@ -272,7 +272,7 @@ class UserBottomSheetView extends StatelessWidget {
if (controller.widget.onMention != null)
ListTile(
leading: const Icon(Icons.alternate_email_outlined),
title: Text(L10n.of(context)!.mention),
title: Text(L10n.of(context).mention),
onTap: () => controller
.participantAction(UserBottomSheetAction.mention),
),
@ -280,7 +280,7 @@ class UserBottomSheetView extends StatelessWidget {
Divider(color: theme.dividerColor),
ListTile(
title: Text(
'${L10n.of(context)!.userRole} (${user.powerLevel})',
'${L10n.of(context).userRole} (${user.powerLevel})',
),
leading: const Icon(Icons.person_outlined),
trailing: Material(
@ -304,19 +304,19 @@ class UserBottomSheetView extends StatelessWidget {
items: [
DropdownMenuItem(
value: 0,
child: Text(L10n.of(context)!.user),
child: Text(L10n.of(context).user),
),
DropdownMenuItem(
value: 50,
child: Text(L10n.of(context)!.moderator),
child: Text(L10n.of(context).moderator),
),
DropdownMenuItem(
value: 100,
child: Text(L10n.of(context)!.admin),
child: Text(L10n.of(context).admin),
),
DropdownMenuItem(
value: null,
child: Text(L10n.of(context)!.custom),
child: Text(L10n.of(context).custom),
),
],
),
@ -328,7 +328,7 @@ class UserBottomSheetView extends StatelessWidget {
ListTile(
textColor: theme.colorScheme.error,
iconColor: theme.colorScheme.error,
title: Text(L10n.of(context)!.kickFromChat),
title: Text(L10n.of(context).kickFromChat),
leading: const Icon(Icons.exit_to_app_outlined),
onTap: () => controller
.participantAction(UserBottomSheetAction.kick),
@ -339,7 +339,7 @@ class UserBottomSheetView extends StatelessWidget {
ListTile(
textColor: theme.colorScheme.onErrorContainer,
iconColor: theme.colorScheme.onErrorContainer,
title: Text(L10n.of(context)!.banFromChat),
title: Text(L10n.of(context).banFromChat),
leading: const Icon(Icons.warning_sharp),
onTap: () =>
controller.participantAction(UserBottomSheetAction.ban),
@ -348,7 +348,7 @@ class UserBottomSheetView extends StatelessWidget {
user.canBan &&
user.membership == Membership.ban)
ListTile(
title: Text(L10n.of(context)!.unbanFromChat),
title: Text(L10n.of(context).unbanFromChat),
leading: const Icon(Icons.warning_outlined),
onTap: () => controller
.participantAction(UserBottomSheetAction.unban),
@ -357,7 +357,7 @@ class UserBottomSheetView extends StatelessWidget {
ListTile(
textColor: theme.colorScheme.onErrorContainer,
iconColor: theme.colorScheme.onErrorContainer,
title: Text(L10n.of(context)!.reportUser),
title: Text(L10n.of(context).reportUser),
leading: const Icon(Icons.gavel_outlined),
onTap: () => controller
.participantAction(UserBottomSheetAction.report),
@ -369,7 +369,7 @@ class UserBottomSheetView extends StatelessWidget {
color: Colors.orange,
),
subtitle: Text(
L10n.of(context)!.profileNotFound,
L10n.of(context).profileNotFound,
style: const TextStyle(color: Colors.orange),
),
),
@ -379,7 +379,7 @@ class UserBottomSheetView extends StatelessWidget {
textColor: theme.colorScheme.onErrorContainer,
iconColor: theme.colorScheme.onErrorContainer,
leading: const Icon(Icons.block_outlined),
title: Text(L10n.of(context)!.block),
title: Text(L10n.of(context).block),
onTap: () => controller
.participantAction(UserBottomSheetAction.ignore),
),

View file

@ -48,8 +48,8 @@ abstract class ClientManager {
await Future.wait(
clients.map(
(client) => client.initWithRestore(
onMigration: () {
final l10n = lookupL10n(PlatformDispatcher.instance.locale);
onMigration: () async {
final l10n = await lookupL10n(PlatformDispatcher.instance.locale);
sendInitNotification(
l10n.databaseMigrationTitle,
l10n.databaseMigrationBody,

View file

@ -35,9 +35,9 @@ extension DateTimeExtension on DateTime {
/// Returns a simple time String.
String localizedTimeOfDay(BuildContext context) =>
L10n.of(context)!.alwaysUse24HourFormat == 'true'
? DateFormat('HH:mm', L10n.of(context)!.localeName).format(this)
: DateFormat('h:mm a', L10n.of(context)!.localeName).format(this);
L10n.of(context).alwaysUse24HourFormat == 'true'
? DateFormat('HH:mm', L10n.of(context).localeName).format(this)
: DateFormat('h:mm a', L10n.of(context).localeName).format(this);
/// Returns [localizedTimeOfDay()] if the ChatTime is today, the name of the week
/// day if the ChatTime is this week and a date string else.
@ -77,7 +77,7 @@ extension DateTimeExtension on DateTime {
final sameDay = sameYear && now.month == month && now.day == day;
if (sameDay) return localizedTimeOfDay(context);
return L10n.of(context)!.dateAndTimeOfDay(
return L10n.of(context).dateAndTimeOfDay(
localizedTimeShort(context),
localizedTimeOfDay(context),
);

View file

@ -21,7 +21,7 @@ class ErrorReporter {
await showAdaptiveDialog(
context: context,
builder: (context) => AlertDialog.adaptive(
title: Text(L10n.of(context)!.reportErrorDescription),
title: Text(L10n.of(context).reportErrorDescription),
content: SizedBox(
height: 256,
width: 256,
@ -36,13 +36,13 @@ class ErrorReporter {
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: Text(L10n.of(context)!.close),
child: Text(L10n.of(context).close),
),
TextButton(
onPressed: () => Clipboard.setData(
ClipboardData(text: text),
),
child: Text(L10n.of(context)!.copy),
child: Text(L10n.of(context).copy),
),
TextButton(
onPressed: () => launchUrl(
@ -56,7 +56,7 @@ class ErrorReporter {
),
mode: LaunchMode.externalApplication,
),
child: Text(L10n.of(context)!.report),
child: Text(L10n.of(context).report),
),
],
),

View file

@ -25,7 +25,7 @@ abstract class FluffyShare {
ClipboardData(text: text),
);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(L10n.of(context)!.copiedToClipboard)),
SnackBar(content: Text(L10n.of(context).copiedToClipboard)),
);
return;
}
@ -34,7 +34,7 @@ abstract class FluffyShare {
final client = Matrix.of(context).client;
final ownProfile = await client.fetchOwnProfile();
await FluffyShare.share(
L10n.of(context)!.inviteText(
L10n.of(context).inviteText(
ownProfile.displayName ?? client.userID!,
'https://matrix.to/#/${client.userID}?client=im.fluffychat',
),

View file

@ -101,7 +101,7 @@ extension InitWithRestoreExtension on Client {
}
} catch (e, s) {
Logs().wtf('Client init failed!', e, s);
final l10n = lookupL10n(PlatformDispatcher.instance.locale);
final l10n = await lookupL10n(PlatformDispatcher.instance.locale);
final sessionBackupString = await storage?.read(key: storageKey);
if (sessionBackupString == null) {
ClientManager.sendInitNotification(

View file

@ -30,7 +30,7 @@ extension LocalizedExceptionExtension on Object {
]) {
if (this is FileTooBigMatrixException) {
final exception = this as FileTooBigMatrixException;
return L10n.of(context)!.fileIsTooBigForServer(
return L10n.of(context).fileIsTooBigForServer(
_formatFileSize(exception.maxFileSize),
);
}
@ -38,17 +38,17 @@ extension LocalizedExceptionExtension on Object {
switch ((this as MatrixException).error) {
case MatrixError.M_FORBIDDEN:
if (exceptionContext == ExceptionContext.changePassword) {
return L10n.of(context)!.passwordIsWrong;
return L10n.of(context).passwordIsWrong;
}
return L10n.of(context)!.noPermission;
return L10n.of(context).noPermission;
case MatrixError.M_LIMIT_EXCEEDED:
return L10n.of(context)!.tooManyRequestsWarning;
return L10n.of(context).tooManyRequestsWarning;
default:
return (this as MatrixException).errorMessage;
}
}
if (this is InvalidPassphraseException) {
return L10n.of(context)!.wrongRecoveryKey;
return L10n.of(context).wrongRecoveryKey;
}
if (this is BadServerVersionsException) {
final serverVersions = (this as BadServerVersionsException)
@ -61,7 +61,7 @@ extension LocalizedExceptionExtension on Object {
.toString()
.replaceAll('{', '"')
.replaceAll('}', '"');
return L10n.of(context)!.badServerVersionsException(
return L10n.of(context).badServerVersionsException(
serverVersions,
supportedVersions,
serverVersions,
@ -79,7 +79,7 @@ extension LocalizedExceptionExtension on Object {
.toString()
.replaceAll('{', '"')
.replaceAll('}', '"');
return L10n.of(context)!.badServerLoginTypesException(
return L10n.of(context).badServerLoginTypesException(
serverVersions,
supportedVersions,
supportedVersions,
@ -89,16 +89,16 @@ extension LocalizedExceptionExtension on Object {
this is SocketException ||
this is SyncConnectionException ||
this is ClientException) {
return L10n.of(context)!.noConnectionToTheServer;
return L10n.of(context).noConnectionToTheServer;
}
if (this is FormatException &&
exceptionContext == ExceptionContext.checkHomeserver) {
return L10n.of(context)!.doesNotSeemToBeAValidHomeserver;
return L10n.of(context).doesNotSeemToBeAValidHomeserver;
}
if (this is String) return toString();
if (this is UiaException) return toString();
Logs().w('Something went wrong: ', this);
return L10n.of(context)!.oopsSomethingWentWrong;
return L10n.of(context).oopsSomethingWentWrong;
}
}

View file

@ -43,7 +43,7 @@ Future<DatabaseApi> flutterMatrixSdkDatabaseBuilder(Client client) async {
try {
// Send error notification:
final l10n = lookupL10n(PlatformDispatcher.instance.locale);
final l10n = await lookupL10n(PlatformDispatcher.instance.locale);
ClientManager.sendInitNotification(
l10n.initAppError,
l10n.databaseBuildErrorBody(

View file

@ -57,7 +57,7 @@ void _sendNoEncryptionWarning(Object exception) async {
if (isStored == true) return;
final l10n = lookupL10n(PlatformDispatcher.instance.locale);
final l10n = await lookupL10n(PlatformDispatcher.instance.locale);
ClientManager.sendInitNotification(
l10n.noDatabaseEncryption,
exception.toString(),

View file

@ -20,7 +20,7 @@ extension MatrixFileExtension on MatrixFile {
}
final downloadPath = await FilePicker.platform.saveFile(
dialogTitle: L10n.of(context)!.saveFile,
dialogTitle: L10n.of(context).saveFile,
fileName: name,
type: filePickerFileType,
bytes: bytes,
@ -38,7 +38,7 @@ extension MatrixFileExtension on MatrixFile {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
L10n.of(context)!.fileHasBeenSavedAt(downloadPath),
L10n.of(context).fileHasBeenSavedAt(downloadPath),
),
),
);

View file

@ -52,7 +52,7 @@ abstract class PlatformInfos {
TextButton.icon(
onPressed: () => launchUrlString(AppConfig.sourceCodeUrl),
icon: const Icon(Icons.source_outlined),
label: Text(L10n.of(context)!.sourceCode),
label: Text(L10n.of(context).sourceCode),
),
TextButton.icon(
onPressed: () => launchUrlString(AppConfig.emojiFontUrl),

View file

@ -35,7 +35,7 @@ Future<void> pushHelper(
} catch (e, s) {
Logs().v('Push Helper has crashed!', e, s);
l10n ??= lookupL10n(const Locale('en'));
l10n ??= await lookupL10n(const Locale('en'));
flutterLocalNotificationsPlugin.show(
notification.roomId?.hashCode ?? 0,
l10n.newMessageInFluffyChat,

View file

@ -12,24 +12,24 @@ extension RoomStatusExtension on Room {
typingUsers.removeWhere((User u) => u.id == client.userID);
if (AppConfig.hideTypingUsernames) {
typingText = L10n.of(context)!.isTyping;
typingText = L10n.of(context).isTyping;
if (typingUsers.first.id != directChatMatrixID) {
typingText =
L10n.of(context)!.numUsersTyping(typingUsers.length.toString());
L10n.of(context).numUsersTyping(typingUsers.length.toString());
}
} else if (typingUsers.length == 1) {
typingText = L10n.of(context)!.isTyping;
typingText = L10n.of(context).isTyping;
if (typingUsers.first.id != directChatMatrixID) {
typingText =
L10n.of(context)!.userIsTyping(typingUsers.first.calcDisplayname());
L10n.of(context).userIsTyping(typingUsers.first.calcDisplayname());
}
} else if (typingUsers.length == 2) {
typingText = L10n.of(context)!.userAndUserAreTyping(
typingText = L10n.of(context).userAndUserAreTyping(
typingUsers.first.calcDisplayname(),
typingUsers[1].calcDisplayname(),
);
} else if (typingUsers.length > 2) {
typingText = L10n.of(context)!.userAndOthersAreTyping(
typingText = L10n.of(context).userAndOthersAreTyping(
typingUsers.first.calcDisplayname(),
(typingUsers.length - 1).toString(),
);

View file

@ -35,13 +35,13 @@ abstract class UpdateNotifier {
),
Expanded(
child: Text(
L10n.of(context)!.updateInstalled(currentVersion),
L10n.of(context).updateInstalled(currentVersion),
),
),
],
),
action: SnackBarAction(
label: L10n.of(context)!.changelog,
label: L10n.of(context).changelog,
onPressed: () => launchUrlString(AppConfig.changelogUrl),
),
),

Some files were not shown because too many files have changed in this diff Show more