refactor: Use non nullable localizations builder and lazy load on web
This commit is contained in:
parent
8cedd2a45a
commit
0d4b7d67cc
111 changed files with 879 additions and 883 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue