mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-06-04 21:58:02 +02:00
973c2e3b41
- Fix update checker for versions with suffix (hotfix/beta/rc) - Add collapsing header to Search tab for consistent UI - Redesign Settings with Android-style grouped cards - Increase app bar title size (28px) and height (130px) - Replace all print() with structured logging (logger package) - Fix lint warnings (curly braces, unnecessary underscores)
95 lines
3.2 KiB
Dart
95 lines
3.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:spotiflac_android/constants/app_info.dart';
|
|
import 'package:spotiflac_android/screens/settings/appearance_settings_page.dart';
|
|
import 'package:spotiflac_android/screens/settings/download_settings_page.dart';
|
|
import 'package:spotiflac_android/screens/settings/options_settings_page.dart';
|
|
import 'package:spotiflac_android/screens/settings/about_page.dart';
|
|
import 'package:spotiflac_android/widgets/settings_group.dart';
|
|
|
|
class SettingsTab extends ConsumerWidget {
|
|
const SettingsTab({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final colorScheme = Theme.of(context).colorScheme;
|
|
|
|
return CustomScrollView(
|
|
slivers: [
|
|
// Collapsing App Bar
|
|
SliverAppBar(
|
|
expandedHeight: 130,
|
|
collapsedHeight: kToolbarHeight,
|
|
floating: false,
|
|
pinned: true,
|
|
backgroundColor: colorScheme.surface,
|
|
surfaceTintColor: Colors.transparent,
|
|
automaticallyImplyLeading: false,
|
|
flexibleSpace: FlexibleSpaceBar(
|
|
expandedTitleScale: 1.3,
|
|
titlePadding: const EdgeInsets.only(left: 24, bottom: 16),
|
|
title: Text(
|
|
'Settings',
|
|
style: TextStyle(
|
|
fontSize: 28,
|
|
fontWeight: FontWeight.bold,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
|
|
// First group: Appearance & Download
|
|
SliverToBoxAdapter(
|
|
child: SettingsGroup(
|
|
margin: const EdgeInsets.fromLTRB(16, 16, 16, 4),
|
|
children: [
|
|
SettingsItem(
|
|
icon: Icons.palette_outlined,
|
|
title: 'Appearance',
|
|
subtitle: 'Theme, colors, display',
|
|
onTap: () => _navigateTo(context, const AppearanceSettingsPage()),
|
|
),
|
|
SettingsItem(
|
|
icon: Icons.download_outlined,
|
|
title: 'Download',
|
|
subtitle: 'Service, quality, filename format',
|
|
onTap: () => _navigateTo(context, const DownloadSettingsPage()),
|
|
),
|
|
SettingsItem(
|
|
icon: Icons.tune_outlined,
|
|
title: 'Options',
|
|
subtitle: 'Fallback, lyrics, cover art, updates',
|
|
onTap: () => _navigateTo(context, const OptionsSettingsPage()),
|
|
showDivider: false,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
|
|
// Second group: About
|
|
SliverToBoxAdapter(
|
|
child: SettingsGroup(
|
|
children: [
|
|
SettingsItem(
|
|
icon: Icons.info_outline,
|
|
title: 'About',
|
|
subtitle: 'Version ${AppInfo.version}, credits, GitHub',
|
|
onTap: () => _navigateTo(context, const AboutPage()),
|
|
showDivider: false,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
|
|
// Fill remaining space
|
|
const SliverFillRemaining(hasScrollBody: false, child: SizedBox()),
|
|
],
|
|
);
|
|
}
|
|
|
|
void _navigateTo(BuildContext context, Widget page) {
|
|
Navigator.of(context).push(MaterialPageRoute(builder: (_) => page));
|
|
}
|
|
}
|