mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-15 04:12:30 -06:00
feat: Add remote_version endpoint to mock server, resolve versions, update search
This commit is contained in:
@@ -93,7 +93,6 @@ class _DocumentSearchBarState extends State<DocumentSearchBar> {
|
||||
],
|
||||
child: Provider(
|
||||
create: (_) => DocumentSearchCubit(
|
||||
context.read(),
|
||||
context.read(),
|
||||
context.read(),
|
||||
Hive.box<LocalUserAppState>(HiveBoxes.localUserAppState)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:paperless_mobile/core/navigation/push_routes.dart';
|
||||
@@ -12,8 +12,6 @@ import 'package:paperless_mobile/features/documents/view/widgets/adaptive_docume
|
||||
import 'package:paperless_mobile/features/documents/view/widgets/selection/view_type_selection_widget.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'dart:math' as math;
|
||||
|
||||
class DocumentSearchPage extends StatefulWidget {
|
||||
const DocumentSearchPage({super.key});
|
||||
|
||||
@@ -28,13 +26,15 @@ class _DocumentSearchPageState extends State<DocumentSearchPage> {
|
||||
Timer? _debounceTimer;
|
||||
|
||||
String get query => _queryController.text;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const double progressIndicatorHeight = 4;
|
||||
final theme = Theme.of(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: theme.colorScheme.surfaceVariant,
|
||||
toolbarHeight: 72,
|
||||
toolbarHeight: 72 - progressIndicatorHeight,
|
||||
leading: BackButton(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
@@ -77,13 +77,13 @@ class _DocumentSearchPageState extends State<DocumentSearchPage> {
|
||||
).padded(),
|
||||
],
|
||||
bottom: PreferredSize(
|
||||
preferredSize: Size.fromHeight(1),
|
||||
preferredSize: const Size.fromHeight(progressIndicatorHeight),
|
||||
child: BlocBuilder<DocumentSearchCubit, DocumentSearchState>(
|
||||
builder: (context, state) {
|
||||
if (state.isLoading) {
|
||||
return const LinearProgressIndicator();
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
return ColoredBox(color: Theme.of(context).colorScheme.surface);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -140,6 +140,13 @@ class _DocumentSearchPageState extends State<DocumentSearchPage> {
|
||||
childCount: suggestions.length,
|
||||
),
|
||||
),
|
||||
if (suggestions.isEmpty && historyMatches.isEmpty)
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
sliver: SliverToBoxAdapter(
|
||||
child: Center(child: Text(S.of(context)!.noMatchesFound)),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:hive_flutter/adapters.dart';
|
||||
import 'package:paperless_mobile/core/config/hive/hive_config.dart';
|
||||
import 'package:paperless_mobile/core/database/tables/global_settings.dart';
|
||||
import 'package:paperless_mobile/core/database/tables/local_user_app_state.dart';
|
||||
import 'package:paperless_mobile/core/delegate/customizable_sliver_persistent_header_delegate.dart';
|
||||
import 'package:paperless_mobile/features/document_search/cubit/document_search_cubit.dart';
|
||||
import 'package:paperless_mobile/features/document_search/view/document_search_bar.dart';
|
||||
|
||||
class SliverSearchBar extends StatelessWidget {
|
||||
@@ -30,15 +27,7 @@ class SliverSearchBar extends StatelessWidget {
|
||||
maxExtent: kToolbarHeight,
|
||||
child: Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: BlocProvider(
|
||||
create: (context) => DocumentSearchCubit(
|
||||
context.read(),
|
||||
context.read(),
|
||||
context.read(),
|
||||
Hive.box<LocalUserAppState>(HiveBoxes.localUserAppState).get(currentUser)!,
|
||||
),
|
||||
child: const DocumentSearchBar(),
|
||||
),
|
||||
child: const DocumentSearchBar(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user