mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00
refactor(settings): use dropdown button instead of dropdown menu for smaller selections
This commit is contained in:
parent
54d5907f14
commit
80959aa0ca
@ -133,23 +133,23 @@ class SettingsPage extends HookConsumerWidget {
|
|||||||
subtitle: const Text(
|
subtitle: const Text(
|
||||||
"Override responsive layout mode settings",
|
"Override responsive layout mode settings",
|
||||||
),
|
),
|
||||||
trailing: (context, update) => DropdownMenu<LayoutMode>(
|
trailing: (context, update) => DropdownButton<LayoutMode>(
|
||||||
dropdownMenuEntries: const [
|
items: const [
|
||||||
DropdownMenuEntry(
|
DropdownMenuItem(
|
||||||
value: LayoutMode.adaptive,
|
value: LayoutMode.adaptive,
|
||||||
label: "Adaptive",
|
child: Text("Adaptive"),
|
||||||
),
|
),
|
||||||
DropdownMenuEntry(
|
DropdownMenuItem(
|
||||||
value: LayoutMode.compact,
|
value: LayoutMode.compact,
|
||||||
label: "Compact",
|
child: Text("Compact"),
|
||||||
),
|
),
|
||||||
DropdownMenuEntry(
|
DropdownMenuItem(
|
||||||
value: LayoutMode.extended,
|
value: LayoutMode.extended,
|
||||||
label: "Extended",
|
child: Text("Extended"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
initialSelection: preferences.layoutMode,
|
value: preferences.layoutMode,
|
||||||
onSelected: (value) {
|
onChanged: (value) {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
preferences.setLayoutMode(value);
|
preferences.setLayoutMode(value);
|
||||||
update?.call(() {});
|
update?.call(() {});
|
||||||
@ -160,23 +160,23 @@ class SettingsPage extends HookConsumerWidget {
|
|||||||
AdaptiveListTile(
|
AdaptiveListTile(
|
||||||
leading: const Icon(SpotubeIcons.darkMode),
|
leading: const Icon(SpotubeIcons.darkMode),
|
||||||
title: const Text("Theme"),
|
title: const Text("Theme"),
|
||||||
trailing: (context, update) => DropdownMenu<ThemeMode>(
|
trailing: (context, update) => DropdownButton<ThemeMode>(
|
||||||
initialSelection: preferences.themeMode,
|
value: preferences.themeMode,
|
||||||
dropdownMenuEntries: const [
|
items: const [
|
||||||
DropdownMenuEntry(
|
DropdownMenuItem(
|
||||||
value: ThemeMode.dark,
|
value: ThemeMode.dark,
|
||||||
label: "Dark",
|
child: Text("Dark"),
|
||||||
),
|
),
|
||||||
DropdownMenuEntry(
|
DropdownMenuItem(
|
||||||
value: ThemeMode.light,
|
value: ThemeMode.light,
|
||||||
label: "Light",
|
child: Text("Light"),
|
||||||
),
|
),
|
||||||
DropdownMenuEntry(
|
DropdownMenuItem(
|
||||||
value: ThemeMode.system,
|
value: ThemeMode.system,
|
||||||
label: "System",
|
child: Text("System"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
onSelected: (value) {
|
onChanged: (value) {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
preferences.setThemeMode(value);
|
preferences.setThemeMode(value);
|
||||||
update?.call(() {});
|
update?.call(() {});
|
||||||
@ -214,19 +214,20 @@ class SettingsPage extends HookConsumerWidget {
|
|||||||
AdaptiveListTile(
|
AdaptiveListTile(
|
||||||
leading: const Icon(SpotubeIcons.audioQuality),
|
leading: const Icon(SpotubeIcons.audioQuality),
|
||||||
title: const Text("Audio Quality"),
|
title: const Text("Audio Quality"),
|
||||||
trailing: (context, update) => DropdownMenu<AudioQuality>(
|
trailing: (context, update) =>
|
||||||
initialSelection: preferences.audioQuality,
|
DropdownButton<AudioQuality>(
|
||||||
dropdownMenuEntries: const [
|
value: preferences.audioQuality,
|
||||||
DropdownMenuEntry(
|
items: const [
|
||||||
|
DropdownMenuItem(
|
||||||
value: AudioQuality.high,
|
value: AudioQuality.high,
|
||||||
label: "High",
|
child: Text("High"),
|
||||||
),
|
),
|
||||||
DropdownMenuEntry(
|
DropdownMenuItem(
|
||||||
value: AudioQuality.low,
|
value: AudioQuality.low,
|
||||||
label: "Low",
|
child: Text("Low"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
onSelected: (value) {
|
onChanged: (value) {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
preferences.setAudioQuality(value);
|
preferences.setAudioQuality(value);
|
||||||
update?.call(() {});
|
update?.call(() {});
|
||||||
|
17
pubspec.lock
17
pubspec.lock
@ -17,6 +17,23 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.4.0"
|
version: "5.4.0"
|
||||||
|
animate_gradient:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
path: "."
|
||||||
|
ref: "2e02ab5d1cb60fc172a5f15f6e91bd34a050af23"
|
||||||
|
resolved-ref: "2e02ab5d1cb60fc172a5f15f6e91bd34a050af23"
|
||||||
|
url: "https://github.com/Vikaskumar75/Animated-Gradient"
|
||||||
|
source: git
|
||||||
|
version: "0.0.2"
|
||||||
|
animated_gradient:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: animated_gradient
|
||||||
|
sha256: "9c0c52a093817ae42550e3affec6973a7bae7186d1d5d58749ca9689da3ba245"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.2"
|
||||||
app_package_maker:
|
app_package_maker:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -9,6 +9,11 @@ environment:
|
|||||||
sdk: ">=2.17.0 <3.0.0"
|
sdk: ">=2.17.0 <3.0.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
|
animate_gradient:
|
||||||
|
git:
|
||||||
|
url: https://github.com/Vikaskumar75/Animated-Gradient
|
||||||
|
ref: 2e02ab5d1cb60fc172a5f15f6e91bd34a050af23
|
||||||
|
animated_gradient: ^0.0.2
|
||||||
args: ^2.3.2
|
args: ^2.3.2
|
||||||
async: ^2.9.0
|
async: ^2.9.0
|
||||||
audio_service: ^0.18.9
|
audio_service: ^0.18.9
|
||||||
|
Loading…
Reference in New Issue
Block a user