mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-13 14:12:15 -06:00
feat: Add functionality to delete notes
This commit is contained in:
@@ -240,130 +240,131 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
|
||||
context.read(),
|
||||
documentId: widget.id,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 16,
|
||||
horizontal: 16,
|
||||
),
|
||||
child: TabBarView(
|
||||
children: [
|
||||
CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView
|
||||
.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
switch (state.status) {
|
||||
LoadingStatus.loaded =>
|
||||
DocumentOverviewWidget(
|
||||
document: state.document!,
|
||||
itemSpacing: _itemSpacing,
|
||||
queryString:
|
||||
widget.titleAndContentQueryString,
|
||||
),
|
||||
LoadingStatus.error => _buildErrorState(),
|
||||
_ => _buildLoadingState(),
|
||||
},
|
||||
],
|
||||
),
|
||||
CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView
|
||||
.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
switch (state.status) {
|
||||
LoadingStatus.loaded => DocumentContentWidget(
|
||||
document: state.document!,
|
||||
queryString:
|
||||
widget.titleAndContentQueryString,
|
||||
),
|
||||
LoadingStatus.error => _buildErrorState(),
|
||||
_ => _buildLoadingState(),
|
||||
}
|
||||
],
|
||||
),
|
||||
CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView
|
||||
.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
switch (state.status) {
|
||||
LoadingStatus.loaded =>
|
||||
DocumentMetaDataWidget(
|
||||
document: state.document!,
|
||||
itemSpacing: _itemSpacing,
|
||||
metaData: state.metaData!,
|
||||
),
|
||||
LoadingStatus.error => _buildErrorState(),
|
||||
_ => _buildLoadingState(),
|
||||
},
|
||||
],
|
||||
),
|
||||
child: TabBarView(
|
||||
children: [
|
||||
CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView
|
||||
.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
switch (state.status) {
|
||||
LoadingStatus.loaded => DocumentOverviewWidget(
|
||||
document: state.document!,
|
||||
itemSpacing: _itemSpacing,
|
||||
queryString:
|
||||
widget.titleAndContentQueryString,
|
||||
).paddedSymmetrically(
|
||||
vertical: 16,
|
||||
sliver: true,
|
||||
),
|
||||
LoadingStatus.error => _buildErrorState(),
|
||||
_ => _buildLoadingState(),
|
||||
},
|
||||
],
|
||||
),
|
||||
CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView
|
||||
.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
switch (state.status) {
|
||||
LoadingStatus.loaded => DocumentContentWidget(
|
||||
document: state.document!,
|
||||
queryString:
|
||||
widget.titleAndContentQueryString,
|
||||
).paddedSymmetrically(
|
||||
vertical: 16,
|
||||
sliver: true,
|
||||
),
|
||||
LoadingStatus.error => _buildErrorState(),
|
||||
_ => _buildLoadingState(),
|
||||
}
|
||||
],
|
||||
),
|
||||
CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView
|
||||
.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
switch (state.status) {
|
||||
LoadingStatus.loaded => DocumentMetaDataWidget(
|
||||
document: state.document!,
|
||||
itemSpacing: _itemSpacing,
|
||||
metaData: state.metaData!,
|
||||
).paddedSymmetrically(
|
||||
vertical: 16,
|
||||
sliver: true,
|
||||
),
|
||||
LoadingStatus.error => _buildErrorState(),
|
||||
_ => _buildLoadingState(),
|
||||
},
|
||||
],
|
||||
),
|
||||
CustomScrollView(
|
||||
controller: _pagingScrollController,
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView
|
||||
.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
SimilarDocumentsView(
|
||||
pagingScrollController: _pagingScrollController,
|
||||
).paddedSymmetrically(
|
||||
vertical: 16,
|
||||
sliver: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView
|
||||
.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
switch (state.status) {
|
||||
LoadingStatus.loaded => DocumentNotesWidget(
|
||||
document: state.document!,
|
||||
).paddedSymmetrically(
|
||||
vertical: 16,
|
||||
sliver: true,
|
||||
),
|
||||
LoadingStatus.error => _buildErrorState(),
|
||||
_ => _buildLoadingState(),
|
||||
},
|
||||
],
|
||||
),
|
||||
if (hasMultiUserSupport)
|
||||
CustomScrollView(
|
||||
controller: _pagingScrollController,
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView
|
||||
.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
SimilarDocumentsView(
|
||||
pagingScrollController:
|
||||
_pagingScrollController,
|
||||
),
|
||||
],
|
||||
),
|
||||
CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView
|
||||
.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
switch (state.status) {
|
||||
LoadingStatus.loaded => DocumentNotesWidget(
|
||||
LoadingStatus.loaded =>
|
||||
DocumentPermissionsWidget(
|
||||
document: state.document!,
|
||||
).paddedSymmetrically(
|
||||
vertical: 16,
|
||||
sliver: true,
|
||||
),
|
||||
LoadingStatus.error => _buildErrorState(),
|
||||
_ => _buildLoadingState(),
|
||||
},
|
||||
if (state.status == LoadingStatus.loaded)
|
||||
SliverToBoxAdapter(
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
AddNoteRoute($extra: state.document!)
|
||||
.push(context);
|
||||
},
|
||||
icon: Icon(Icons.note_add_outlined),
|
||||
label: Text('Add note'),
|
||||
),
|
||||
),
|
||||
),
|
||||
}
|
||||
],
|
||||
),
|
||||
if (hasMultiUserSupport)
|
||||
CustomScrollView(
|
||||
controller: _pagingScrollController,
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView
|
||||
.sliverOverlapAbsorberHandleFor(
|
||||
context),
|
||||
),
|
||||
switch (state.status) {
|
||||
LoadingStatus.loaded =>
|
||||
DocumentPermissionsWidget(
|
||||
document: state.document!,
|
||||
),
|
||||
LoadingStatus.error => _buildErrorState(),
|
||||
_ => _buildLoadingState(),
|
||||
}
|
||||
],
|
||||
]
|
||||
.map(
|
||||
(child) => Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
child: child,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user