We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a0929a commit b4e9efcCopy full SHA for b4e9efc
lib/app/modules/detailRoute/views/tags_widget.dart
@@ -234,10 +234,17 @@ class TagsRouteState extends State<TagsRoute> {
234
color: tColors.primaryTextColor,
235
),
236
validator: (value) {
237
- if (value != null) {
238
- if (value.isNotEmpty && value.contains(" ")) {
239
- return "Tags cannot contain spaces";
240
- }
+ if (value == null || value.trim().isEmpty) {
+ return "Please enter a tag";
+ }
+ final tag = value.trim();
241
+ if (tag.contains(" ")) {
242
+ return "Tags cannot contain spaces";
243
244
+ final currentTags =
245
+ draftTags?.build().toList() ?? <String>[];
246
+ if (currentTags.contains(tag)) {
247
+ return "Tag already exists";
248
}
249
return null;
250
},
0 commit comments