diff --git a/labels/lib/extensions/label_extension.dart b/labels/lib/extensions/label_extension.dart index bb7429501..ba4c99c6d 100644 --- a/labels/lib/extensions/label_extension.dart +++ b/labels/lib/extensions/label_extension.dart @@ -11,6 +11,8 @@ extension LabelExtension on Label { String get safeDisplayName => displayName ?? ''; + String get safeDescription => description ?? ''; + Color? get backgroundColor { if (id?.value == moreLabelId) { return AppColor.grayBackgroundColor; @@ -32,12 +34,14 @@ extension LabelExtension on Label { KeyWordIdentifier? keyword, String? displayName, HexColor? color, + String? description, }) { return Label( id: id ?? this.id, displayName: displayName ?? this.displayName, keyword: keyword ?? this.keyword, color: color ?? this.color, + description: description ?? this.description, ); } diff --git a/lib/features/labels/data/network/label_api.dart b/lib/features/labels/data/network/label_api.dart index 9ee2767a8..ae8f0f8ea 100644 --- a/lib/features/labels/data/network/label_api.dart +++ b/lib/features/labels/data/network/label_api.dart @@ -63,6 +63,7 @@ class LabelApi final newLabelCreated = labelCreated!.copyWith( displayName: labelData.displayName, color: labelData.color, + description: labelData.description, ); return newLabelCreated; } else { diff --git a/lib/features/labels/presentation/widgets/create_new_label_modal.dart b/lib/features/labels/presentation/widgets/create_new_label_modal.dart index 75a3e1417..f2c52fed2 100644 --- a/lib/features/labels/presentation/widgets/create_new_label_modal.dart +++ b/lib/features/labels/presentation/widgets/create_new_label_modal.dart @@ -78,6 +78,7 @@ class _CreateNewLabelModalState extends State { if (selectedLabel != null) { _nameInputController.text = selectedLabel.safeDisplayName; _nameInputFocusNode.requestFocus(); + _descriptionInputController.text = selectedLabel.safeDescription; _createLabelStateNotifier.value = true; _labelSelectedColorNotifier.value = _selectedColor; } @@ -370,6 +371,7 @@ class _CreateNewLabelModalState extends State { color: _selectedColor != null ? HexColor(_selectedColor!.toHexTriplet()) : null, + description: _descriptionInputController.text, ); widget.onLabelActionCallback(newLabel);