-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure amount of songs played with shuffle all
- Loading branch information
Showing
6 changed files
with
84 additions
and
18 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
lib/components/AudioServiceSettingsScreen/SongShuffleItemCountEditor.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../../services/FinampSettingsHelper.dart'; | ||
|
||
class SongShuffleItemCountEditor extends StatefulWidget { | ||
const SongShuffleItemCountEditor({Key? key}) : super(key: key); | ||
|
||
@override | ||
_SongShuffleItemCountEditorState createState() => | ||
_SongShuffleItemCountEditorState(); | ||
} | ||
|
||
class _SongShuffleItemCountEditorState | ||
extends State<SongShuffleItemCountEditor> { | ||
final _controller = TextEditingController( | ||
text: | ||
FinampSettingsHelper.finampSettings.songShuffleItemCount.toString()); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ListTile( | ||
title: Text("Song Shuffle Song Count"), | ||
subtitle: Text( | ||
"Amount of songs to load when using the shuffle all songs button. Has no effect in offline mode."), | ||
trailing: SizedBox( | ||
width: 50 * MediaQuery.of(context).textScaleFactor, | ||
child: TextField( | ||
controller: _controller, | ||
textAlign: TextAlign.center, | ||
keyboardType: TextInputType.number, | ||
onChanged: (value) { | ||
final valueInt = int.tryParse(value); | ||
|
||
if (valueInt != null) { | ||
FinampSettingsHelper.setSongShuffleItemCount(valueInt); | ||
} | ||
}, | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters