refactor: Migrate to flutter 2
This commit is contained in:
parent
d729dbe1b7
commit
b0ada828aa
39 changed files with 257 additions and 315 deletions
|
|
@ -13,5 +13,5 @@ Future<Database> constructDb(
|
|||
}
|
||||
|
||||
Future<String> getLocalstorage(String key) async {
|
||||
return await window.localStorage[key];
|
||||
return window.localStorage[key];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class Store {
|
|||
if (!PlatformInfos.isMobile) {
|
||||
await _setupLocalStorage();
|
||||
try {
|
||||
return await storage.getItem(key)?.toString();
|
||||
return storage.getItem(key)?.toString();
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,13 +46,13 @@ abstract class PlatformInfos {
|
|||
useRootNavigator: false,
|
||||
children: [
|
||||
Text('Version: $version'),
|
||||
RaisedButton(
|
||||
child: Text(L10n.of(context).sourceCode),
|
||||
OutlinedButton(
|
||||
onPressed: () => launch(AppConfig.sourceCodeUrl),
|
||||
child: Text(L10n.of(context).sourceCode),
|
||||
),
|
||||
RaisedButton(
|
||||
child: Text(AppConfig.emojiFontName),
|
||||
OutlinedButton(
|
||||
onPressed: () => launch(AppConfig.emojiFontUrl),
|
||||
child: Text(AppConfig.emojiFontName),
|
||||
),
|
||||
SentrySwitchListTile(label: L10n.of(context).sendBugReports),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class UrlLauncher {
|
|||
}
|
||||
} else {
|
||||
await AdaptivePageLayout.of(context)
|
||||
.pushNamedAndRemoveUntilIsFirst('/discover/${roomIdOrAlias}');
|
||||
.pushNamedAndRemoveUntilIsFirst('/discover/$roomIdOrAlias');
|
||||
}
|
||||
} else if (identityParts.primaryIdentifier.sigil == '@') {
|
||||
final user = User(
|
||||
|
|
@ -109,7 +109,7 @@ class UrlLauncher {
|
|||
var roomId = matrix.client.getDirectChatFromUserId(user.id);
|
||||
if (roomId != null) {
|
||||
await AdaptivePageLayout.of(context)
|
||||
.pushNamedAndRemoveUntilIsFirst('/rooms/${roomId}');
|
||||
.pushNamedAndRemoveUntilIsFirst('/rooms/$roomId');
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -128,7 +128,7 @@ class UrlLauncher {
|
|||
|
||||
if (roomId != null) {
|
||||
await AdaptivePageLayout.of(context)
|
||||
.pushNamedAndRemoveUntilIsFirst('/rooms/${roomId}');
|
||||
.pushNamedAndRemoveUntilIsFirst('/rooms/$roomId');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue