feat(profile): add local profiles with backup and restore

Move Mornye Settings to the Home avatar and keep search above the profile card. Center the metadata artwork and actions, and make artist names clickable in the Material player.
This commit is contained in:
zarzet committed 2026-09-21 17:28:18 +07:00
1 parent 5b519070a3
commit d8d46108bc
19 files changed
+1003 -80

No files matched your search

+31 -10
View File
@@ -494,12 +494,16 @@ class _MainShellState extends ConsumerState<MainShell>
}
void _onShellTabRequested(ShellTab tab) {
if (tab == ShellTab.settings && context.isMornye) {
unawaited(_openProfileSettings());
return;
}
final showStore = ref.read(
settingsProvider.select((s) => s.showExtensionStore),
);
final index = switch (tab) {
ShellTab.home => 0,
ShellTab.search => context.isMornye ? (showStore ? 4 : 3) : 0,
ShellTab.search => context.isMornye ? (showStore ? 3 : 2) : 0,
ShellTab.library => 1,
ShellTab.repository => showStore ? 2 : null,
ShellTab.settings => showStore ? 3 : 2,
@@ -507,6 +511,24 @@ class _MainShellState extends ConsumerState<MainShell>
if (index != null) _onNavTap(index, resetHome: tab != ShellTab.search);
}
bool _settingsPageOpen = false;
Future<void> _openProfileSettings() async {
if (_settingsPageOpen) return;
_settingsPageOpen = true;
FocusManager.instance.primaryFocus?.unfocus();
ref.read(previewPlayerProvider.notifier).stop();
try {
await Navigator.of(context).push(
slidePageRoute<void>(
page: const Scaffold(body: SettingsTab(asPage: true)),
),
);
} finally {
_settingsPageOpen = false;
}
}
void _onNavTap(int index, {bool resetHome = true}) {
final showStore = ref.read(
settingsProvider.select((s) => s.showExtensionStore),
@@ -594,7 +616,7 @@ class _MainShellState extends ConsumerState<MainShell>
final trackState = ref.read(trackProvider);
final isSearchTab =
_currentIndex == (context.isMornye ? (showStore ? 4 : 3) : 0);
_currentIndex == (context.isMornye ? (showStore ? 3 : 2) : 0);
final isKeyboardVisible = MediaQuery.viewInsetsOf(context).bottom > 0;
@@ -664,7 +686,7 @@ class _MainShellState extends ConsumerState<MainShell>
if (index == 0) return _homeTabNavigatorKey.currentState;
if (index == 1) return _libraryTabNavigatorKey.currentState;
if (showStore && index == 2) return _repoTabNavigatorKey.currentState;
if (context.isMornye && index == (showStore ? 4 : 3)) {
if (context.isMornye && index == (showStore ? 3 : 2)) {
return _searchTabNavigatorKey.currentState;
}
return null;
@@ -732,7 +754,7 @@ class _MainShellState extends ConsumerState<MainShell>
heroAnimationsEnabled: heroAnimationsEnabled,
child: const RepoTab(),
),
const SettingsTab(),
if (!context.isMornye) const SettingsTab(),
if (context.isMornye)
_TabNavigator(
key: const ValueKey('tab-search'),
@@ -803,13 +825,12 @@ class _MainShellState extends ConsumerState<MainShell>
),
label: l10n.navStore,
),
NavigationDestination(
icon: Icon(
context.isMornye ? CupertinoIcons.gear : Icons.settings_outlined,
if (!context.isMornye)
NavigationDestination(
icon: const Icon(Icons.settings_outlined),
selectedIcon: SpinIcon(child: const Icon(Icons.settings)),
label: l10n.navSettings,
),
selectedIcon: SpinIcon(child: const Icon(Icons.settings)),
label: l10n.navSettings,
),
if (context.isMornye)
NavigationDestination(
icon: const Icon(CupertinoIcons.search),