Files
Redesnigned-Finamp/lib/components/AudioServiceSettingsScreen/song_shuffle_item_count_editor.dart
T
Zakaria d0ca84d8d2
Build / Build for Android (push) Has been cancelled
Build / Build for iOS (push) Has been cancelled
redesign app phase 1
2026-05-18 14:34:41 -04:00

43 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:finamp/l10n/app_localizations.dart';
import '../../services/finamp_settings_helper.dart';
class SongShuffleItemCountEditor extends StatefulWidget {
const SongShuffleItemCountEditor({Key? key}) : super(key: key);
@override
State<SongShuffleItemCountEditor> createState() =>
_SongShuffleItemCountEditorState();
}
class _SongShuffleItemCountEditorState
extends State<SongShuffleItemCountEditor> {
final _controller = TextEditingController(
text:
FinampSettingsHelper.finampSettings.songShuffleItemCount.toString());
@override
Widget build(BuildContext context) {
return ListTile(
title: Text(AppLocalizations.of(context)!.shuffleAllSongCount),
subtitle: Text(AppLocalizations.of(context)!.shuffleAllSongCountSubtitle),
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);
}
},
),
),
);
}
}