mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-14 22:12:18 -06:00
feat: bugfixes, finished go_router migration, implemented better visibility of states
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
|
||||
class StoragePathWidget extends StatelessWidget {
|
||||
final StoragePath? storagePath;
|
||||
final Color? textColor;
|
||||
final bool isClickable;
|
||||
final void Function(int? id)? onSelected;
|
||||
|
||||
const StoragePathWidget({
|
||||
Key? key,
|
||||
this.storagePath,
|
||||
this.textColor,
|
||||
this.isClickable = true,
|
||||
this.onSelected,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AbsorbPointer(
|
||||
absorbing: !isClickable,
|
||||
child: GestureDetector(
|
||||
onTap: () => onSelected?.call(storagePath?.id),
|
||||
child: Text(
|
||||
storagePath?.name ?? "-",
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: textColor ?? Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/edit_label/view/impl/add_tag_page.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
@@ -68,9 +69,10 @@ class _FullscreenTagsFormState extends State<FullscreenTagsForm> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final showFab = MediaQuery.viewInsetsOf(context).bottom == 0;
|
||||
final theme = Theme.of(context);
|
||||
return Scaffold(
|
||||
floatingActionButton: widget.allowCreation
|
||||
floatingActionButton: widget.allowCreation && showFab
|
||||
? FloatingActionButton(
|
||||
heroTag: "fab_tags_form",
|
||||
onPressed: _onAddTag,
|
||||
@@ -238,10 +240,16 @@ class _FullscreenTagsFormState extends State<FullscreenTagsForm> {
|
||||
var matches = _options
|
||||
.where((e) => e.name.trim().toLowerCase().contains(normalizedQuery));
|
||||
if (matches.isEmpty && widget.allowCreation) {
|
||||
yield Text(S.of(context)!.noItemsFound);
|
||||
yield TextButton(
|
||||
child: Text(S.of(context)!.addTag),
|
||||
onPressed: _onAddTag,
|
||||
yield Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Text(S.of(context)!.noItemsFound).padded(),
|
||||
TextButton(
|
||||
child: Text(S.of(context)!.addTag),
|
||||
onPressed: _onAddTag,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
for (final tag in matches) {
|
||||
|
||||
@@ -69,6 +69,7 @@ class _FullscreenLabelFormState<T extends Label>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final showFab = MediaQuery.viewInsetsOf(context).bottom == 0;
|
||||
final theme = Theme.of(context);
|
||||
final options = _filterOptionsByQuery(_textEditingController.text);
|
||||
return Scaffold(
|
||||
@@ -124,6 +125,13 @@ class _FullscreenLabelFormState<T extends Label>
|
||||
),
|
||||
),
|
||||
),
|
||||
floatingActionButton: showFab && widget.onCreateNewLabel != null
|
||||
? FloatingActionButton(
|
||||
heroTag: "fab_label_form",
|
||||
onPressed: _onCreateNewLabel,
|
||||
child: const Icon(Icons.add),
|
||||
)
|
||||
: null,
|
||||
body: Builder(
|
||||
builder: (context) {
|
||||
return Column(
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/core/database/tables/local_user_account.dart';
|
||||
import 'package:paperless_mobile/core/navigation/push_routes.dart';
|
||||
import 'package:paperless_mobile/helpers/format_helpers.dart';
|
||||
import 'package:paperless_mobile/routes/typed/branches/labels_route.dart';
|
||||
|
||||
|
||||
@@ -76,9 +76,7 @@ class LabelTabView<T extends Label> extends StatelessWidget {
|
||||
Text(
|
||||
translateMatchingAlgorithmName(
|
||||
context, l.matchingAlgorithm) +
|
||||
((l.match?.isNotEmpty ?? false)
|
||||
? ": ${l.match}"
|
||||
: ""),
|
||||
(l.match.isNotEmpty ? ": ${l.match}" : ""),
|
||||
maxLines: 2,
|
||||
),
|
||||
onOpenEditPage: canEdit ? onEdit : null,
|
||||
|
||||
Reference in New Issue
Block a user