Files
SpotiFLAC-Mobile/lib/widgets/lyrics_size_setting.dart
T
zarzet e56d59c798 feat(theme): adopt Material Symbols and expressive components
The Material theme now draws its main surfaces with rounded Material
Symbols: navigation, player, mini player, queue, settings, sheets,
dialogs and shared controls. AppIcon maps legacy Icons to their symbol
and keeps outlined glyphs unfilled. Mornye keeps its original icons.

Icon buttons, text and filled buttons, dialog actions, sliders, the setup
FAB and indeterminate spinners use the Material 3 Expressive components.
Each wrapper falls back to the standard Flutter widget for Mornye, reduced
motion and custom sizing, so existing layouts and hit areas stay intact.
2026-10-13 18:27:38 +07:00

64 lines
2.1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:spotiflac_android/l10n/l10n.dart';
import 'package:spotiflac_android/providers/theme_provider.dart';
import 'package:spotiflac_android/widgets/app_icon_button.dart';
import 'package:spotiflac_android/widgets/app_slider.dart';
import 'package:spotiflac_android/widgets/lyrics_text_scale.dart';
class LyricsSizeSetting extends ConsumerWidget {
const LyricsSizeSetting({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final scale = ref.watch(
themeProvider.select((theme) => theme.lyricsTextScale),
);
final notifier = ref.read(themeProvider.notifier);
final percent = '${(scale * 100).round()}%';
return Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(
child: Text(
context.l10n.lyricsTextSize,
style: Theme.of(context).textTheme.titleMedium,
),
),
Text(percent),
AppIconButton(
tooltip: context.l10n.libraryFilterReset,
onPressed: scale == 1
? null
: () => notifier.setLyricsTextScale(1),
icon: const Icon(Icons.restart_alt),
),
],
),
LyricsTextScale(
child: Text(
context.l10n.lyricsTextPreview,
style: Theme.of(context).textTheme.headlineSmall,
),
),
AppSlider(
value: scale,
min: 0.8,
max: 1.4,
divisions: 12,
label: percent,
semanticFormatterCallback: (value) => '${(value * 100).round()}%',
onChanged: (value) =>
notifier.setLyricsTextScale(value, persist: false),
onChangeEnd: notifier.setLyricsTextScale,
),
],
),
);
}
}