diff --git a/lib/fake_matrix_api.dart b/lib/fake_matrix_api.dart index 76002f73..76e9da9c 100644 --- a/lib/fake_matrix_api.dart +++ b/lib/fake_matrix_api.dart @@ -44,7 +44,7 @@ T? tryCast(dynamic object) => object is T ? object : null; /// A mock http client for testing purposes. class FakeMatrixApi extends MockClient { - static final calledEndpoints = >{}; + static final calledEndpoints = >{}; static int eventCounter = 0; FakeMatrixApi() @@ -82,7 +82,7 @@ class FakeMatrixApi extends MockClient { // Call API if (!calledEndpoints.containsKey(action)) { - calledEndpoints[action] = []; + calledEndpoints[action] = []; } calledEndpoints[action]!.add(data); if (api.containsKey(method) && api[method]!.containsKey(action)) { diff --git a/lib/src/model/matrix_exception.dart b/lib/src/model/matrix_exception.dart index 811b1e13..1c10b55c 100644 --- a/lib/src/model/matrix_exception.dart +++ b/lib/src/model/matrix_exception.dart @@ -109,10 +109,10 @@ class MatrixException implements Exception { /// to authenticate itself. Each flow comprises a series of stages. If this request /// doesn't need additional authentication, then this is null. List? get authenticationFlows => raw - .tryGet>('flows') + .tryGet>('flows') ?.whereType>() .map((flow) => flow['stages']) - .whereType>() + .whereType>() .map((stages) => AuthenticationFlow(List.from(stages.whereType()))) .toList(); diff --git a/lib/src/model/sync_update.dart b/lib/src/model/sync_update.dart index 176379f0..f78fb566 100644 --- a/lib/src/model/sync_update.dart +++ b/lib/src/model/sync_update.dart @@ -51,15 +51,15 @@ class SyncUpdate { return temp != null ? RoomsUpdate.fromJson(temp) : null; }()), presence = json - .tryGetMap>('presence')?['events'] + .tryGetMap>('presence')?['events'] ?.map((i) => Presence.fromJson(i as Map)) .toList(), accountData = json - .tryGetMap>('account_data')?['events'] + .tryGetMap>('account_data')?['events'] ?.map((i) => BasicEvent.fromJson(i as Map)) .toList(), toDevice = json - .tryGetMap>('to_device')?['events'] + .tryGetMap>('to_device')?['events'] ?.map( (i) => BasicEventWithSender.fromJson(i as Map)) .toList(), @@ -167,16 +167,16 @@ class JoinedRoomUpdate extends SyncRoomUpdate { JoinedRoomUpdate.fromJson(Map json) : summary = json.tryGetFromJson('summary', RoomSummary.fromJson), state = json - .tryGetMap>('state')?['events'] + .tryGetMap>('state')?['events'] ?.map((i) => MatrixEvent.fromJson(i as Map)) .toList(), timeline = json.tryGetFromJson('timeline', TimelineUpdate.fromJson), ephemeral = json - .tryGetMap>('ephemeral')?['events'] + .tryGetMap>('ephemeral')?['events'] ?.map((i) => BasicRoomEvent.fromJson(i as Map)) .toList(), accountData = json - .tryGetMap>('account_data')?['events'] + .tryGetMap>('account_data')?['events'] ?.map((i) => BasicRoomEvent.fromJson(i as Map)) .toList(), unreadNotifications = json.tryGetFromJson( @@ -219,7 +219,7 @@ class InvitedRoomUpdate extends SyncRoomUpdate { InvitedRoomUpdate.fromJson(Map json) : inviteState = json - .tryGetMap>('invite_state')?['events'] + .tryGetMap>('invite_state')?['events'] ?.map((i) => StrippedStateEvent.fromJson(i as Map)) .toList(); @@ -247,12 +247,12 @@ class LeftRoomUpdate extends SyncRoomUpdate { LeftRoomUpdate.fromJson(Map json) : state = json - .tryGetMap>('state')?['events'] + .tryGetMap>('state')?['events'] ?.map((i) => MatrixEvent.fromJson(i as Map)) .toList(), timeline = json.tryGetFromJson('timeline', TimelineUpdate.fromJson), accountData = json - .tryGetMap>('account_data')?['events'] + .tryGetMap>('account_data')?['events'] ?.map((i) => BasicRoomEvent.fromJson(i as Map)) .toList();