Added default tags
This commit is contained in:
@@ -175,7 +175,7 @@ final getTagsProvider =
|
||||
);
|
||||
|
||||
typedef GetTagsRef = AutoDisposeFutureProviderRef<ApiResponse<TagsResponse>>;
|
||||
String _$bookmarkFormHash() => r'a89ab1d3b17c37f072e016d033a0adc26ed39748';
|
||||
String _$bookmarkFormHash() => r'9d99362f0234456b26e4ef16179455862b300fe4';
|
||||
|
||||
/// See also [BookmarkForm].
|
||||
@ProviderFor(BookmarkForm)
|
||||
|
||||
@@ -221,7 +221,7 @@ final bookmarksRequestLoadMoreProvider =
|
||||
);
|
||||
|
||||
typedef BookmarksRequestLoadMoreRef = AutoDisposeFutureProviderRef<void>;
|
||||
String _$bookmarksHash() => r'ed3a350dc6f4818adf146c1dab84005fec8c9be4';
|
||||
String _$bookmarksHash() => r'21cfb29298db2edcea8ce2b162e2f312972e9f3b';
|
||||
|
||||
/// See also [Bookmarks].
|
||||
@ProviderFor(Bookmarks)
|
||||
|
||||
@@ -174,7 +174,7 @@ final fetchSearchBookmarksLoadMoreProvider =
|
||||
);
|
||||
|
||||
typedef FetchSearchBookmarksLoadMoreRef = AutoDisposeFutureProviderRef<void>;
|
||||
String _$searchBookmarksHash() => r'a70324693484f2c7731fcebf4df007443f1c30e9';
|
||||
String _$searchBookmarksHash() => r'545924de28fd2ce74b8c243db8dda33c5fd079a2';
|
||||
|
||||
/// See also [SearchBookmarks].
|
||||
@ProviderFor(SearchBookmarks)
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:linkdy/screens/bookmarks/provider/bookmark_form.provider.dart';
|
||||
import 'package:linkdy/widgets/section_label.dart';
|
||||
|
||||
import 'package:linkdy/models/data/bookmarks.dart';
|
||||
import 'package:linkdy/providers/app_status.provider.dart';
|
||||
import 'package:linkdy/config/sizes.dart';
|
||||
import 'package:linkdy/i18n/strings.g.dart';
|
||||
import 'package:linkdy/constants/global_keys.dart';
|
||||
@@ -28,6 +29,9 @@ class BookmarkFormModal extends ConsumerStatefulWidget {
|
||||
class BookmarkFormModalState extends ConsumerState<BookmarkFormModal> {
|
||||
@override
|
||||
void initState() {
|
||||
if (widget.bookmark == null) {
|
||||
ref.read(bookmarkFormProvider).tags = ref.read(appStatusProvider).defaultTags;
|
||||
}
|
||||
if (widget.bookmark != null) {
|
||||
ref.read(bookmarkFormProvider.notifier).initializeProvider(widget.bookmark!);
|
||||
}
|
||||
@@ -362,6 +366,7 @@ class _ModalContent extends ConsumerWidget {
|
||||
separatorBuilder: (context, index) => const SizedBox(width: 8),
|
||||
itemBuilder: (context, index) => InputChip(
|
||||
label: Text(provider.tags[index]),
|
||||
isEnabled: enabledFields,
|
||||
onDeleted: () => ref
|
||||
.read(bookmarkFormProvider.notifier)
|
||||
.setTags(provider.tags.where((tag) => tag != provider.tags[index]).toList()),
|
||||
|
||||
Reference in New Issue
Block a user