diff --git a/contact/pubspec.yaml b/contact/pubspec.yaml index 97466ee95c..62d0f3c70f 100644 --- a/contact/pubspec.yaml +++ b/contact/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: jmap_dart_client: git: url: https://github.com/linagora/jmap-dart-client.git - ref: master + ref: cnb_support ### Dependencies from pub.dev ### equatable: 2.0.5 diff --git a/email_recovery/pubspec.yaml b/email_recovery/pubspec.yaml index 1cb39b9c3c..08d4375edf 100644 --- a/email_recovery/pubspec.yaml +++ b/email_recovery/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: jmap_dart_client: git: url: https://github.com/linagora/jmap-dart-client.git - ref: master + ref: cnb_support ### Dependencies from pub.dev ### equatable: 2.0.5 diff --git a/fcm/pubspec.yaml b/fcm/pubspec.yaml index fc1464a52a..0a6244b89b 100644 --- a/fcm/pubspec.yaml +++ b/fcm/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: jmap_dart_client: git: url: https://github.com/linagora/jmap-dart-client.git - ref: master + ref: cnb_support ### Dependencies from pub.dev ### equatable: 2.0.5 diff --git a/forward/pubspec.yaml b/forward/pubspec.yaml index 94181ea0ca..decaa8b942 100644 --- a/forward/pubspec.yaml +++ b/forward/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: jmap_dart_client: git: url: https://github.com/linagora/jmap-dart-client.git - ref: master + ref: cnb_support ### Dependencies from pub.dev ### equatable: 2.0.5 diff --git a/lib/features/mailbox_dashboard/presentation/model/search/search_email_filter.dart b/lib/features/mailbox_dashboard/presentation/model/search/search_email_filter.dart index 3103fc904f..2daa71341e 100644 --- a/lib/features/mailbox_dashboard/presentation/model/search/search_email_filter.dart +++ b/lib/features/mailbox_dashboard/presentation/model/search/search_email_filter.dart @@ -1,3 +1,4 @@ +import 'package:core/core.dart'; import 'package:dartz/dartz.dart'; import 'package:equatable/equatable.dart'; import 'package:jmap_dart_client/jmap/core/filter/filter.dart'; @@ -13,7 +14,7 @@ import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/model/sear import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/model/search/email_sort_order_type.dart'; import 'package:tmail_ui_user/features/thread/domain/model/search_query.dart'; -class SearchEmailFilter with EquatableMixin { +class SearchEmailFilter with EquatableMixin, OptionParamMixin { final Set from; final Set to; final SearchQuery? text; @@ -69,30 +70,22 @@ class SearchEmailFilter with EquatableMixin { Option? positionOption, }) { return SearchEmailFilter( - from: _getOptionParam(fromOption, from), - to: _getOptionParam(toOption, to), + from: getOptionParam(fromOption, from), + to: getOptionParam(toOption, to), text: text ?? this.text, - subject: _getOptionParam(subjectOption, subject), + subject: getOptionParam(subjectOption, subject), notKeyword: notKeyword ?? this.notKeyword, mailbox: mailbox ?? this.mailbox, emailReceiveTimeType: emailReceiveTimeType ?? this.emailReceiveTimeType, hasAttachment: hasAttachment ?? this.hasAttachment, - before: _getOptionParam(beforeOption, before), - startDate: _getOptionParam(startDateOption, startDate), - endDate: _getOptionParam(endDateOption, endDate), - sortOrder: _getOptionParam(sortOrderOption, sortOrder), - position: _getOptionParam(positionOption, position), + before: getOptionParam(beforeOption, before), + startDate: getOptionParam(startDateOption, startDate), + endDate: getOptionParam(endDateOption, endDate), + sortOrder: getOptionParam(sortOrderOption, sortOrder), + position: getOptionParam(positionOption, position), ); } - T? _getOptionParam(Option? option, T? defaultValue) { - if (option != null) { - return option.toNullable(); - } else { - return defaultValue; - } - } - Filter? mappingToEmailFilterCondition({ required EmailSortOrderType sortOrderType, EmailFilterCondition? moreFilterCondition diff --git a/model/pubspec.yaml b/model/pubspec.yaml index a37203b6ca..6255b55049 100644 --- a/model/pubspec.yaml +++ b/model/pubspec.yaml @@ -33,7 +33,7 @@ dependencies: jmap_dart_client: git: url: https://github.com/linagora/jmap-dart-client.git - ref: master + ref: cnb_support ### Dependencies from pub.dev ### cupertino_icons: 1.0.6 diff --git a/pubspec.yaml b/pubspec.yaml index 411bc0d21b..8e0f14ef2c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -62,7 +62,7 @@ dependencies: jmap_dart_client: git: url: https://github.com/linagora/jmap-dart-client.git - ref: master + ref: cnb_support contacts_service: git: diff --git a/rule_filter/pubspec.yaml b/rule_filter/pubspec.yaml index 3406395aad..8954d4a2b8 100644 --- a/rule_filter/pubspec.yaml +++ b/rule_filter/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: jmap_dart_client: git: url: https://github.com/linagora/jmap-dart-client.git - ref: master + ref: cnb_support ### Dependencies from pub.dev ### equatable: 2.0.5