Skip to content

Commit 392f12f

Browse files
tddang-linagorahoangdat
authored andcommitted
Upgrade Flutter v3.24.5
1 parent b085658 commit 392f12f

24 files changed

+116
-102
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name: CI
44

55
env:
6-
FLUTTER_VERSION: 3.22.2
6+
FLUTTER_VERSION: 3.24.5
77

88
# Controls when the workflow will run
99
on: [push, pull_request, workflow_dispatch]

lib/http/converter/email/email_body_value_converter.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ class EmailBodyValueConverter {
1212
}
1313

1414
MapEntry<String, dynamic> toJson(PartId partId, EmailBodyValue value) {
15-
return MapEntry(PartIdConverter().toJson(partId), value.toJson());
15+
return MapEntry(const PartIdConverter().toJson(partId), value.toJson());
1616
}
1717
}

lib/http/converter/email/email_mailbox_ids_converter.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ class EmailMailboxIdsConverter {
66
MapEntry<MailboxId, bool> parseEntry(String key, bool value) => MapEntry(MailboxId(Id(key)), value);
77

88
MapEntry<String, bool> toJson(MailboxId mailboxId, bool value) {
9-
return MapEntry(IdConverter().toJson(mailboxId.id), value);
9+
return MapEntry(const IdConverter().toJson(mailboxId.id), value);
1010
}
1111
}

lib/http/converter/method_response_converter.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class MethodResponseConverter implements JsonConverter<MethodResponse, dynamic>
77

88
@override
99
MethodResponse fromJson(dynamic json) {
10-
return this.fromJson(json);
10+
return fromJson(json);
1111
}
1212

1313
@override

lib/jmap/core/method/request/get_method.dart

+1-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ mixin OptionalIds {
2020
Set<Id>? ids;
2121

2222
void addIds(Set<Id> values) {
23-
if (ids == null) {
24-
ids = Set();
25-
}
23+
ids ??= <Id>{};
2624
ids?.addAll(values);
2725
}
2826
}

lib/jmap/core/method/request/query_method.dart

+1-3
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ mixin OptionalSort {
5454
Set<Comparator>? sort;
5555

5656
void addSorts(Set<Comparator> value) {
57-
if (sort == null) {
58-
sort = Set();
59-
}
57+
sort ??= <Comparator>{};
6058
sort?.addAll(value);
6159
}
6260
}

lib/jmap/core/method/request/set_method.dart

+6-16
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ mixin OptionalIfInState {
2222
State? ifInState;
2323

2424
void addIfInState(State? state) {
25-
this.ifInState = state;
25+
ifInState = state;
2626
}
2727
}
2828

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

3333
void addCreates(Map<Id, T> creates) {
34-
if (create == null) {
35-
create = Map<Id, T>();
36-
}
34+
create ??= <Id, T>{};
3735
create?.addAll(creates);
3836
}
3937

4038
void addCreate(Id id, T createItem) {
41-
if (create == null) {
42-
create = Map<Id, T>();
43-
}
39+
create ??= <Id, T>{};
4440
create?.addAll({id: createItem});
4541
}
4642
}
@@ -50,9 +46,7 @@ mixin OptionalUpdate {
5046
Map<Id, PatchObject>? update;
5147

5248
void addUpdates(Map<Id, PatchObject> updates) {
53-
if (update == null) {
54-
update = Map<Id, PatchObject>();
55-
}
49+
update ??= <Id, PatchObject>{};
5650
update?.addAll(updates);
5751
}
5852
}
@@ -62,9 +56,7 @@ mixin OptionalDestroy {
6256
Set<Id>? destroy;
6357

6458
void addDestroy(Set<Id> values) {
65-
if (destroy == null) {
66-
destroy = Set();
67-
}
59+
destroy ??= <Id>{};
6860
destroy?.addAll(values);
6961
}
7062
}
@@ -74,9 +66,7 @@ mixin OptionalUpdateSingleton<T> {
7466
Map<Id, T>? updateSingleton;
7567

7668
void addUpdatesSingleton(Map<Id, T> updates) {
77-
if (updateSingleton == null) {
78-
updateSingleton = Map<Id, T>();
79-
}
69+
updateSingleton ??= <Id, T>{};
8070
updateSingleton?.addAll(updates);
8171
}
8272
}

