Improvements add bookmark
This commit is contained in:
@@ -20,23 +20,51 @@ class AddBookmarkModal extends ConsumerWidget {
|
|||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
return Dialog.fullscreen(
|
return Dialog.fullscreen(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
body: NestedScrollView(
|
||||||
leading: CloseButton(
|
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||||
onPressed: () => Navigator.pop(context),
|
SliverOverlapAbsorber(
|
||||||
),
|
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||||
title: Text(t.bookmarks.addBookmark.addBookmark),
|
sliver: SliverAppBar.large(
|
||||||
actions: [
|
pinned: true,
|
||||||
IconButton(
|
floating: true,
|
||||||
onPressed: ref.watch(addBookmarkProvider).checkBookmark != null
|
centerTitle: false,
|
||||||
? () => ref.read(addBookmarkProvider.notifier).addBookmark()
|
forceElevated: innerBoxIsScrolled,
|
||||||
: null,
|
leading: CloseButton(
|
||||||
icon: const Icon(Icons.save_rounded),
|
onPressed: () => Navigator.pop(context),
|
||||||
tooltip: t.generic.save,
|
),
|
||||||
|
title: Text(t.bookmarks.addBookmark.addBookmark),
|
||||||
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: ref.watch(addBookmarkProvider).checkBookmark != null
|
||||||
|
? () => ref.read(addBookmarkProvider.notifier).addBookmark()
|
||||||
|
: null,
|
||||||
|
icon: const Icon(Icons.save_rounded),
|
||||||
|
tooltip: t.generic.save,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
|
||||||
],
|
],
|
||||||
|
body: SafeArea(
|
||||||
|
top: false,
|
||||||
|
bottom: true,
|
||||||
|
child: Builder(
|
||||||
|
builder: (context) => CustomScrollView(
|
||||||
|
slivers: [
|
||||||
|
SliverOverlapInjector(
|
||||||
|
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||||
|
),
|
||||||
|
SliverList.list(
|
||||||
|
children: const [
|
||||||
|
_ModalContent(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
body: const _ModalContent(),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -51,7 +79,8 @@ class _ModalContent extends ConsumerWidget {
|
|||||||
|
|
||||||
final tags = ref.watch(getTagsProvider);
|
final tags = ref.watch(getTagsProvider);
|
||||||
|
|
||||||
return ListView(
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
SectionLabel(
|
SectionLabel(
|
||||||
@@ -308,6 +337,7 @@ class _ModalContent extends ConsumerWidget {
|
|||||||
? (v) => ref.read(addBookmarkProvider.notifier).updateMarkAsUnread(v)
|
? (v) => ref.read(addBookmarkProvider.notifier).updateMarkAsUnread(v)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user