center save button

This commit is contained in:
Simon Ding
2024-07-05 15:24:59 +08:00
parent 6e50e84694
commit 2cdb2b3332

View File

@@ -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,11 +41,9 @@ class _SystemSettingsPageState extends State<SystemSettingsPage> {
return v!.trim().isNotEmpty ? null : "ApiKey 不能为空"; return v!.trim().isNotEmpty ? null : "ApiKey 不能为空";
}, },
), ),
Padding(
padding: const EdgeInsets.only(top: 28.0),
child: Row(
children: <Widget>[
Center( Center(
child: Padding(
padding: const EdgeInsets.only(top: 28.0),
child: ElevatedButton( child: ElevatedButton(
child: const Padding( child: const Padding(
padding: EdgeInsets.all(16.0), padding: EdgeInsets.all(16.0),
@@ -53,20 +53,17 @@ class _SystemSettingsPageState extends State<SystemSettingsPage> {
// 通过_formKey.currentState 获取FormState后 // 通过_formKey.currentState 获取FormState后
// 调用validate()方法校验用户名密码是否合法,校验 // 调用validate()方法校验用户名密码是否合法,校验
// 通过后再提交数据。 // 通过后再提交数据。
if ((_formKey.currentState as FormState) if ((_formKey.currentState as FormState).validate()) {
.validate()) {
_submitSettings(context, _tmdbApiKeyController.text); _submitSettings(context, _tmdbApiKeyController.text);
} }
}, },
), ),
), ),
],
),
) )
], ],
), ),
)), )),
); ));
} }
Future<void> _handleRefresh() async { Future<void> _handleRefresh() async {