feat:更新用户表单
This commit is contained in:
@@ -164,10 +164,6 @@ class _ProfileFormState extends State<ProfileForm> {
|
||||
FormBuilderField<List<String>>(
|
||||
name: 'tags',
|
||||
initialValue: provider.userFormItem.tags,
|
||||
validator: FormBuilderValidators.minLength(
|
||||
1,
|
||||
errorText: '至少添加一个标签',
|
||||
),
|
||||
builder: (FormFieldState<List<String>> field) {
|
||||
return FlutterInputChips(
|
||||
padding: EdgeInsets.all(0),
|
||||
@@ -236,13 +232,20 @@ class _ProfileFormState extends State<ProfileForm> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final provider = context.watch<UserProvider>();
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
|
||||
return AnimatedPadding(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
padding: MediaQuery.of(context).viewInsets,
|
||||
child: SingleChildScrollView(
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('基本信息', style: Theme.of(context).textTheme.titleLarge),
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.arrow_back, color: colors.primary),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: _buildFormBuilder(provider),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user