TF-4383 Handle read only labels
This commit is contained in:
@@ -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,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
Reference in New Issue
Block a user