TF-4383 Handle read only labels

This commit is contained in:
dab246
2026-03-25 18:36:10 +07:00
committed by Dat H. Pham
parent c17782bfd4
commit eb017b54b1
10 changed files with 97 additions and 7 deletions
+3
View File
@@ -24,6 +24,7 @@ class Label with EquatableMixin {
final String? displayName;
final HexColor? color;
final String? description;
final bool? readOnly;
Label({
this.id,
@@ -31,6 +32,7 @@ class Label with EquatableMixin {
this.displayName,
this.color,
this.description,
this.readOnly,
});
factory Label.fromJson(Map<String, dynamic> json) => _$LabelFromJson(json);
@@ -44,5 +46,6 @@ class Label with EquatableMixin {
displayName,
color,
description,
readOnly,
];
}
+23
View File
@@ -0,0 +1,23 @@
import 'package:jmap_dart_client/jmap/core/capability/capability_properties.dart';
import 'package:json_annotation/json_annotation.dart';
part 'labels_capability.g.dart';
@JsonSerializable(explicitToJson: true, includeIfNull: false)
class LabelsCapability extends CapabilityProperties {
final int? version;
LabelsCapability({this.version});
factory LabelsCapability.fromJson(Map<String, dynamic> json) =>
_$LabelsCapabilityFromJson(json);
Map<String, dynamic> toJson() => _$LabelsCapabilityToJson(this);
static LabelsCapability deserialize(Map<String, dynamic> json) {
return LabelsCapability.fromJson(json);
}
@override
List<Object?> get props => [version];
}