mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
feat: load config from text (#1772)
* feat: load config from text * opt: login utils * update Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> --------- Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
committed by
GitHub
parent
b4daf5fbd8
commit
244ef22f54
@@ -151,30 +151,29 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
||||
title: Text('用户ID', style: titleStyle),
|
||||
subtitle: Text(_userId, style: subTitleStyle),
|
||||
onTap: () {
|
||||
final key = GlobalKey<FormState>();
|
||||
final key = GlobalKey<FormFieldState<String>>();
|
||||
_textController.text = _userId;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) {
|
||||
return AlertDialog(
|
||||
title: Text('用户ID', style: titleStyle),
|
||||
content: Form(
|
||||
content: TextFormField(
|
||||
key: key,
|
||||
child: TextFormField(
|
||||
minLines: 1,
|
||||
maxLines: 4,
|
||||
autofocus: true,
|
||||
controller: _textController,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp(r'[a-zA-Z\d]+')),
|
||||
],
|
||||
validator: (value) {
|
||||
if ((value?.length ?? -1) < 30) {
|
||||
return '用户ID要求至少为30个字符长度的纯字符串';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
minLines: 1,
|
||||
maxLines: 4,
|
||||
autofocus: true,
|
||||
controller: _textController,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp(r'[a-zA-Z\d]+')),
|
||||
],
|
||||
decoration: const InputDecoration(errorMaxLines: 2),
|
||||
validator: (value) {
|
||||
if ((value?.length ?? -1) < 30) {
|
||||
return '用户ID要求至少为30个字符长度的纯字符串';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
|
||||
Reference in New Issue
Block a user