Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.7.5"
flutter-version: "3.10.6"
channel: "stable"

# Install dependencies
Expand Down
3 changes: 2 additions & 1 deletion lib/jmap/core/method/request/parse_method.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import 'package:jmap_dart_client/jmap/account_id.dart';
import 'package:jmap_dart_client/jmap/core/id.dart';
import 'package:jmap_dart_client/jmap/core/method/method.dart';
import 'package:jmap_dart_client/jmap/core/method/request/get_method.dart';

abstract class ParseMethod<T> extends MethodRequiringAccountId {
abstract class ParseMethod<T> extends MethodRequiringAccountId with OptionalProperties {

final Set<Id> blobIds;

Expand Down
2 changes: 1 addition & 1 deletion lib/jmap/core/method/response/parse_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:jmap_dart_client/jmap/core/id.dart';
import 'package:jmap_dart_client/jmap/core/method/method_response.dart';

abstract class ParseResponse<T> extends ResponseRequiringAccountId {
final Map<Id, T>? parsed;
final Map<Id, List<T>>? parsed;
final List<Id>? notParsable;
final List<Id>? notFound;

Expand Down
12 changes: 11 additions & 1 deletion lib/jmap/mail/calendar/parse/calendar_event_parse_method.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:jmap_dart_client/http/converter/account_id_converter.dart';
import 'package:jmap_dart_client/http/converter/id_converter.dart';
import 'package:jmap_dart_client/http/converter/properties_converter.dart';
import 'package:jmap_dart_client/jmap/core/capability/capability_identifier.dart';
import 'package:jmap_dart_client/jmap/core/method/request/parse_method.dart';
import 'package:jmap_dart_client/jmap/core/request/request_invocation.dart';
Expand All @@ -24,9 +25,18 @@ class CalendarEventParseMethod extends ParseMethod<CalendarEvent> {
'accountId': const AccountIdConverter().toJson(accountId),
'blobIds': blobIds.map(const IdConverter().toJson).toList()
};

void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}

writeNotNull('properties', const PropertiesConverter().toJson(properties));

return val;
}

@override
List<Object?> get props => [accountId, blobIds];
List<Object?> get props => [accountId, blobIds, properties];
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class CalendarEventParseResponse extends ParseResponse<CalendarEvent> {
CalendarEventParseResponse(
AccountId accountId,
{
Map<Id, CalendarEvent>? parsed,
Map<Id, List<CalendarEvent>>? parsed,
List<Id>? notParsable,
List<Id>? notFound
}
Expand All @@ -26,7 +26,7 @@ class CalendarEventParseResponse extends ParseResponse<CalendarEvent> {
parsed: (json['parsed'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(
const IdConverter().fromJson(key),
CalendarEvent.fromJson(value as Map<String, dynamic>)
(value as List<dynamic>).map((e) => CalendarEvent.fromJson(e as Map<String, dynamic>)).toList()
)),
notParsable: (json['notParsable'] as List<dynamic>?)
?.map((value) => const IdConverter().fromJson(value as String))
Expand Down
Loading