Polish media viewer, pull-to-sync, search nav, and add seek bar presets
- Remove peek details sheet from media viewer; scope Activity tab to the current file via client-side filtering instead of unreliable server-side query params - Add file rename action (WebDAV MOVE); fix search result taps to switch to Files tab and rebuild breadcrumbs from an absolute path - Add swipe-to-delete confirmation dialog; fix a crash from disposing the rename dialog's TextEditingController too early - Rework pull-to-sync gesture so sync and lock-open thresholds fire independently within one gesture, raise thresholds, and add a classic Material refresh spinner - Add "tap active tab to scroll to top" behavior with a settings toggle - Align selection toolbar padding with the sort/filter controls row - Replace app icon assets (adaptive icon + splash screen) with updated IconKitchen export - Replace the seek bar style dropdown with a Default/Wavy/Slim/Squiggly preset picker, each rendered with a live, perpetually-animated preview via a new shared SeekBarPainter/SeekBarPreview Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+24
-16
@@ -1,7 +1,9 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:provider/provider.dart';
|
||||
import '../models/app_tab.dart';
|
||||
import '../models/nextcloud_item.dart';
|
||||
import '../providers/server_provider.dart';
|
||||
import 'file_viewer_screen.dart';
|
||||
@@ -90,6 +92,25 @@ class _SearchViewState extends State<SearchView> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Navigates the Files tab to [item] (its own folder if it's a folder,
|
||||
/// its parent folder otherwise - rebuilding the whole breadcrumb trail
|
||||
/// from root rather than assuming it's under wherever the user was
|
||||
/// browsing before), switches the shell to the Files tab, and closes
|
||||
/// search. For a file, also opens it once back on Files.
|
||||
Future<void> _openResult(NextcloudItem item) async {
|
||||
final provider = context.read<ServerProvider>();
|
||||
final navigator = Navigator.of(context);
|
||||
|
||||
final folderPath = item.isFolder ? item.path : p.dirname(item.path);
|
||||
await provider.navigateToAbsoluteFolder(folderPath);
|
||||
provider.requestTab(AppTab.files);
|
||||
navigator.popUntil((route) => route.isFirst);
|
||||
|
||||
if (!item.isFolder) {
|
||||
navigator.push(FileViewerScreen.route(item: item));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
@@ -106,6 +127,7 @@ class _SearchViewState extends State<SearchView> {
|
||||
focusNode: _focusNode,
|
||||
autoFocus: true,
|
||||
hintText: 'Search your files...',
|
||||
elevation: const WidgetStatePropertyAll(0),
|
||||
onChanged: _onChanged,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back_rounded),
|
||||
@@ -151,14 +173,7 @@ class _SearchViewState extends State<SearchView> {
|
||||
);
|
||||
}
|
||||
if (!_hasSearched) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'Search across your whole Nextcloud',
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
color: colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
);
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
if (_results.isEmpty) {
|
||||
return Center(
|
||||
@@ -185,14 +200,7 @@ class _SearchViewState extends State<SearchView> {
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
onTap: () {
|
||||
if (item.isFolder) {
|
||||
context.read<ServerProvider>().navigateToFolder(item.path);
|
||||
Navigator.pop(context);
|
||||
} else {
|
||||
Navigator.push(context, FileViewerScreen.route(item: item));
|
||||
}
|
||||
},
|
||||
onTap: () => _openResult(item),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user