mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-06 05:15:51 -06:00
Merge branch 'development' into feature/notes
This commit is contained in:
@@ -115,11 +115,11 @@ class FileService {
|
||||
formatBytes(await getDirSizeInBytes(consumptionDir));
|
||||
|
||||
logger.ft(
|
||||
"Removing scans...",
|
||||
"Clearing scans directory...",
|
||||
className: runtimeType.toString(),
|
||||
methodName: "clearUserData",
|
||||
);
|
||||
await _temporaryScansDirectory.delete(recursive: true);
|
||||
await _temporaryScansDirectory.clear();
|
||||
logger.ft(
|
||||
"Removed $scanDirSize...",
|
||||
className: runtimeType.toString(),
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/core/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/core/widgets/form_builder_fields/extended_date_range_form_field/extended_date_range_dialog.dart';
|
||||
import 'package:paperless_mobile/core/widgets/form_builder_fields/extended_date_range_form_field/relative_date_range_picker_helper.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
@@ -11,6 +12,7 @@ class FormBuilderExtendedDateRangePicker extends StatefulWidget {
|
||||
final String labelText;
|
||||
final DateRangeQuery initialValue;
|
||||
final void Function(DateRangeQuery? query)? onChanged;
|
||||
final EdgeInsets padding;
|
||||
|
||||
const FormBuilderExtendedDateRangePicker({
|
||||
super.key,
|
||||
@@ -18,6 +20,7 @@ class FormBuilderExtendedDateRangePicker extends StatefulWidget {
|
||||
required this.labelText,
|
||||
required this.initialValue,
|
||||
this.onChanged,
|
||||
required this.padding,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -49,29 +52,36 @@ class _FormBuilderExtendedDateRangePickerState
|
||||
builder: (field) {
|
||||
return Column(
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: _textEditingController,
|
||||
readOnly: true,
|
||||
onTap: () => _showExtendedDateRangePicker(field),
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.date_range),
|
||||
labelText: widget.labelText,
|
||||
suffixIcon: _textEditingController.text.isNotEmpty
|
||||
? IconButton(
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: () {
|
||||
field.didChange(const UnsetDateRangeQuery());
|
||||
},
|
||||
)
|
||||
: null,
|
||||
Padding(
|
||||
padding: widget.padding.copyWith(bottom: 0),
|
||||
child: TextFormField(
|
||||
controller: _textEditingController,
|
||||
readOnly: true,
|
||||
onTap: () => _showExtendedDateRangePicker(field),
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.date_range),
|
||||
labelText: widget.labelText,
|
||||
suffixIcon: _textEditingController.text.isNotEmpty
|
||||
? IconButton(
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: () {
|
||||
field.didChange(const UnsetDateRangeQuery());
|
||||
},
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
),
|
||||
MediaQuery.removePadding(
|
||||
context: context,
|
||||
removeLeft: true,
|
||||
removeRight: true,
|
||||
child: RelativeDateRangePickerHelper(field: field),
|
||||
),
|
||||
RelativeDateRangePickerHelper(
|
||||
field: field,
|
||||
padding: widget.padding,
|
||||
)
|
||||
// MediaQuery.removePadding(
|
||||
//context: context,
|
||||
//removeLeft: true,
|
||||
//removeRight: true,
|
||||
//child: ,
|
||||
//),
|
||||
],
|
||||
);
|
||||
},
|
||||
|
||||
@@ -6,11 +6,13 @@ import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
class RelativeDateRangePickerHelper extends StatefulWidget {
|
||||
final FormFieldState<DateRangeQuery> field;
|
||||
final void Function(DateRangeQuery value)? onChanged;
|
||||
final EdgeInsets padding;
|
||||
|
||||
const RelativeDateRangePickerHelper({
|
||||
super.key,
|
||||
required this.field,
|
||||
this.onChanged,
|
||||
required this.padding,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -24,25 +26,32 @@ class _RelativeDateRangePickerHelperState
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
height: 64,
|
||||
child: ListView.separated(
|
||||
itemCount: _options.length,
|
||||
separatorBuilder: (context, index) => const SizedBox(width: 8.0),
|
||||
itemBuilder: (context, index) {
|
||||
final option = _options[index];
|
||||
return ColoredChipWrapper(
|
||||
child: FilterChip(
|
||||
label: Text(option.title),
|
||||
onSelected: (isSelected) {
|
||||
final value =
|
||||
isSelected ? option.value : const RelativeDateRangeQuery();
|
||||
widget.field.didChange(value);
|
||||
widget.onChanged?.call(value);
|
||||
},
|
||||
selected: widget.field.value == option.value,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: CustomScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
slivers: [
|
||||
SliverToBoxAdapter(child: SizedBox(width: widget.padding.left)),
|
||||
SliverList.separated(
|
||||
itemCount: _options.length,
|
||||
separatorBuilder: (context, index) => const SizedBox(width: 8.0),
|
||||
itemBuilder: (context, index) {
|
||||
final option = _options[index];
|
||||
return ColoredChipWrapper(
|
||||
child: FilterChip(
|
||||
label: Text(option.title),
|
||||
onSelected: (isSelected) {
|
||||
final value = isSelected
|
||||
? option.value
|
||||
: const RelativeDateRangeQuery();
|
||||
widget.field.didChange(value);
|
||||
widget.onChanged?.call(value);
|
||||
},
|
||||
selected: widget.field.value == option.value,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
SliverToBoxAdapter(child: SizedBox(width: widget.padding.right))
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,10 @@ class ChangelogDialog extends StatelessWidget {
|
||||
}
|
||||
|
||||
const _versionNumbers = {
|
||||
"59": "3.1.5",
|
||||
"4033": "3.1.8",
|
||||
"4023": "3.1.7",
|
||||
"4013": "3.1.6",
|
||||
"4003": "3.1.5",
|
||||
"58": "3.1.4",
|
||||
"57": "3.1.3",
|
||||
"56": "3.1.2",
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/core/database/tables/local_user_account.dart';
|
||||
import 'package:paperless_mobile/core/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/core/repository/label_repository.dart';
|
||||
import 'package:paperless_mobile/core/widgets/form_builder_fields/extended_date_range_form_field/form_builder_extended_date_range_picker.dart';
|
||||
import 'package:paperless_mobile/features/labels/tags/view/widgets/tags_form_field.dart';
|
||||
@@ -93,14 +94,14 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
|
||||
|
||||
List<Widget> _buildFormFieldList(LabelRepository labelRepository) {
|
||||
return [
|
||||
_buildQueryFormField(),
|
||||
_buildQueryFormField().paddedSymmetrically(horizontal: 12),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
S.of(context)!.advanced,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
),
|
||||
).paddedLTRB(12, 16, 12, 0),
|
||||
FormBuilderExtendedDateRangePicker(
|
||||
name: DocumentFilterForm.fkCreatedAt,
|
||||
initialValue: widget.initialFilter.created,
|
||||
@@ -108,6 +109,7 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
|
||||
onChanged: (_) {
|
||||
_checkQueryConstraints();
|
||||
},
|
||||
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
||||
),
|
||||
FormBuilderExtendedDateRangePicker(
|
||||
name: DocumentFilterForm.fkAddedAt,
|
||||
@@ -116,17 +118,28 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
|
||||
onChanged: (_) {
|
||||
_checkQueryConstraints();
|
||||
},
|
||||
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
||||
),
|
||||
_buildCorrespondentFormField(labelRepository.correspondents),
|
||||
_buildDocumentTypeFormField(labelRepository.documentTypes),
|
||||
_buildStoragePathFormField(labelRepository.storagePaths),
|
||||
_buildTagsFormField(labelRepository.tags),
|
||||
]
|
||||
.map((w) => SliverPadding(
|
||||
padding: widget.padding,
|
||||
sliver: SliverToBoxAdapter(child: w),
|
||||
))
|
||||
.toList();
|
||||
_buildCorrespondentFormField(labelRepository.correspondents)
|
||||
.paddedSymmetrically(
|
||||
horizontal: 16,
|
||||
vertical: 4,
|
||||
),
|
||||
_buildDocumentTypeFormField(labelRepository.documentTypes)
|
||||
.paddedSymmetrically(
|
||||
horizontal: 16,
|
||||
vertical: 4,
|
||||
),
|
||||
_buildStoragePathFormField(labelRepository.storagePaths)
|
||||
.paddedSymmetrically(
|
||||
horizontal: 16,
|
||||
vertical: 4,
|
||||
),
|
||||
_buildTagsFormField(labelRepository.tags).paddedSymmetrically(
|
||||
horizontal: 16,
|
||||
vertical: 4,
|
||||
),
|
||||
].map((e) => SliverToBoxAdapter(child: e)).toList();
|
||||
}
|
||||
|
||||
void _checkQueryConstraints() {
|
||||
|
||||
@@ -385,7 +385,7 @@ class _GoRouterShellState extends State<GoRouterShell> {
|
||||
);
|
||||
},
|
||||
routerConfig: _router,
|
||||
debugShowCheckedModeBanner: true,
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: "Paperless Mobile",
|
||||
theme: buildTheme(
|
||||
brightness: Brightness.light,
|
||||
@@ -397,7 +397,7 @@ class _GoRouterShellState extends State<GoRouterShell> {
|
||||
dynamicScheme: darkDynamic,
|
||||
preferredColorScheme: settings.preferredColorSchemeOption,
|
||||
),
|
||||
themeMode: settings.preferredThemeMode,
|
||||
themeMode: settings.preferredThemeMode,
|
||||
supportedLocales: const [
|
||||
Locale('en'),
|
||||
Locale('de'),
|
||||
|
||||
Reference in New Issue
Block a user