TF-4195 Add interactor/repository/datasource to feature add a Label to an email
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import 'package:jmap_dart_client/jmap/mail/email/keyword_identifier.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
class KeywordIdentifierNullableConverter
|
||||
implements JsonConverter<KeyWordIdentifier?, String?> {
|
||||
const KeywordIdentifierNullableConverter();
|
||||
|
||||
@override
|
||||
KeyWordIdentifier? fromJson(String? json) =>
|
||||
json != null ? KeyWordIdentifier(json) : null;
|
||||
|
||||
@override
|
||||
String? toJson(KeyWordIdentifier? object) => object?.value;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/extensions/hex_color_extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/id.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/keyword_identifier.dart';
|
||||
import 'package:labels/model/hex_color.dart';
|
||||
import 'package:labels/model/label.dart';
|
||||
|
||||
@@ -28,7 +29,7 @@ extension LabelExtension on Label {
|
||||
|
||||
Label copyWith({
|
||||
Id? id,
|
||||
String? keyword,
|
||||
KeyWordIdentifier? keyword,
|
||||
String? displayName,
|
||||
HexColor? color,
|
||||
}) {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:jmap_dart_client/http/converter/id_converter.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/id.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/keyword_identifier.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:labels/converter/hex_color_nullable_converter.dart';
|
||||
import 'package:labels/converter/keyword_identifier_nullable_converter.dart';
|
||||
import 'package:labels/model/hex_color.dart';
|
||||
|
||||
part 'label.g.dart';
|
||||
@@ -13,11 +15,12 @@ part 'label.g.dart';
|
||||
converters: [
|
||||
IdConverter(),
|
||||
HexColorNullableConverter(),
|
||||
KeywordIdentifierNullableConverter(),
|
||||
],
|
||||
)
|
||||
class Label with EquatableMixin {
|
||||
final Id? id;
|
||||
final String? keyword;
|
||||
final KeyWordIdentifier? keyword;
|
||||
final String? displayName;
|
||||
final HexColor? color;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user