omit type in tryGet

This commit is contained in:
Lukas Lihotzki 2021-07-02 11:11:29 +02:00
parent 4026f480fb
commit 0d1e7bdf7b
3 changed files with 6 additions and 6 deletions

View File

@ -37,10 +37,10 @@ class RoomKeyRequestContent {
RoomKeyRequestContent.fromJson(Map<String, dynamic> json)
: body = ((x) => x != null ? RequestedKeyInfo.fromJson(x) : null)(
json.tryGet<Map<String, dynamic>>('body')),
action = json.tryGet<String>('action') ?? '',
requestingDeviceId = json.tryGet<String>('requesting_device_id') ?? '',
requestId = json.tryGet<String>('request_id') ?? '';
json.tryGet('body')),
action = json.tryGet('action') ?? '',
requestingDeviceId = json.tryGet('requesting_device_id') ?? '',
requestId = json.tryGet('request_id') ?? '';
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};

View File

@ -36,7 +36,7 @@ class SecretStorageDefaultKeyContent {
SecretStorageDefaultKeyContent({required this.key});
SecretStorageDefaultKeyContent.fromJson(Map<String, dynamic> json)
: key = json.tryGet<String>('key');
: key = json.tryGet('key');
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};

View File

@ -73,7 +73,7 @@ class PassphraseInfo {
: algorithm = json.tryGet('algorithm'),
salt = json.tryGet('salt'),
iterations = json.tryGet('iterations'),
bits = json.tryGet<int>('bits');
bits = json.tryGet('bits');
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};