Merge pull request #490 from ente-io/migrate-to-null-safety
Migrate to null safety
This commit is contained in:
commit
8d8169f8c0
|
@ -1,5 +1,3 @@
|
|||
// @dart=2.9
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
class KeyAttributes {
|
||||
|
@ -71,18 +69,18 @@ class KeyAttributes {
|
|||
KeyAttributes.fromMap(json.decode(source));
|
||||
|
||||
KeyAttributes copyWith({
|
||||
String kekSalt,
|
||||
String encryptedKey,
|
||||
String keyDecryptionNonce,
|
||||
String publicKey,
|
||||
String encryptedSecretKey,
|
||||
String secretKeyDecryptionNonce,
|
||||
int memLimit,
|
||||
int opsLimit,
|
||||
String masterKeyEncryptedWithRecoveryKey,
|
||||
String masterKeyDecryptionNonce,
|
||||
String recoveryKeyEncryptedWithMasterKey,
|
||||
String recoveryKeyDecryptionNonce,
|
||||
String? kekSalt,
|
||||
String? encryptedKey,
|
||||
String? keyDecryptionNonce,
|
||||
String? publicKey,
|
||||
String? encryptedSecretKey,
|
||||
String? secretKeyDecryptionNonce,
|
||||
int? memLimit,
|
||||
int? opsLimit,
|
||||
String? masterKeyEncryptedWithRecoveryKey,
|
||||
String? masterKeyDecryptionNonce,
|
||||
String? recoveryKeyEncryptedWithMasterKey,
|
||||
String? recoveryKeyDecryptionNonce,
|
||||
}) {
|
||||
return KeyAttributes(
|
||||
kekSalt ?? this.kekSalt,
|
||||
|
|
|
@ -34,16 +34,6 @@ class LocationDataFromResponse {
|
|||
required this.bbox,
|
||||
});
|
||||
|
||||
LocationDataFromResponse copyWith({
|
||||
required String place,
|
||||
required List<double> bbox,
|
||||
}) {
|
||||
return LocationDataFromResponse(
|
||||
place: place,
|
||||
bbox: bbox,
|
||||
);
|
||||
}
|
||||
|
||||
factory LocationDataFromResponse.fromMap(Map<String, dynamic> map) {
|
||||
return LocationDataFromResponse(
|
||||
place: map['place'] as String,
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
// @dart=2.9
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
class SetKeysRequest {
|
||||
final String kekSalt;
|
||||
final String encryptedKey;
|
||||
|
@ -10,11 +6,11 @@ class SetKeysRequest {
|
|||
final int opsLimit;
|
||||
|
||||
SetKeysRequest({
|
||||
this.kekSalt,
|
||||
this.encryptedKey,
|
||||
this.keyDecryptionNonce,
|
||||
this.memLimit,
|
||||
this.opsLimit,
|
||||
required this.kekSalt,
|
||||
required this.encryptedKey,
|
||||
required this.keyDecryptionNonce,
|
||||
required this.memLimit,
|
||||
required this.opsLimit,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
|
@ -26,19 +22,4 @@ class SetKeysRequest {
|
|||
'opsLimit': opsLimit,
|
||||
};
|
||||
}
|
||||
|
||||
factory SetKeysRequest.fromMap(Map<String, dynamic> map) {
|
||||
return SetKeysRequest(
|
||||
kekSalt: map['kekSalt'],
|
||||
encryptedKey: map['encryptedKey'],
|
||||
keyDecryptionNonce: map['keyDecryptionNonce'],
|
||||
memLimit: map['memLimit'],
|
||||
opsLimit: map['opsLimit'],
|
||||
);
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory SetKeysRequest.fromJson(String source) =>
|
||||
SetKeysRequest.fromMap(json.decode(source));
|
||||
}
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
// @dart=2.9
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
class SetRecoveryKeyRequest {
|
||||
final String masterKeyEncryptedWithRecoveryKey;
|
||||
final String masterKeyDecryptionNonce;
|
||||
|
@ -23,18 +19,4 @@ class SetRecoveryKeyRequest {
|
|||
'recoveryKeyDecryptionNonce': recoveryKeyDecryptionNonce,
|
||||
};
|
||||
}
|
||||
|
||||
factory SetRecoveryKeyRequest.fromMap(Map<String, dynamic> map) {
|
||||
return SetRecoveryKeyRequest(
|
||||
map['masterKeyEncryptedWithRecoveryKey'],
|
||||
map['masterKeyDecryptionNonce'],
|
||||
map['recoveryKeyEncryptedWithMasterKey'],
|
||||
map['recoveryKeyDecryptionNonce'],
|
||||
);
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory SetRecoveryKeyRequest.fromJson(String source) =>
|
||||
SetRecoveryKeyRequest.fromMap(json.decode(source));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue