Skip to content

Commit

Permalink
Upgrade Flutter v3.24.5
Browse files Browse the repository at this point in the history
  • Loading branch information
tddang-linagora committed Jan 9, 2025
1 parent 00a9760 commit 86af20b
Show file tree
Hide file tree
Showing 24 changed files with 116 additions and 102 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name: CI

env:
FLUTTER_VERSION: 3.22.2
FLUTTER_VERSION: 3.24.5

# Controls when the workflow will run
on: [push, pull_request, workflow_dispatch]
Expand Down
2 changes: 1 addition & 1 deletion lib/http/converter/email/email_body_value_converter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ class EmailBodyValueConverter {
}

MapEntry<String, dynamic> toJson(PartId partId, EmailBodyValue value) {
return MapEntry(PartIdConverter().toJson(partId), value.toJson());
return MapEntry(const PartIdConverter().toJson(partId), value.toJson());
}
}
2 changes: 1 addition & 1 deletion lib/http/converter/email/email_mailbox_ids_converter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ class EmailMailboxIdsConverter {
MapEntry<MailboxId, bool> parseEntry(String key, bool value) => MapEntry(MailboxId(Id(key)), value);

MapEntry<String, bool> toJson(MailboxId mailboxId, bool value) {
return MapEntry(IdConverter().toJson(mailboxId.id), value);
return MapEntry(const IdConverter().toJson(mailboxId.id), value);
}
}
2 changes: 1 addition & 1 deletion lib/http/converter/method_response_converter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class MethodResponseConverter implements JsonConverter<MethodResponse, dynamic>

@override
MethodResponse fromJson(dynamic json) {
return this.fromJson(json);
return fromJson(json);
}

@override
Expand Down
4 changes: 1 addition & 3 deletions lib/jmap/core/method/request/get_method.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ mixin OptionalIds {
Set<Id>? ids;

void addIds(Set<Id> values) {
if (ids == null) {
ids = Set();
}
ids ??= <Id>{};
ids?.addAll(values);
}
}
Expand Down
4 changes: 1 addition & 3 deletions lib/jmap/core/method/request/query_method.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ mixin OptionalSort {
Set<Comparator>? sort;

void addSorts(Set<Comparator> value) {
if (sort == null) {
sort = Set();
}
sort ??= <Comparator>{};
sort?.addAll(value);
}
}
Expand Down
22 changes: 6 additions & 16 deletions lib/jmap/core/method/request/set_method.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mixin OptionalIfInState {
State? ifInState;

void addIfInState(State? state) {
this.ifInState = state;
ifInState = state;
}
}