lib/jmap/core/patch_object.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import 'package:equatable/equatable.dart';
22

33
class PatchObject with EquatableMixin {
44

5-
static final mailboxIdsProperty = 'mailboxIds';
6-
static final keywordsProperty = 'keywords';
5+
static const mailboxIdsProperty = 'mailboxIds';
6+
static const keywordsProperty = 'keywords';
77
static const identityIdsProperty = 'identityIds';
88

99
PatchObject(this.patches);

lib/jmap/core/properties/properties.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Properties with EquatableMixin {
55

66
Properties(this.value);
77

8-
static Properties empty() => Properties(Set());
8+
static Properties empty() => Properties(<String>{});
99

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

lib/jmap/core/response/response_object.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ResponseObject with EquatableMixin {
2727

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

30-
T? parse<T extends MethodResponse>(MethodCallId methodCallId, T fromJson(Map<String, dynamic> o), {MethodName? methodName}) {
30+
T? parse<T extends MethodResponse>(MethodCallId methodCallId, T Function(Map<String, dynamic> o) fromJson, {MethodName? methodName}) {
3131
final matchedResponse = methodResponses.firstWhere((method) => methodName == null
3232
? method.methodCallId == methodCallId
3333
: (method.methodCallId == methodCallId && _validMethodResponseName(method, methodName)));

lib/jmap/core/session/session.dart

+2-4
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,12 @@ class Session with EquatableMixin {
3636
);
3737

3838
factory Session.fromJson(Map<String, dynamic> json, {CapabilitiesConverter? converter}) {
39-
if (converter == null) {
40-
converter = CapabilitiesConverter.defaultConverter;
41-
}
39+
converter ??= CapabilitiesConverter.defaultConverter;
4240
return Session(
4341
(json['capabilities'] as Map<String, dynamic>)
4442
.map((key, value) => converter!.convert(key, value)),
4543
(json['accounts'] as Map<String, dynamic>)
46-
.map((key, value) => AccountConverter().convert(key, value, converter!)),
44+
.map((key, value) => const AccountConverter().convert(key, value, converter!)),
4745
(json['primaryAccounts'] as Map<String, dynamic>)
4846
.map((key, value) => MapEntry(
4947
CapabilityIdentifier(Uri.parse(key)),

lib/jmap/identities/set/set_identity_response.dart

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,29 @@ class SetIdentityResponse extends SetResponse<Identity> {
3434
static SetIdentityResponse deserialize(Map<String, dynamic> json) {
3535
return SetIdentityResponse(
3636
const AccountIdConverter().fromJson(json['accountId'] as String),
37-
newState: StateNullableConverter().fromJson(json['newState'] as String?),
38-
oldState: StateNullableConverter().fromJson(json['oldState'] as String?),
37+
newState: const StateNullableConverter().fromJson(json['newState'] as String?),
38+
oldState: const StateNullableConverter().fromJson(json['oldState'] as String?),
3939
created: (json['created'] as Map<String, dynamic>?)
4040
?.map((key, value) => MapEntry(
41-
IdConverter().fromJson(key),
41+
const IdConverter().fromJson(key),
4242
Identity.fromJson(value as Map<String, dynamic>))),
4343
updated: (json['updated'] as Map<String, dynamic>?)
4444
?.map((key, value) => MapEntry(
45-
IdConverter().fromJson(key),
45+
const IdConverter().fromJson(key),
4646
value != null ? Identity.fromJson(value as Map<String, dynamic>) : null)),
4747
destroyed: (json['destroyed'] as List<dynamic>?)
48-
?.map((id) => IdConverter().fromJson(id)).toSet(),
48+
?.map((id) => const IdConverter().fromJson(id)).toSet(),
4949
notCreated: (json['notCreated'] as Map<String, dynamic>?)
5050
?.map((key, value) => MapEntry(
51-
IdConverter().fromJson(key),
51+
const IdConverter().fromJson(key),
5252
SetError.fromJson(value))),
5353
notUpdated: (json['notUpdated'] as Map<String, dynamic>?)
5454
?.map((key, value) => MapEntry(
55-
IdConverter().fromJson(key),
55+
const IdConverter().fromJson(key),
5656
SetError.fromJson(value))),
5757
notDestroyed: (json['notDestroyed'] as Map<String, dynamic>?)
5858
?.map((key, value) => MapEntry(
59-
IdConverter().fromJson(key),
59+
const IdConverter().fromJson(key),
6060
SetError.fromJson(value))),
6161
);
6262
}

lib/jmap/mail/email/get/get_email_method.dart

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class GetEmailMethod extends GetMethod with OptionalEmailBodyProperties, Optiona
3737

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

40+
@override
4041
Map<String, dynamic> toJson() => _$GetEmailMethodToJson(this);
4142
}
4243

lib/jmap/mail/email/query/query_email_response.dart

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'package:jmap_dart_client/http/converter/account_id_converter.dart';
22
import 'package:jmap_dart_client/http/converter/id_converter.dart';
33
import 'package:jmap_dart_client/http/converter/state_converter.dart';
44
import 'package:jmap_dart_client/http/converter/unsigned_int_converter.dart';
5-
import 'package:jmap_dart_client/http/converter/unsigned_int_nullable_converter.dart';
65
import 'package:jmap_dart_client/jmap/account_id.dart';
76
import 'package:jmap_dart_client/jmap/core/id.dart';
87
import 'package:jmap_dart_client/jmap/core/method/response/query_response.dart';

lib/jmap/mail/email/query/query_email_response.g.dart

+30-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/jmap/mail/email/set/set_email_response.dart

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,29 @@ class SetEmailResponse extends SetResponse<Email> {
3434
static SetEmailResponse deserialize(Map<String, dynamic> json) {
3535
return SetEmailResponse(
3636
const AccountIdConverter().fromJson(json['accountId'] as String),
37-
newState: StateNullableConverter().fromJson(json['newState'] as String?),
38-
oldState: StateNullableConverter().fromJson(json['oldState'] as String?),
37+
newState: const StateNullableConverter().fromJson(json['newState'] as String?),
38+
oldState: const StateNullableConverter().fromJson(json['oldState'] as String?),
3939
created: (json['created'] as Map<String, dynamic>?)
4040
?.map((key, value) => MapEntry(
41-
IdConverter().fromJson(key),
41+
const IdConverter().fromJson(key),
4242
Email.fromJson(value as Map<String, dynamic>))),
4343
updated: (json['updated'] as Map<String, dynamic>?)
4444
?.map((key, value) => MapEntry(
45-
IdConverter().fromJson(key),
45+
const IdConverter().fromJson(key),
4646
value != null ? Email.fromJson(value as Map<String, dynamic>) : null)),
4747
destroyed: (json['destroyed'] as List<dynamic>?)
48-
?.map((id) => IdConverter().fromJson(id)).toSet(),
48+
?.map((id) => const IdConverter().fromJson(id)).toSet(),
4949
notCreated: (json['notCreated'] as Map<String, dynamic>?)
5050
?.map((key, value) => MapEntry(
51-
IdConverter().fromJson(key),
51+
const IdConverter().fromJson(key),
5252
SetError.fromJson(value))),
5353
notUpdated: (json['notUpdated'] as Map<String, dynamic>?)
5454
?.map((key, value) => MapEntry(
55-
IdConverter().fromJson(key),
55+
const IdConverter().fromJson(key),
5656
SetError.fromJson(value))),
5757
notDestroyed: (json['notDestroyed'] as Map<String, dynamic>?)
5858
?.map((key, value) => MapEntry(
59-
IdConverter().fromJson(key),
59+
const IdConverter().fromJson(key),
6060
SetError.fromJson(value))),
6161
);
6262
}

lib/jmap/mail/email/submission/email_submission.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ class EmailSubmission with EquatableMixin {
5353
deliveryStatus: (json['deliveryStatus'] as Map<String, dynamic>?)
5454
?.map((key, value) => DeliveryStatusConverter().parseEntry(key, value)),
5555
dsnBlobIds: (json['dsnBlobIds'] as List<dynamic>?)
56-
?.map((json) => IdConverter().fromJson(json)).toSet(),
56+
?.map((json) => const IdConverter().fromJson(json)).toSet(),
5757
mdnBlobIds: (json['mdnBlobIds'] as List<dynamic>?)
58-
?.map((json) => IdConverter().fromJson(json)).toSet()
58+
?.map((json) => const IdConverter().fromJson(json)).toSet()
5959
);
6060
}
6161

lib/jmap/mail/email/submission/set/set_email_submission_response.dart

+8-8
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,22 @@ class SetEmailSubmissionResponse extends SetResponse<EmailSubmission> {
3636
static SetEmailSubmissionResponse deserialize(Map<String, dynamic> json) {
3737
return SetEmailSubmissionResponse(
3838
const AccountIdConverter().fromJson(json['accountId'] as String),
39-
newState: StateNullableConverter().fromJson(json['newState'] as String?),
40-
oldState: StateNullableConverter().fromJson(json['oldState'] as String?),
39+
newState: const StateNullableConverter().fromJson(json['newState'] as String?),
40+
oldState: const StateNullableConverter().fromJson(json['oldState'] as String?),
4141
created: (json['created'] as Map<String, dynamic>?)
42-
?.map((key, value) => MapEntry(IdConverter().fromJson(key), EmailSubmission.fromJson(value as Map<String, dynamic>))),
42+
?.map((key, value) => MapEntry(const IdConverter().fromJson(key), EmailSubmission.fromJson(value as Map<String, dynamic>))),
4343
updated: (json['updated'] as Map<String, dynamic>?)
4444
?.map((key, value) => MapEntry(
45-
IdConverter().fromJson(key),
45+
const IdConverter().fromJson(key),
4646
value != null ? EmailSubmission.fromJson(value as Map<String, dynamic>) : null)),
4747
destroyed: (json['destroyed'] as List<dynamic>?)
48-
?.map((id) => IdConverter().fromJson(id)).toSet(),
48+
?.map((id) => const IdConverter().fromJson(id)).toSet(),
4949
notCreated: (json['notCreated'] as Map<String, dynamic>?)
50-
?.map((key, value) => MapEntry(IdConverter().fromJson(key), SetError.fromJson(value))),
50+
?.map((key, value) => MapEntry(const IdConverter().fromJson(key), SetError.fromJson(value))),
5151
notUpdated: (json['notUpdated'] as Map<String, dynamic>?)
52-
?.map((key, value) => MapEntry(IdConverter().fromJson(key), SetError.fromJson(value))),
52+
?.map((key, value) => MapEntry(const IdConverter().fromJson(key), SetError.fromJson(value))),
5353
notDestroyed: (json['notDestroyed'] as Map<String, dynamic>?)
54-
?.map((key, value) => MapEntry(IdConverter().fromJson(key), SetError.fromJson(value))),
54+
?.map((key, value) => MapEntry(const IdConverter().fromJson(key), SetError.fromJson(value))),
5555
);
5656
}
5757

lib/jmap/mail/mailbox/query/query_mailbox_response.dart

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'package:jmap_dart_client/http/converter/account_id_converter.dart';
22
import 'package:jmap_dart_client/http/converter/id_converter.dart';
33
import 'package:jmap_dart_client/http/converter/state_converter.dart';
44
import 'package:jmap_dart_client/http/converter/unsigned_int_converter.dart';
5-
import 'package:jmap_dart_client/http/converter/unsigned_int_nullable_converter.dart';
65
import 'package:jmap_dart_client/jmap/account_id.dart';
76
import 'package:jmap_dart_client/jmap/core/id.dart';
87
import 'package:jmap_dart_client/jmap/core/method/response/query_response.dart';

0 commit comments

Comments
 (0)