Dedupe native transfer/notification code and split ServerProvider into focused controllers
Build APK / build (push) Successful in 5m20s
Build APK / build (push) Successful in 5m20s
Consolidates duplicated GET/PUT/notification-channel logic across DownloadService/ShareUploadService/SyncEngine into shared Kotlin helpers, gives upload/download real batch queueing instead of dropping a second concurrent batch, and dedupes repeated Dart channel-argument boilerplate. Replaces the 2300+ line ServerProvider god object with ten focused ChangeNotifiers (SessionController, SettingsController, FilesController, PhotosController, FavoritesController, TrashController, SharesController, RecentController, SyncStatusController, PickController) plus ItemOperations, a plain coordinator for cross-domain item mutations - fixing the coupling where device-sync status, per-tab data, and global UI prefs all lived in one object. Updates every view/widget call site accordingly and refreshes the architecture/server/standards/styling docs to match. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../models/app_tab.dart';
|
||||
import '../providers/server_provider.dart';
|
||||
import '../providers/pick_controller.dart';
|
||||
import '../providers/settings_controller.dart';
|
||||
import 'app_tab_view_builder.dart';
|
||||
|
||||
/// Opens a tab that's currently hidden from the bottom nav bar as its own
|
||||
@@ -13,23 +14,24 @@ class MoreTabsButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final provider = context.watch<ServerProvider>();
|
||||
final pick = context.watch<PickController>();
|
||||
final settings = context.watch<SettingsController>();
|
||||
|
||||
// While picking (another app's GET_CONTENT request), MainShellView
|
||||
// already restricts the bottom nav to Files/Photos - this button would
|
||||
// otherwise be the one remaining way to reach a tab that isn't a valid
|
||||
// pick source (Trash, Shares, ...), so it hides entirely rather than
|
||||
// just disabling.
|
||||
if (provider.isPicking) return const SizedBox.shrink();
|
||||
if (pick.isPicking) return const SizedBox.shrink();
|
||||
|
||||
return PopupMenuButton<AppTab>(
|
||||
icon: const Icon(Icons.apps_rounded),
|
||||
tooltip: 'More tabs',
|
||||
enabled: provider.hiddenTabs.isNotEmpty,
|
||||
enabled: settings.hiddenTabs.isNotEmpty,
|
||||
onSelected: (tab) => _openHiddenTab(context, tab),
|
||||
itemBuilder: (context) => [
|
||||
for (final tab in provider.tabOrder.where(
|
||||
(t) => provider.hiddenTabs.contains(t),
|
||||
for (final tab in settings.tabOrder.where(
|
||||
(t) => settings.hiddenTabs.contains(t),
|
||||
))
|
||||
PopupMenuItem(
|
||||
value: tab,
|
||||
|
||||
Reference in New Issue
Block a user