From 0ab8a87196cb10f3395459a189f9ccaf0f5455af Mon Sep 17 00:00:00 2001 From: Chaphasilor Date: Mon, 11 Nov 2024 12:21:29 +0100 Subject: [PATCH] moved feature chips settings to player screen settings --- .../customization_settings_screen.dart | 34 ------------------- lib/screens/player_settings_screen.dart | 34 +++++++++++++++++++ 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/lib/screens/customization_settings_screen.dart b/lib/screens/customization_settings_screen.dart index b8797c12..d8905035 100644 --- a/lib/screens/customization_settings_screen.dart +++ b/lib/screens/customization_settings_screen.dart @@ -41,7 +41,6 @@ class _CustomizationSettingsScreenState const PlaybackSpeedControlVisibilityDropdownListTile(), if (!Platform.isIOS) const ShowStopButtonOnMediaNotificationToggle(), const ShowSeekControlsOnMediaNotificationToggle(), - const ShowFeatureChipsToggle(), ], ), ); @@ -110,36 +109,3 @@ class ShowSeekControlsOnMediaNotificationToggle extends StatelessWidget { ); } } - -class ShowFeatureChipsToggle extends StatelessWidget { - const ShowFeatureChipsToggle({super.key}); - - @override - Widget build(BuildContext context) { - return ValueListenableBuilder>( - valueListenable: FinampSettingsHelper.finampSettingsListener, - builder: (context, box, child) { - bool? featureChipsEnabled = - box.get("FinampSettings")?.featureChipsConfiguration.enabled; - - return SwitchListTile.adaptive( - title: - Text(AppLocalizations.of(context)!.showFeatureChipsToggleTitle), - subtitle: Text( - AppLocalizations.of(context)!.showFeatureChipsToggleSubtitle), - value: featureChipsEnabled ?? false, - onChanged: featureChipsEnabled == null - ? null - : (value) { - FinampSettings finampSettingsTemp = - box.get("FinampSettings")!; - finampSettingsTemp.featureChipsConfiguration = - finampSettingsTemp.featureChipsConfiguration - .copyWith(enabled: value); - box.put("FinampSettings", finampSettingsTemp); - }, - ); - }, - ); - } -} diff --git a/lib/screens/player_settings_screen.dart b/lib/screens/player_settings_screen.dart index 40dce333..7d37802e 100644 --- a/lib/screens/player_settings_screen.dart +++ b/lib/screens/player_settings_screen.dart @@ -19,6 +19,7 @@ class PlayerSettingsScreen extends StatelessWidget { ), body: ListView( children: const [ + const ShowFeatureChipsToggle(), PlayerScreenMinimumCoverPaddingEditor(), SuppressPlayerPaddingSwitch(), PrioritizeCoverSwitch(), @@ -117,3 +118,36 @@ class PrioritizeCoverSwitch extends StatelessWidget { ); } } + +class ShowFeatureChipsToggle extends StatelessWidget { + const ShowFeatureChipsToggle({super.key}); + + @override + Widget build(BuildContext context) { + return ValueListenableBuilder>( + valueListenable: FinampSettingsHelper.finampSettingsListener, + builder: (context, box, child) { + bool? featureChipsEnabled = + box.get("FinampSettings")?.featureChipsConfiguration.enabled; + + return SwitchListTile.adaptive( + title: + Text(AppLocalizations.of(context)!.showFeatureChipsToggleTitle), + subtitle: Text( + AppLocalizations.of(context)!.showFeatureChipsToggleSubtitle), + value: featureChipsEnabled ?? false, + onChanged: featureChipsEnabled == null + ? null + : (value) { + FinampSettings finampSettingsTemp = + box.get("FinampSettings")!; + finampSettingsTemp.featureChipsConfiguration = + finampSettingsTemp.featureChipsConfiguration + .copyWith(enabled: value); + box.put("FinampSettings", finampSettingsTemp); + }, + ); + }, + ); + } +}