mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-23 12:10:33 +08:00
@@ -80,45 +80,43 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
||||
_textController.text = _blockLimit.toString();
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) {
|
||||
return AlertDialog(
|
||||
title: Text('最短片段时长', style: titleStyle),
|
||||
content: TextFormField(
|
||||
keyboardType: const TextInputType.numberWithOptions(
|
||||
decimal: true,
|
||||
),
|
||||
controller: _textController,
|
||||
autofocus: true,
|
||||
decoration: const InputDecoration(suffixText: 's'),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp(r'[\d\.]+')),
|
||||
],
|
||||
builder: (_) => AlertDialog(
|
||||
title: Text('最短片段时长', style: titleStyle),
|
||||
content: TextFormField(
|
||||
keyboardType: const TextInputType.numberWithOptions(
|
||||
decimal: true,
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: Get.back,
|
||||
child: Text(
|
||||
'取消',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
controller: _textController,
|
||||
autofocus: true,
|
||||
decoration: const InputDecoration(suffixText: 's'),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp(r'[\d\.]+')),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: Get.back,
|
||||
child: Text(
|
||||
'取消',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
_blockLimit = max(
|
||||
0.0,
|
||||
double.tryParse(_textController.text) ?? 0.0,
|
||||
);
|
||||
setting.put(SettingBoxKey.blockLimit, _blockLimit);
|
||||
(context as Element).markNeedsBuild();
|
||||
},
|
||||
child: const Text('确定'),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
_blockLimit = max(
|
||||
0.0,
|
||||
double.tryParse(_textController.text) ?? 0.0,
|
||||
);
|
||||
setting.put(SettingBoxKey.blockLimit, _blockLimit);
|
||||
(context as Element).markNeedsBuild();
|
||||
},
|
||||
child: const Text('确定'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
title: Text('最短片段时长', style: titleStyle),
|
||||
@@ -322,49 +320,47 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
||||
_textController.text = _blockServer;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) {
|
||||
return AlertDialog(
|
||||
title: Text('服务器地址', style: titleStyle),
|
||||
content: TextFormField(
|
||||
keyboardType: TextInputType.url,
|
||||
controller: _textController,
|
||||
autofocus: true,
|
||||
builder: (_) => AlertDialog(
|
||||
title: Text('服务器地址', style: titleStyle),
|
||||
content: TextFormField(
|
||||
keyboardType: TextInputType.url,
|
||||
controller: _textController,
|
||||
autofocus: true,
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
_blockServer = HttpString.sponsorBlockBaseUrl;
|
||||
setting.put(SettingBoxKey.blockServer, _blockServer);
|
||||
Request.accountManager.blockServer = _blockServer;
|
||||
(context as Element).markNeedsBuild();
|
||||
},
|
||||
child: const Text('重置'),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
_blockServer = HttpString.sponsorBlockBaseUrl;
|
||||
setting.put(SettingBoxKey.blockServer, _blockServer);
|
||||
Request.accountManager.blockServer = _blockServer;
|
||||
(context as Element).markNeedsBuild();
|
||||
},
|
||||
child: const Text('重置'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: Get.back,
|
||||
child: Text(
|
||||
'取消',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
TextButton(
|
||||
onPressed: Get.back,
|
||||
child: Text(
|
||||
'取消',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
_blockServer = _textController.text;
|
||||
setting.put(SettingBoxKey.blockServer, _blockServer);
|
||||
Request.accountManager.blockServer = _blockServer;
|
||||
_checkServerStatus();
|
||||
_getUserInfo();
|
||||
(context as Element).markNeedsBuild();
|
||||
},
|
||||
child: const Text('确定'),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
_blockServer = _textController.text;
|
||||
setting.put(SettingBoxKey.blockServer, _blockServer);
|
||||
Request.accountManager.blockServer = _blockServer;
|
||||
_checkServerStatus();
|
||||
_getUserInfo();
|
||||
(context as Element).markNeedsBuild();
|
||||
},
|
||||
child: const Text('确定'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
title: Text(
|
||||
|
||||
Reference in New Issue
Block a user