mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-30 13:19:44 +02:00
refactor(ui): unify theme styling and enlarge profile button
Centralize existing Material and Mornye layout metrics in AppTokens and share adaptive icon selection. Enlarge the Home profile avatar to 44 dp with a 56 dp touch target.
This commit is contained in:
1 parent
39273edd85
commit
146b2acd4d
20 files changed
+191
-65
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart' show CupertinoIcons;
|
||||
import 'package:spotiflac_android/theme/app_tokens.dart';
|
||||
import 'package:spotiflac_android/theme/mornye_theme.dart';
|
||||
import 'package:spotiflac_android/screens/track_history_snapshot.dart';
|
||||
import 'package:spotiflac_android/widgets/collection_scaffold.dart';
|
||||
@@ -514,7 +515,7 @@ class _AlbumScreenState extends ConsumerState<AlbumScreen>
|
||||
extensionId: widget.extensionId,
|
||||
style: TextStyle(
|
||||
color: colorScheme.primary,
|
||||
fontSize: context.isMornye ? 20 : 16,
|
||||
fontSize: context.tokens.headerSubtitleSize,
|
||||
fontWeight: context.isMornye
|
||||
? FontWeight.w400
|
||||
: FontWeight.w600,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:spotiflac_android/theme/app_tokens.dart';
|
||||
import 'package:spotiflac_android/theme/mornye_theme.dart';
|
||||
import 'package:spotiflac_android/theme/cover_palette.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -395,7 +396,7 @@ class _DownloadedAlbumScreenState extends ConsumerState<DownloadedAlbumScreen>
|
||||
color: context.isMornye
|
||||
? colorScheme.primary
|
||||
: HeaderPalette.of(context).onSurfaceVariant,
|
||||
fontSize: context.isMornye ? 20 : 16,
|
||||
fontSize: context.tokens.headerSubtitleSize,
|
||||
fontWeight: context.isMornye ? FontWeight.w400 : FontWeight.w600,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
|
||||
@@ -274,9 +274,9 @@ class _TrackItemWithStatus extends ConsumerWidget {
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
12,
|
||||
context.isMornye ? 12 : 10,
|
||||
context.tokens.trackRowPaddingV,
|
||||
6,
|
||||
context.isMornye ? 12 : 10,
|
||||
context.tokens.trackRowPaddingV,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -494,7 +494,7 @@ class _CollectionItemWidget extends StatelessWidget {
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: context.isMornye ? 12 : 10,
|
||||
vertical: context.tokens.trackRowPaddingV,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:spotiflac_android/theme/app_tokens.dart';
|
||||
import 'package:spotiflac_android/theme/mornye_theme.dart';
|
||||
import 'package:spotiflac_android/services/local_track_batch_actions.dart';
|
||||
import 'package:spotiflac_android/theme/cover_palette.dart';
|
||||
@@ -274,7 +275,7 @@ class _LocalAlbumScreenState extends ConsumerState<LocalAlbumScreen>
|
||||
color: context.isMornye
|
||||
? colorScheme.primary
|
||||
: HeaderPalette.of(context).onSurfaceVariant,
|
||||
fontSize: context.isMornye ? 20 : 16,
|
||||
fontSize: context.tokens.headerSubtitleSize,
|
||||
fontWeight: context.isMornye ? FontWeight.w400 : FontWeight.w600,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
|
||||
@@ -15,6 +15,7 @@ import 'package:spotiflac_android/screens/downloaded_album_screen.dart';
|
||||
import 'package:spotiflac_android/screens/local_album_screen.dart';
|
||||
import 'package:spotiflac_android/services/library_database.dart';
|
||||
import 'package:spotiflac_android/services/music_player_service.dart';
|
||||
import 'package:spotiflac_android/theme/app_tokens.dart';
|
||||
import 'package:spotiflac_android/theme/mornye_theme.dart';
|
||||
import 'package:spotiflac_android/utils/clickable_metadata.dart';
|
||||
import 'package:spotiflac_android/utils/file_access.dart';
|
||||
@@ -2034,7 +2035,7 @@ class _PlaybackControls extends ConsumerWidget {
|
||||
icon: const Icon(Icons.skip_previous),
|
||||
onPressed: controller.previous,
|
||||
),
|
||||
SizedBox(width: mornye ? 12 : 20),
|
||||
SizedBox(width: context.tokens.playerControlGap),
|
||||
if (mornye)
|
||||
MornyePlaybackButton(
|
||||
icon: isPlaying
|
||||
@@ -2073,7 +2074,7 @@ class _PlaybackControls extends ConsumerWidget {
|
||||
: () => controller.togglePlayPause(isPlaying),
|
||||
),
|
||||
),
|
||||
SizedBox(width: mornye ? 12 : 20),
|
||||
SizedBox(width: context.tokens.playerControlGap),
|
||||
if (mornye)
|
||||
MornyePlaybackButton(
|
||||
icon: CupertinoIcons.forward_fill,
|
||||
@@ -2496,7 +2497,7 @@ class _SyncedLyricsViewState extends ConsumerState<_SyncedLyricsView> {
|
||||
? Theme.of(context).textTheme.headlineSmall
|
||||
: Theme.of(context).textTheme.titleLarge)
|
||||
?.copyWith(
|
||||
height: mornye ? 1.3 : 1.4,
|
||||
height: context.tokens.lyricsLineHeight,
|
||||
fontSize: mornye ? 28 : null,
|
||||
fontWeight: mornye || isActive
|
||||
? FontWeight.bold
|
||||
@@ -2543,7 +2544,9 @@ class _SyncedLyricsViewState extends ConsumerState<_SyncedLyricsView> {
|
||||
|
||||
return Padding(
|
||||
key: _lineKeys[index],
|
||||
padding: EdgeInsets.symmetric(vertical: mornye ? 16 : 10),
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: context.tokens.lyricsLinePaddingV,
|
||||
),
|
||||
child: GestureDetector(
|
||||
onTap: () =>
|
||||
ref.read(musicPlayerControllerProvider).seek(line.time),
|
||||
@@ -2785,7 +2788,7 @@ class _WordHighlightedLyricLineState
|
||||
(Theme.of(context).textTheme.headlineSmall ?? const TextStyle())
|
||||
.copyWith(
|
||||
fontSize: context.isMornye ? 28 : null,
|
||||
height: context.isMornye ? 1.3 : 1.4,
|
||||
height: context.tokens.lyricsLineHeight,
|
||||
fontWeight: FontWeight.bold,
|
||||
);
|
||||
final primary = widget.line.hasWordTiming
|
||||
|
||||
@@ -332,7 +332,7 @@ class _ExtensionDetailsScreenState
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
context.isMornye ? mornyeIconFor(icon) : icon,
|
||||
context.adaptiveIcon(icon),
|
||||
size: 20,
|
||||
color: colorScheme.primary,
|
||||
),
|
||||
@@ -768,7 +768,7 @@ class _CapabilityRow extends StatelessWidget {
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
context.isMornye ? mornyeIconFor(icon) : icon,
|
||||
context.adaptiveIcon(icon),
|
||||
size: 20,
|
||||
color: enabled ? colorScheme.primary : colorScheme.outline,
|
||||
),
|
||||
|
||||
@@ -697,7 +697,7 @@ class _AboutSettingsItem extends StatelessWidget {
|
||||
width: 40,
|
||||
height: 40,
|
||||
child: Icon(
|
||||
context.isMornye ? mornyeIconFor(icon) : icon,
|
||||
context.adaptiveIcon(icon),
|
||||
color: context.isMornye
|
||||
? colorScheme.primary
|
||||
: colorScheme.onSurfaceVariant,
|
||||
|
||||
@@ -282,9 +282,7 @@ class _UpdateChannelSelector extends StatelessWidget {
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
context.isMornye
|
||||
? mornyeIconFor(Icons.new_releases)
|
||||
: Icons.new_releases,
|
||||
context.adaptiveIcon(Icons.new_releases),
|
||||
color: context.isMornye
|
||||
? colorScheme.primary
|
||||
: colorScheme.onSurfaceVariant,
|
||||
@@ -389,9 +387,7 @@ class _VerificationBrowserModeSelector extends StatelessWidget {
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
context.isMornye
|
||||
? mornyeIconFor(Icons.open_in_browser)
|
||||
: Icons.open_in_browser,
|
||||
context.adaptiveIcon(Icons.open_in_browser),
|
||||
color: context.isMornye
|
||||
? colorScheme.primary
|
||||
: colorScheme.onSurfaceVariant,
|
||||
|
||||
@@ -709,7 +709,7 @@ class _LanguageSelector extends StatelessWidget {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
final content = ListTile(
|
||||
leading: Icon(
|
||||
context.isMornye ? mornyeIconFor(Icons.language) : Icons.language,
|
||||
context.adaptiveIcon(Icons.language),
|
||||
color: context.isMornye
|
||||
? colorScheme.primary
|
||||
: colorScheme.onSurfaceVariant,
|
||||
|
||||
@@ -594,7 +594,6 @@ class _ExtensionDivider extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) => Divider(
|
||||
height: 1,
|
||||
thickness: context.isMornye ? 0.5 : 1,
|
||||
indent: indent,
|
||||
endIndent: 16,
|
||||
color: context.isMornye
|
||||
@@ -706,7 +705,7 @@ class _CapabilityItem extends StatelessWidget {
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
context.isMornye ? mornyeIconFor(icon) : icon,
|
||||
context.adaptiveIcon(icon),
|
||||
color: context.isMornye || enabled
|
||||
? colorScheme.primary
|
||||
: colorScheme.outline,
|
||||
@@ -980,7 +979,7 @@ class _PermissionItem extends StatelessWidget {
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
context.isMornye ? mornyeIconFor(icon) : icon,
|
||||
context.adaptiveIcon(icon),
|
||||
color: context.isMornye
|
||||
? colorScheme.primary
|
||||
: colorScheme.onSurfaceVariant,
|
||||
|
||||
@@ -438,7 +438,7 @@ class _EditMetadataSheetState extends State<_EditMetadataSheet> {
|
||||
vertical: 4,
|
||||
),
|
||||
leading: Icon(
|
||||
context.isMornye ? mornyeIconFor(icon) : icon,
|
||||
context.adaptiveIcon(icon),
|
||||
color: selected ? cs.primary : cs.onSurfaceVariant,
|
||||
),
|
||||
title: Text(name, maxLines: 2, overflow: TextOverflow.ellipsis),
|
||||
@@ -3165,11 +3165,7 @@ class _EditMetadataSheetState extends State<_EditMetadataSheet> {
|
||||
|
||||
final headerRow = Row(
|
||||
children: [
|
||||
Icon(
|
||||
context.isMornye ? mornyeIconFor(icon) : icon,
|
||||
size: 20,
|
||||
color: cs.primary,
|
||||
),
|
||||
Icon(context.adaptiveIcon(icon), size: 20, color: cs.primary),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
|
||||
@@ -486,7 +486,7 @@ class _TourFeature extends StatelessWidget {
|
||||
SizedBox(
|
||||
width: 36,
|
||||
child: Icon(
|
||||
context.isMornye ? mornyeIconFor(icon) : icon,
|
||||
context.adaptiveIcon(icon),
|
||||
size: 28,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user