Files
noo/lib/models/app_tab.dart
ayushyaandClaude Sonnet 5 58312511c5
Build APK / build (push) Successful in 5m30s
Add "Search in bottom bar" to Settings
New Settings > Appearance toggle moves Search into the bottom bar and
out of the top bar, so there's only one search entry point on screen.
Tapping it pushes SearchView same as before - it's never highlighted,
since it isn't a real destination.

- Attached: Search becomes the row's last item, styled like any other
  tab but permanently idle.
- Floating: Search gets its own separate, always fully round satellite
  circle beside the bar instead.

Enabling it costs one regular tab: SettingsController.maxVisibleTabs
is now a dynamic getter (defaultMaxVisibleTabs - 1 while the toggle is
on) instead of the old flat constant, re-enforced immediately if the
user already has all 5 slots filled - the same cleanup path used for
a fresh install or an app update that added a new tab.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 22:19:13 -04:00

72 lines
2.1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:lucide_icons_flutter/lucide_icons.dart';
/// Every destination the bottom nav bar can show. Order here is only the
/// fallback default — actual order/visibility/default-tab are user
/// configurable and persisted in `SettingsController`.
enum AppTab {
files,
photos,
favorites,
activity,
trash,
shares,
recent,
offline,
}
/// At most this many tabs may be visible in the bottom nav bar at once —
/// the rest are reachable through the "more" dropdown instead. The
/// effective cap a screen should actually use is
/// [SettingsController.maxVisibleTabs], not this directly - it's one
/// lower than this while `searchInBottomBar` is on, since Search then
/// takes the freed-up slot itself rather than competing with the user's
/// own reorderable tabs for one of these.
const int defaultMaxVisibleTabs = 5;
extension AppTabInfo on AppTab {
String get label {
switch (this) {
case AppTab.files:
return 'Files';
case AppTab.photos:
return 'Photos';
case AppTab.favorites:
return 'Favorites';
case AppTab.activity:
return 'Activity';
case AppTab.trash:
return 'Trash';
case AppTab.shares:
return 'Shares';
case AppTab.recent:
return 'Recent';
case AppTab.offline:
return 'Offline';
}
}
// Lucide icon mapping per DESIGN_SYSTEM.md 1.5 - the Lucide icon slug is
// named in a comment where it doesn't match the Dart identifier.
IconData get icon {
switch (this) {
case AppTab.files:
return LucideIcons.folder;
case AppTab.photos:
return LucideIcons.images;
case AppTab.favorites:
return LucideIcons.star;
case AppTab.activity:
return LucideIcons.activity;
case AppTab.trash:
return LucideIcons.trash2; // trash-2
case AppTab.shares:
return LucideIcons.share2; // share-2
case AppTab.recent:
return LucideIcons.clock;
case AppTab.offline:
return LucideIcons.hardDriveDownload; // hard-drive-download
}
}
}