Merge pull request #490 from ente-io/migrate-to-null-safety

Migrate to null safety
This commit is contained in:
Ashil 2022-09-16 11:56:04 +05:30 committed by GitHub
commit 8d8169f8c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 66 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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));
}

View file

@ -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));
}