refactor: Update to Dart 3.10 with . shorthands
This commit is contained in:
parent
75a37f3f7c
commit
1ea649f01e
167 changed files with 3351 additions and 3912 deletions
|
|
@ -31,22 +31,22 @@ class SessionBackup {
|
|||
SessionBackup.fromJson(jsonDecode(json));
|
||||
|
||||
factory SessionBackup.fromJson(Map<String, dynamic> json) => SessionBackup(
|
||||
olmAccount: json['olm_account'],
|
||||
accessToken: json['access_token'],
|
||||
userId: json['user_id'],
|
||||
homeserver: json['homeserver'],
|
||||
deviceId: json['device_id'],
|
||||
deviceName: json['device_name'],
|
||||
);
|
||||
olmAccount: json['olm_account'],
|
||||
accessToken: json['access_token'],
|
||||
userId: json['user_id'],
|
||||
homeserver: json['homeserver'],
|
||||
deviceId: json['device_id'],
|
||||
deviceName: json['device_name'],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'olm_account': olmAccount,
|
||||
'access_token': accessToken,
|
||||
'user_id': userId,
|
||||
'homeserver': homeserver,
|
||||
'device_id': deviceId,
|
||||
if (deviceName != null) 'device_name': deviceName,
|
||||
};
|
||||
'olm_account': olmAccount,
|
||||
'access_token': accessToken,
|
||||
'user_id': userId,
|
||||
'homeserver': homeserver,
|
||||
'device_id': deviceId,
|
||||
if (deviceName != null) 'device_name': deviceName,
|
||||
};
|
||||
|
||||
@override
|
||||
String toString() => jsonEncode(toJson());
|
||||
|
|
@ -82,7 +82,8 @@ extension InitWithRestoreExtension on Client {
|
|||
final homeserver = this.homeserver?.toString();
|
||||
final deviceId = deviceID;
|
||||
final userId = userID;
|
||||
final hasBackup = accessToken != null &&
|
||||
final hasBackup =
|
||||
accessToken != null &&
|
||||
homeserver != null &&
|
||||
deviceId != null &&
|
||||
userId != null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue