Skip to content

Commit 1f8df69

Browse files
committed
refactor: simplify JSON handling in getEvents method
1 parent 248addb commit 1f8df69

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

lib/src/infrastructure/platform_implementations/calendar_bridge_method_channel.dart

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,9 @@ final class CalendarBridgeMethodChannel implements CalendarRepository {
7979

8080
return result.map(
8181
(json) {
82-
print('DEBUG: json type: ${json.runtimeType}');
83-
print('DEBUG: json content: $json');
84-
if (json is Map<String, dynamic>) {
85-
return CalendarEvent.fromJson(json);
86-
} else {
87-
return CalendarEvent.fromJson(
88-
_convertToStringDynamicMap(json as Map<Object?, Object?>),
89-
);
90-
}
82+
return CalendarEvent.fromJson(
83+
_convertToStringDynamicMap(json as Map<Object?, Object?>),
84+
);
9185
},
9286
).toList();
9387
} on PlatformException catch (e) {

0 commit comments

Comments
 (0)