mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 10:08:00 -06:00
Bugfixes, some visual updates
This commit is contained in:
@@ -24,7 +24,7 @@ Future<T> getSingleResult<T>(
|
||||
jsonDecode(utf8.decode(response.bodyBytes)) as JSON,
|
||||
);
|
||||
}
|
||||
return Future.error(errorCode);
|
||||
throw ErrorMessage(errorCode);
|
||||
}
|
||||
|
||||
Future<List<T>> getCollection<T>(
|
||||
@@ -52,7 +52,7 @@ Future<List<T>> getCollection<T>(
|
||||
}
|
||||
}
|
||||
}
|
||||
return Future.error(errorCode);
|
||||
throw ErrorMessage(errorCode);
|
||||
}
|
||||
|
||||
List<T> _collectionFromJson<T>(
|
||||
|
||||
@@ -130,8 +130,7 @@ class _DocumentsPageState extends State<DocumentsPage> {
|
||||
controller: _panelController,
|
||||
defaultPanelState: PanelState.CLOSED,
|
||||
minHeight: 48,
|
||||
maxHeight: MediaQuery.of(context).size.height -
|
||||
kBottomNavigationBarHeight,
|
||||
maxHeight: (MediaQuery.of(context).size.height * 3) / 4,
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(16),
|
||||
topRight: Radius.circular(16),
|
||||
@@ -193,7 +192,7 @@ class _DocumentsPageState extends State<DocumentsPage> {
|
||||
onRefresh: _onRefresh,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(
|
||||
bottom: 142,
|
||||
bottom: 48 + kBottomNavigationBarHeight + 48,
|
||||
), // Prevents panel from hiding scrollable content
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
@@ -211,7 +210,12 @@ class _DocumentsPageState extends State<DocumentsPage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
child
|
||||
child,
|
||||
// SliverToBoxAdapter(
|
||||
// child: SizedBox(
|
||||
// height: MediaQuery.of(context).size.height / 3,
|
||||
// ),
|
||||
// )
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:paperless_mobile/core/logic/error_code_localization_mapper.dart';
|
||||
import 'package:paperless_mobile/core/model/error_message.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/documents/bloc/documents_cubit.dart';
|
||||
@@ -138,12 +137,12 @@ class _DocumentFilterPanelState extends State<DocumentFilterPanel> {
|
||||
const SizedBox(
|
||||
height: 16.0,
|
||||
),
|
||||
_buildSortByChipsList(context, state),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(S.of(context).documentsFilterPageSearchLabel),
|
||||
).padded(const EdgeInsets.only(left: 8.0)),
|
||||
_buildQueryFormField(state),
|
||||
_buildSortByChipsList(context, state),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(S.of(context).documentsFilterPageAdvancedLabel),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:paperless_mobile/features/documents/bloc/documents_cubit.dart';
|
||||
import 'package:paperless_mobile/features/documents/bloc/documents_state.dart';
|
||||
import 'package:paperless_mobile/features/documents/view/widgets/selection/bulk_delete_confirmation_dialog.dart';
|
||||
import 'package:paperless_mobile/features/documents/view/widgets/selection/saved_view_selection_widget.dart';
|
||||
import 'package:paperless_mobile/features/documents/view/widgets/sort_documents_button.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/util.dart';
|
||||
|
||||
@@ -28,12 +29,14 @@ class _DocumentsPageAppBarState extends State<DocumentsPageAppBar> {
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<DocumentsCubit, DocumentsState>(
|
||||
builder: (context, documentsState) {
|
||||
if (documentsState.selection.isNotEmpty) {
|
||||
final hasSelection = documentsState.selection.isNotEmpty;
|
||||
if (hasSelection) {
|
||||
return SliverAppBar(
|
||||
expandedHeight: kToolbarHeight + _flexibleAreaHeight,
|
||||
snap: true,
|
||||
floating: true,
|
||||
pinned: true,
|
||||
expandedHeight: kToolbarHeight,
|
||||
flexibleSpace: _buildFlexibleArea(false),
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: () =>
|
||||
@@ -51,13 +54,10 @@ class _DocumentsPageAppBarState extends State<DocumentsPageAppBar> {
|
||||
} else {
|
||||
return SliverAppBar(
|
||||
expandedHeight: kToolbarHeight + _flexibleAreaHeight,
|
||||
snap: true,
|
||||
floating: true,
|
||||
pinned: true,
|
||||
flexibleSpace: const FlexibleSpaceBar(
|
||||
background: Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: SavedViewSelectionWidget(height: _flexibleAreaHeight),
|
||||
),
|
||||
),
|
||||
flexibleSpace: _buildFlexibleArea(true),
|
||||
title: BlocBuilder<DocumentsCubit, DocumentsState>(
|
||||
builder: (context, state) {
|
||||
return Text(
|
||||
@@ -65,13 +65,30 @@ class _DocumentsPageAppBarState extends State<DocumentsPageAppBar> {
|
||||
);
|
||||
},
|
||||
),
|
||||
actions: widget.actions,
|
||||
actions: [
|
||||
...widget.actions,
|
||||
],
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildFlexibleArea(bool enabled) {
|
||||
return FlexibleSpaceBar(
|
||||
background: Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
//TODO: replace with sorting stuff...
|
||||
SavedViewSelectionWidget(height: 48, enabled: enabled),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _onDelete(BuildContext context, DocumentsState documentsState) async {
|
||||
final shouldDelete = await showDialog<bool>(
|
||||
context: context,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:paperless_mobile/core/model/error_message.dart';
|
||||
@@ -17,9 +15,11 @@ class SavedViewSelectionWidget extends StatelessWidget {
|
||||
const SavedViewSelectionWidget({
|
||||
Key? key,
|
||||
required this.height,
|
||||
required this.enabled,
|
||||
}) : super(key: key);
|
||||
|
||||
final double height;
|
||||
final bool enabled;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -33,7 +33,7 @@ class SavedViewSelectionWidget extends StatelessWidget {
|
||||
return Text(S.of(context).savedViewsEmptyStateText);
|
||||
}
|
||||
return SizedBox(
|
||||
height: 48.0,
|
||||
height: height,
|
||||
child: ListView.separated(
|
||||
itemCount: state.value.length,
|
||||
scrollDirection: Axis.horizontal,
|
||||
@@ -44,8 +44,10 @@ class SavedViewSelectionWidget extends StatelessWidget {
|
||||
child: FilterChip(
|
||||
label: Text(state.value.values.toList()[index].name),
|
||||
selected: view.id == state.selectedSavedViewId,
|
||||
onSelected: (isSelected) =>
|
||||
_onSelected(isSelected, context, view),
|
||||
onSelected: enabled
|
||||
? (isSelected) =>
|
||||
_onSelected(isSelected, context, view)
|
||||
: null,
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -65,7 +67,7 @@ class SavedViewSelectionWidget extends StatelessWidget {
|
||||
),
|
||||
TextButton.icon(
|
||||
icon: const Icon(Icons.add),
|
||||
onPressed: () => _onCreatePressed(context),
|
||||
onPressed: enabled ? () => _onCreatePressed(context) : null,
|
||||
label: Text(S.of(context).savedViewCreateNewLabel),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -19,7 +19,7 @@ class BottomNavBar extends StatelessWidget {
|
||||
selectedIndex: selectedIndex,
|
||||
destinations: [
|
||||
NavigationDestination(
|
||||
icon: const Icon(Icons.description_outlined),
|
||||
icon: const Icon(Icons.description),
|
||||
selectedIcon: Icon(
|
||||
Icons.description,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
|
||||
@@ -26,6 +26,12 @@ class InfoDrawer extends StatelessWidget {
|
||||
child: ListView(
|
||||
children: [
|
||||
DrawerHeader(
|
||||
padding: EdgeInsets.only(
|
||||
top: 8,
|
||||
left: 8,
|
||||
bottom: 0,
|
||||
right: 8,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -60,25 +66,45 @@ class InfoDrawer extends StatelessWidget {
|
||||
contentPadding: EdgeInsets.zero,
|
||||
dense: true,
|
||||
title: Text(
|
||||
state.host ?? '',
|
||||
S.of(context).appDrawerHeaderLoggedInAsText +
|
||||
(state.username ?? '?'),
|
||||
style: Theme.of(context).textTheme.bodyText2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.end,
|
||||
maxLines: 1,
|
||||
),
|
||||
isThreeLine: true,
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
state.username ?? '',
|
||||
state.host ?? '',
|
||||
style: Theme.of(context).textTheme.bodyText2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.end,
|
||||
maxLines: 1,
|
||||
),
|
||||
Text(
|
||||
'${S.of(context).serverInformationPaperlessVersionText} ${state.version} (API v${state.apiVersion})',
|
||||
style: Theme.of(context).textTheme.caption,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.end,
|
||||
maxLines: 1,
|
||||
),
|
||||
],
|
||||
),
|
||||
// title: RichText(
|
||||
|
||||
// text: TextSpan(
|
||||
// children: [
|
||||
// TextSpan(
|
||||
// text:
|
||||
// style:
|
||||
// Theme.of(context).textTheme.bodyText2,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
isThreeLine: true,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -33,43 +33,13 @@ class ScannerPage extends StatefulWidget {
|
||||
|
||||
class _ScannerPageState extends State<ScannerPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late final AnimationController _fabPulsingController;
|
||||
late final Animation _animation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_fabPulsingController =
|
||||
AnimationController(vsync: this, duration: const Duration(seconds: 1))
|
||||
..repeat(reverse: true);
|
||||
_animation = Tween(begin: 1.0, end: 1.2).animate(_fabPulsingController)
|
||||
..addListener(() => setState((() {})));
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_fabPulsingController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
drawer: const InfoDrawer(),
|
||||
floatingActionButton: BlocBuilder<DocumentScannerCubit, List<File>>(
|
||||
builder: (context, state) {
|
||||
final fab = FloatingActionButton(
|
||||
onPressed: () => _openDocumentScanner(context),
|
||||
child: const Icon(Icons.add_a_photo_outlined),
|
||||
);
|
||||
if (state.isEmpty) {
|
||||
return Transform.scale(
|
||||
child: fab,
|
||||
scale: _animation.value,
|
||||
);
|
||||
}
|
||||
return fab;
|
||||
},
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () => _openDocumentScanner(context),
|
||||
child: const Icon(Icons.add_a_photo_outlined),
|
||||
),
|
||||
appBar: _buildAppBar(context),
|
||||
body: Padding(
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
"genericActionUploadLabel": "Hochladen",
|
||||
"genericActionUpdateLabel": "Aktualisieren",
|
||||
"appDrawerSettingsLabel": "Einstellungen",
|
||||
"appDrawerAboutLabel": "Über",
|
||||
"appDrawerAboutLabel": "Über diese App",
|
||||
"appDrawerAboutInfoLoadingText": "Lade Anwendungsinformationen...",
|
||||
"appDrawerReportBugLabel": "Einen Fehler melden",
|
||||
"appDrawerLogoutLabel": "Verbindung trennen",
|
||||
@@ -186,9 +186,11 @@
|
||||
"referencedDocumentsReadOnlyHintText": "Dies ist eine schreibgeschützte Ansicht! Dokumente können nicht bearbeitet oder entfernt werden.",
|
||||
"editLabelPageConfirmDeletionDialogTitle": "Löschen bestätigen",
|
||||
"editLabelPageDeletionDialogText": "Dieser Kennzeichner wird von Dokumenten referenziert. Durch das Löschen dieses Kennzeichners werden alle Referenzen entfernt. Fortfahren?",
|
||||
"settingsPageStorageSettingsLabel": "Storage",
|
||||
"settingsPageStorageSettingsDescriptionText": "Manage files and storage space",
|
||||
"documentUpdateErrorMessage": "Document successfully updated.",
|
||||
"settingsPageStorageSettingsLabel": "Speicher",
|
||||
"settingsPageStorageSettingsDescriptionText": "Dateien und Speicherplatz verwalten",
|
||||
"documentUpdateErrorMessage": "Dokument erfolgreich aktualisiert.",
|
||||
"errorMessageMissingClientCertificate": "Ein Client Zerfitikat wurde erwartet, aber nicht gesendet. Bitte konfiguriere ein gültiges Zertifikat.",
|
||||
"serverInformationPaperlessVersionText": "Paperless Server-Version"
|
||||
"serverInformationPaperlessVersionText": "Paperless Server-Version",
|
||||
"errorReportLabel": "MELDEN",
|
||||
"appDrawerHeaderLoggedInAsText": "Eingeloggt als "
|
||||
}
|
||||
@@ -39,7 +39,7 @@
|
||||
"genericActionUploadLabel": "Upload",
|
||||
"genericActionUpdateLabel": "Update",
|
||||
"appDrawerSettingsLabel": "Settings",
|
||||
"appDrawerAboutLabel": "About",
|
||||
"appDrawerAboutLabel": "About this app",
|
||||
"appDrawerAboutInfoLoadingText": "Retrieving application information...",
|
||||
"appDrawerReportBugLabel": "Report a Bug",
|
||||
"appDrawerLogoutLabel": "Disconnect",
|
||||
@@ -191,5 +191,7 @@
|
||||
"settingsPageStorageSettingsDescriptionText": "Manage files and storage space",
|
||||
"documentUpdateErrorMessage": "Document successfully updated.",
|
||||
"errorMessageMissingClientCertificate": "A client certificate was expected but not sent. Please provide a valid client certificate.",
|
||||
"serverInformationPaperlessVersionText": "Paperless server version"
|
||||
"serverInformationPaperlessVersionText": "Paperless server version",
|
||||
"errorReportLabel": "REPORT",
|
||||
"appDrawerHeaderLoggedInAsText": "Logged in as "
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
@@ -9,6 +10,7 @@ import 'package:intl/intl.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:paperless_mobile/core/service/github_issue_service.dart';
|
||||
import 'package:paperless_mobile/generated/intl/messages_de.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
final dateFormat = DateFormat("yyyy-MM-dd");
|
||||
@@ -42,7 +44,7 @@ void showError(
|
||||
translateError(context, error.code),
|
||||
details: error.details,
|
||||
action: SnackBarAction(
|
||||
label: "REPORT",
|
||||
label: S.of(context).errorReportLabel,
|
||||
textColor: Colors.amber,
|
||||
onPressed: () => GithubIssueService.createIssueFromError(
|
||||
context,
|
||||
@@ -50,6 +52,12 @@ void showError(
|
||||
),
|
||||
),
|
||||
);
|
||||
log(
|
||||
"An error has occurred.",
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
time: DateTime.now(),
|
||||
);
|
||||
}
|
||||
|
||||
bool isNotNull(dynamic value) {
|
||||
|
||||
@@ -17,7 +17,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
version: 1.0.4+2
|
||||
version: 1.0.5+3
|
||||
|
||||
environment:
|
||||
sdk: ">=2.17.0 <3.0.0"
|
||||
|
||||
Reference in New Issue
Block a user