mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-23 04:00:28 +08:00
@@ -1,5 +1,3 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/common/widgets/pair.dart';
|
||||
import 'package:PiliPlus/http/constants.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
@@ -17,6 +15,7 @@ import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:crypto/crypto.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart' show FilteringTextInputFormatter;
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||
@@ -98,20 +97,19 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
||||
onPressed: Get.back,
|
||||
child: Text(
|
||||
'取消',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
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();
|
||||
try {
|
||||
_blockLimit = double.parse(_textController.text);
|
||||
Get.back();
|
||||
setting.put(SettingBoxKey.blockLimit, _blockLimit);
|
||||
(context as Element).markNeedsBuild();
|
||||
} catch (e) {
|
||||
SmartDialog.showToast(e.toString());
|
||||
}
|
||||
},
|
||||
child: const Text('确定'),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user