mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-09 18:50:11 +08:00
mod: update block page
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -104,11 +104,11 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
_blockLimit = max(
|
_blockLimit = max(
|
||||||
0.0, double.tryParse(_textController.text) ?? 0.0);
|
0.0, double.tryParse(_textController.text) ?? 0.0);
|
||||||
await setting.put(SettingBoxKey.blockLimit, _blockLimit);
|
setting.put(SettingBoxKey.blockLimit, _blockLimit);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
child: const Text('确定'),
|
child: const Text('确定'),
|
||||||
@@ -170,10 +170,10 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
_userId = const Uuid().v4().replaceAll('-', '');
|
_userId = const Uuid().v4().replaceAll('-', '');
|
||||||
await setting.put(SettingBoxKey.blockUserID, _userId);
|
setting.put(SettingBoxKey.blockUserID, _userId);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
child: const Text('随机'),
|
child: const Text('随机'),
|
||||||
@@ -188,11 +188,11 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () {
|
||||||
if (key.currentState?.validate() == true) {
|
if (key.currentState?.validate() == true) {
|
||||||
Get.back();
|
Get.back();
|
||||||
_userId = _textController.text;
|
_userId = _textController.text;
|
||||||
await setting.put(SettingBoxKey.blockUserID, _userId);
|
setting.put(SettingBoxKey.blockUserID, _userId);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -205,15 +205,15 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
Future<void> _updateBlockToast() async {
|
void _updateBlockToast() {
|
||||||
_blockToast = !_blockToast;
|
_blockToast = !_blockToast;
|
||||||
await setting.put(SettingBoxKey.blockToast, _blockToast);
|
setting.put(SettingBoxKey.blockToast, _blockToast);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _updateBlockTrack() async {
|
void _updateBlockTrack() {
|
||||||
_blockTrack = !_blockTrack;
|
_blockTrack = !_blockTrack;
|
||||||
await setting.put(SettingBoxKey.blockTrack, _blockTrack);
|
setting.put(SettingBoxKey.blockTrack, _blockTrack);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,11 +289,10 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
_blockServer = HttpString.sponsorBlockBaseUrl;
|
_blockServer = HttpString.sponsorBlockBaseUrl;
|
||||||
await setting.put(
|
setting.put(SettingBoxKey.blockServer, _blockServer);
|
||||||
SettingBoxKey.blockServer, _blockServer);
|
|
||||||
Request.accountManager.blockServer = _blockServer;
|
Request.accountManager.blockServer = _blockServer;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
@@ -309,11 +308,10 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
_blockServer = _textController.text;
|
_blockServer = _textController.text;
|
||||||
await setting.put(
|
setting.put(SettingBoxKey.blockServer, _blockServer);
|
||||||
SettingBoxKey.blockServer, _blockServer);
|
|
||||||
Request.accountManager.blockServer = _blockServer;
|
Request.accountManager.blockServer = _blockServer;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
@@ -336,14 +334,16 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
|
|
||||||
Widget _serverStatusItem(ThemeData theme, TextStyle titleStyle) => ListTile(
|
Widget _serverStatusItem(ThemeData theme, TextStyle titleStyle) => ListTile(
|
||||||
dense: true,
|
dense: true,
|
||||||
onTap: _checkServerStatus,
|
onTap: () {
|
||||||
title: Text(
|
setState(() {
|
||||||
'服务器状态',
|
_serverStatus = null;
|
||||||
style: titleStyle,
|
});
|
||||||
),
|
_checkServerStatus();
|
||||||
|
},
|
||||||
|
title: Text('服务器状态', style: titleStyle),
|
||||||
trailing: Text(
|
trailing: Text(
|
||||||
_serverStatus == null
|
_serverStatus == null
|
||||||
? '-'
|
? '——'
|
||||||
: _serverStatus == true
|
: _serverStatus == true
|
||||||
? '正常'
|
? '正常'
|
||||||
: '错误',
|
: '错误',
|
||||||
@@ -436,10 +436,10 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
),
|
),
|
||||||
content: SlideColorPicker(
|
content: SlideColorPicker(
|
||||||
color: _blockColor[index],
|
color: _blockColor[index],
|
||||||
callback: (Color? color) async {
|
callback: (Color? color) {
|
||||||
_blockColor[index] =
|
_blockColor[index] =
|
||||||
color ?? _blockSettings[index].first.color;
|
color ?? _blockSettings[index].first.color;
|
||||||
await setting.put(
|
setting.put(
|
||||||
SettingBoxKey.blockColor,
|
SettingBoxKey.blockColor,
|
||||||
_blockColor
|
_blockColor
|
||||||
.map((item) =>
|
.map((item) =>
|
||||||
@@ -478,9 +478,9 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
|||||||
),
|
),
|
||||||
PopupMenuButton(
|
PopupMenuButton(
|
||||||
initialValue: _blockSettings[index].second,
|
initialValue: _blockSettings[index].second,
|
||||||
onSelected: (item) async {
|
onSelected: (item) {
|
||||||
_blockSettings[index].second = item;
|
_blockSettings[index].second = item;
|
||||||
await setting.put(
|
setting.put(
|
||||||
SettingBoxKey.blockSettings,
|
SettingBoxKey.blockSettings,
|
||||||
_blockSettings
|
_blockSettings
|
||||||
.map((item) => item.second.index)
|
.map((item) => item.second.index)
|
||||||
|
|||||||
Reference in New Issue
Block a user