Skip to content

Commit 8179e13

Browse files
committed
style: use orElse instead of firstWhereOrNull
1 parent 15c3f53 commit 8179e13

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/gotrue/lib/src/types/mfa.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ class AMREntry {
296296

297297
factory AMREntry.fromJson(Map<String, dynamic> json) {
298298
return AMREntry(
299-
method: AMRMethod.values.firstWhereOrNull(
300-
(e) => e.code == json['method'],
301-
) ??
302-
AMRMethod.unknown,
299+
method: AMRMethod.values.firstWhere(
300+
(e) => e.code == json['method'],
301+
orElse: () => AMRMethod.unknown,
302+
),
303303
timestamp: DateTime.fromMillisecondsSinceEpoch(json['timestamp'] * 1000),
304304
);
305305
}

0 commit comments

Comments
 (0)