mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 03:27:39 +08:00
center save button
This commit is contained in:
@@ -20,6 +20,8 @@ class _SystemSettingsPageState extends State<SystemSettingsPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
_handleRefresh();
|
_handleRefresh();
|
||||||
return Expanded(
|
return Expanded(
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.fromLTRB(40, 10, 40, 0),
|
||||||
child: RefreshIndicator(
|
child: RefreshIndicator(
|
||||||
onRefresh: _handleRefresh,
|
onRefresh: _handleRefresh,
|
||||||
child: Form(
|
child: Form(
|
||||||
@@ -39,34 +41,29 @@ class _SystemSettingsPageState extends State<SystemSettingsPage> {
|
|||||||
return v!.trim().isNotEmpty ? null : "ApiKey 不能为空";
|
return v!.trim().isNotEmpty ? null : "ApiKey 不能为空";
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
Padding(
|
Center(
|
||||||
padding: const EdgeInsets.only(top: 28.0),
|
child: Padding(
|
||||||
child: Row(
|
padding: const EdgeInsets.only(top: 28.0),
|
||||||
children: <Widget>[
|
child: ElevatedButton(
|
||||||
Center(
|
child: const Padding(
|
||||||
child: ElevatedButton(
|
padding: EdgeInsets.all(16.0),
|
||||||
child: const Padding(
|
child: Text("保存"),
|
||||||
padding: EdgeInsets.all(16.0),
|
|
||||||
child: Text("保存"),
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
// 通过_formKey.currentState 获取FormState后,
|
|
||||||
// 调用validate()方法校验用户名密码是否合法,校验
|
|
||||||
// 通过后再提交数据。
|
|
||||||
if ((_formKey.currentState as FormState)
|
|
||||||
.validate()) {
|
|
||||||
_submitSettings(context,_tmdbApiKeyController.text);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
onPressed: () {
|
||||||
|
// 通过_formKey.currentState 获取FormState后,
|
||||||
|
// 调用validate()方法校验用户名密码是否合法,校验
|
||||||
|
// 通过后再提交数据。
|
||||||
|
if ((_formKey.currentState as FormState).validate()) {
|
||||||
|
_submitSettings(context, _tmdbApiKeyController.text);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _handleRefresh() async {
|
Future<void> _handleRefresh() async {
|
||||||
|
|||||||
Reference in New Issue
Block a user