Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-01-29 13:35:51 +08:00
parent bcbfe5c849
commit 5979ddb60c
46 changed files with 3266 additions and 3293 deletions

View File

@@ -61,13 +61,11 @@ class _ColorSelectPageState extends State<ColorSelectPage> {
onTap: () async {
final result = await showDialog<ThemeType>(
context: context,
builder: (context) {
return SelectDialog<ThemeType>(
title: '主题模式',
value: ctr.themeType.value,
values: ThemeType.values.map((e) => (e, e.desc)).toList(),
);
},
builder: (context) => SelectDialog<ThemeType>(
title: '主题模式',
value: ctr.themeType.value,
values: ThemeType.values.map((e) => (e, e.desc)).toList(),
),
);
if (result != null) {
try {

View File

@@ -59,61 +59,59 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
double? customSpeed;
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: const Text('添加倍速'),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(height: 12),
TextField(
autofocus: true,
keyboardType: const TextInputType.numberWithOptions(
decimal: true,
),
decoration: const InputDecoration(
labelText: '自定义倍速',
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(6)),
),
),
onChanged: (value) {
customSpeed = double.tryParse(value);
},
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp(r'[\d\.]+')),
],
builder: (context) => AlertDialog(
title: const Text('添加倍速'),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(height: 12),
TextField(
autofocus: true,
keyboardType: const TextInputType.numberWithOptions(
decimal: true,
),
],
),
actions: [
TextButton(
onPressed: Get.back,
child: Text(
'取消',
style: TextStyle(color: Theme.of(context).colorScheme.outline),
decoration: const InputDecoration(
labelText: '自定义倍速',
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(6)),
),
),
),
TextButton(
onPressed: () {
if (customSpeed == null) {
SmartDialog.showToast('输入倍数不合法');
} else if (speedList.contains(customSpeed)) {
SmartDialog.showToast('该倍速已存在');
} else {
Get.back();
speedList
..add(customSpeed!)
..sort();
video.put(VideoBoxKey.speedsList, speedList);
setState(() {});
}
onChanged: (value) {
customSpeed = double.tryParse(value);
},
child: const Text('确认'),
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp(r'[\d\.]+')),
],
),
],
);
},
),
actions: [
TextButton(
onPressed: Get.back,
child: Text(
'取消',
style: TextStyle(color: Theme.of(context).colorScheme.outline),
),
),
TextButton(
onPressed: () {
if (customSpeed == null) {
SmartDialog.showToast('输入倍数不合法');
} else if (speedList.contains(customSpeed)) {
SmartDialog.showToast('该倍速已存在');
} else {
Get.back();
speedList
..add(customSpeed!)
..sort();
video.put(VideoBoxKey.speedsList, speedList);
setState(() {});
}
},
child: const Text('确认'),
),
],
),
);
}