Expand All @@ -31,16 +31,12 @@ mixin OptionalCreate<T> {
Map<Id, T>? create;

void addCreates(Map<Id, T> creates) {
if (create == null) {
create = Map<Id, T>();
}
create ??= <Id, T>{};
create?.addAll(creates);
}

void addCreate(Id id, T createItem) {
if (create == null) {
create = Map<Id, T>();
}
create ??= <Id, T>{};
create?.addAll({id: createItem});
}
}
Expand All @@ -50,9 +46,7 @@ mixin OptionalUpdate {
Map<Id, PatchObject>? update;

void addUpdates(Map<Id, PatchObject> updates) {
if (update == null) {
update = Map<Id, PatchObject>();
}
update ??= <Id, PatchObject>{};
update?.addAll(updates);
}
}
Expand All @@ -62,9 +56,7 @@ mixin OptionalDestroy {
Set<Id>? destroy;

void addDestroy(Set<Id> values) {
if (destroy == null) {
destroy = Set();
}
destroy ??= <Id>{};
destroy?.addAll(values);
}
}
Expand All @@ -74,9 +66,7 @@ mixin OptionalUpdateSingleton<T> {
Map<Id, T>? updateSingleton;

void addUpdatesSingleton(Map<Id, T> updates) {
if (updateSingleton == null) {
updateSingleton = Map<Id, T>();
}
updateSingleton ??= <Id, T>{};
updateSingleton?.addAll(updates);
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/jmap/core/patch_object.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:equatable/equatable.dart';

class PatchObject with EquatableMixin {

static final mailboxIdsProperty = 'mailboxIds';
static final keywordsProperty = 'keywords';
static const mailboxIdsProperty = 'mailboxIds';
static const keywordsProperty = 'keywords';
static const identityIdsProperty = 'identityIds';

PatchObject(this.patches);
Expand Down
2 changes: 1 addition & 1 deletion lib/jmap/core/properties/properties.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Properties with EquatableMixin {

Properties(this.value);

static Properties empty() => Properties(Set());
static Properties empty() => Properties(<String>{});

Properties union(Properties other) => Properties(value.union(other.value));

Expand Down
2 changes: 1 addition & 1 deletion lib/jmap/core/response/response_object.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ResponseObject with EquatableMixin {

Map<String, dynamic> toJson() => _$ResponseObjectToJson(this);

T? parse<T extends MethodResponse>(MethodCallId methodCallId, T fromJson(Map<String, dynamic> o), {MethodName? methodName}) {
T? parse<T extends MethodResponse>(MethodCallId methodCallId, T Function(Map<String, dynamic> o) fromJson, {MethodName? methodName}) {
final matchedResponse = methodResponses.firstWhere((method) => methodName == null
? method.methodCallId == methodCallId
: (method.methodCallId == methodCallId && _validMethodResponseName(method, methodName)));
Expand Down
6 changes: 2 additions & 4 deletions lib/jmap/core/session/session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@ class Session with EquatableMixin {
);

factory Session.fromJson(Map<String, dynamic> json, {CapabilitiesConverter? converter}) {
if (converter == null) {
converter = CapabilitiesConverter.defaultConverter;
}
converter ??= CapabilitiesConverter.defaultConverter;
return Session(
(json['capabilities'] as Map<String, dynamic>)
.map((key, value) => converter!.convert(key, value)),
(json['accounts'] as Map<String, dynamic>)
.map((key, value) => AccountConverter().convert(key, value, converter!)),
.map((key, value) => const AccountConverter().convert(key, value, converter!)),
(json['primaryAccounts'] as Map<String, dynamic>)
.map((key, value) => MapEntry(
CapabilityIdentifier(Uri.parse(key)),
Expand Down
16 changes: 8 additions & 8 deletions lib/jmap/identities/set/set_identity_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,29 @@ class SetIdentityResponse extends SetResponse<Identity> {
static SetIdentityResponse deserialize(Map<String, dynamic> json) {
return SetIdentityResponse(
const AccountIdConverter().fromJson(json['accountId'] as String),
newState: StateNullableConverter().fromJson(json['newState'] as String?),
oldState: StateNullableConverter().fromJson(json['oldState'] as String?),
newState: const StateNullableConverter().fromJson(json['newState'] as String?),
oldState: const StateNullableConverter().fromJson(json['oldState'] as String?),
created: (json['created'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(
IdConverter().fromJson(key),
const IdConverter().fromJson(key),
Identity.fromJson(value as Map<String, dynamic>))),
updated: (json['updated'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(
IdConverter().fromJson(key),
const IdConverter().fromJson(key),
value != null ? Identity.fromJson(value as Map<String, dynamic>) : null)),
destroyed: (json['destroyed'] as List<dynamic>?)
?.map((id) => IdConverter().fromJson(id)).toSet(),
?.map((id) => const IdConverter().fromJson(id)).toSet(),
notCreated: (json['notCreated'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(
IdConverter().fromJson(key),
const IdConverter().fromJson(key),
SetError.fromJson(value))),
notUpdated: (json['notUpdated'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(
IdConverter().fromJson(key),
const IdConverter().fromJson(key),
SetError.fromJson(value))),
notDestroyed: (json['notDestroyed'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(
IdConverter().fromJson(key),
const IdConverter().fromJson(key),
SetError.fromJson(value))),
);
}
Expand Down
1 change: 1 addition & 0 deletions lib/jmap/mail/email/get/get_email_method.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class GetEmailMethod extends GetMethod with OptionalEmailBodyProperties, Optiona

factory GetEmailMethod.fromJson(Map<String, dynamic> json) => _$GetEmailMethodFromJson(json);

@override
Map<String, dynamic> toJson() => _$GetEmailMethodToJson(this);
}

Expand Down
1 change: 0 additions & 1 deletion lib/jmap/mail/email/query/query_email_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,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/state_converter.dart';
import 'package:jmap_dart_client/http/converter/unsigned_int_converter.dart';
import 'package:jmap_dart_client/http/converter/unsigned_int_nullable_converter.dart';
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/response/query_response.dart';
Expand Down
45 changes: 30 additions & 15 deletions lib/jmap/mail/email/query/query_email_response.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions lib/jmap/mail/email/set/set_email_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,29 @@ class SetEmailResponse extends SetResponse<Email> {
static SetEmailResponse deserialize(Map<String, dynamic> json) {
return SetEmailResponse(
const AccountIdConverter().fromJson(json['accountId'] as String),
newState: StateNullableConverter().fromJson(json['newState'] as String?),
oldState: StateNullableConverter().fromJson(json['oldState'] as String?),
newState: const StateNullableConverter().fromJson(json['newState'] as String?),
oldState: const StateNullableConverter().fromJson(json['oldState'] as String?),
created: (json['created'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(
IdConverter().fromJson(key),
const IdConverter().fromJson(key),
Email.fromJson(value as Map<String, dynamic>))),
updated: (json['updated'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(
IdConverter().fromJson(key),
const IdConverter().fromJson(key),
value != null ? Email.fromJson(value as Map<String, dynamic>) : null)),
destroyed: (json['destroyed'] as List<dynamic>?)
?.map((id) => IdConverter().fromJson(id)).toSet(),
?.map((id) => const IdConverter().fromJson(id)).toSet(),
notCreated: (json['notCreated'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(
IdConverter().fromJson(key),
const IdConverter().fromJson(key),
SetError.fromJson(value))),
notUpdated: (json['notUpdated'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(
IdConverter().fromJson(key),
const IdConverter().fromJson(key),
SetError.fromJson(value))),
notDestroyed: (json['notDestroyed'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(
IdConverter().fromJson(key),
const IdConverter().fromJson(key),
SetError.fromJson(value))),
);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/jmap/mail/email/submission/email_submission.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class EmailSubmission with EquatableMixin {
deliveryStatus: (json['deliveryStatus'] as Map<String, dynamic>?)
?.map((key, value) => DeliveryStatusConverter().parseEntry(key, value)),
dsnBlobIds: (json['dsnBlobIds'] as List<dynamic>?)
?.map((json) => IdConverter().fromJson(json)).toSet(),
?.map((json) => const IdConverter().fromJson(json)).toSet(),
mdnBlobIds: (json['mdnBlobIds'] as List<dynamic>?)
?.map((json) => IdConverter().fromJson(json)).toSet()
?.map((json) => const IdConverter().fromJson(json)).toSet()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ class SetEmailSubmissionResponse extends SetResponse<EmailSubmission> {
static SetEmailSubmissionResponse deserialize(Map<String, dynamic> json) {
return SetEmailSubmissionResponse(
const AccountIdConverter().fromJson(json['accountId'] as String),
newState: StateNullableConverter().fromJson(json['newState'] as String?),
oldState: StateNullableConverter().fromJson(json['oldState'] as String?),
newState: const StateNullableConverter().fromJson(json['newState'] as String?),
oldState: const StateNullableConverter().fromJson(json['oldState'] as String?),
created: (json['created'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(IdConverter().fromJson(key), EmailSubmission.fromJson(value as Map<String, dynamic>))),
?.map((key, value) => MapEntry(const IdConverter().fromJson(key), EmailSubmission.fromJson(value as Map<String, dynamic>))),
updated: (json['updated'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(
IdConverter().fromJson(key),
const IdConverter().fromJson(key),
value != null ? EmailSubmission.fromJson(value as Map<String, dynamic>) : null)),
destroyed: (json['destroyed'] as List<dynamic>?)
?.map((id) => IdConverter().fromJson(id)).toSet(),
?.map((id) => const IdConverter().fromJson(id)).toSet(),
notCreated: (json['notCreated'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(IdConverter().fromJson(key), SetError.fromJson(value))),
?.map((key, value) => MapEntry(const IdConverter().fromJson(key), SetError.fromJson(value))),
notUpdated: (json['notUpdated'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(IdConverter().fromJson(key), SetError.fromJson(value))),
?.map((key, value) => MapEntry(const IdConverter().fromJson(key), SetError.fromJson(value))),
notDestroyed: (json['notDestroyed'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(IdConverter().fromJson(key), SetError.fromJson(value))),
?.map((key, value) => MapEntry(const IdConverter().fromJson(key), SetError.fromJson(value))),
);
}

Expand Down
1 change: 0 additions & 1 deletion lib/jmap/mail/mailbox/query/query_mailbox_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,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/state_converter.dart';
import 'package:jmap_dart_client/http/converter/unsigned_int_converter.dart';
import 'package:jmap_dart_client/http/converter/unsigned_int_nullable_converter.dart';
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/response/query_response.dart';
Expand Down
Loading

0 comments on commit 86af20b

Please sign in to comment.