feat:增加用户信息编辑功能
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:flutter_common/widget/common_widget.dart';
|
||||
import 'package:flutter_common/widget/dialog_widget.dart';
|
||||
import 'package:food_hub_app/provider/app_provider.dart';
|
||||
import 'package:food_hub_app/provider/user_provider.dart';
|
||||
import 'package:food_hub_app/views/profile_form.dart';
|
||||
import 'package:food_hub_app/widgets/profile/basic_info.dart';
|
||||
import 'package:liquid_glass_widgets/liquid_glass_widgets.dart';
|
||||
import 'package:liquid_glass_widgets/widgets/containers/glass_card.dart';
|
||||
@@ -42,11 +43,26 @@ class ProfilePageState extends State<ProfilePage> {
|
||||
);
|
||||
}
|
||||
|
||||
void _onTapInfo(UserProvider provider) {
|
||||
provider.initUserForm(provider.currentUser);
|
||||
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
isScrollControlled: true,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
|
||||
),
|
||||
builder: (context) => ProfileForm(),
|
||||
);
|
||||
}
|
||||
|
||||
void _onTapMoment() {
|
||||
Navigator.pushNamed(context, '/momentUser');
|
||||
}
|
||||
|
||||
Widget _buildFunctionButtons(BuildContext context) {
|
||||
final provider = context.watch<UserProvider>();
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
|
||||
return GlassCard(
|
||||
@@ -58,10 +74,7 @@ class ProfilePageState extends State<ProfilePage> {
|
||||
_buildFunctionButton(
|
||||
icon: Icons.account_circle,
|
||||
text: '基本资料',
|
||||
onTap: () {
|
||||
// 跳转到编辑资料页面
|
||||
// LogUtils.i('点击编辑资料');
|
||||
},
|
||||
onTap: () => _onTapInfo(provider),
|
||||
),
|
||||
const Divider(height: 1, thickness: 0.2),
|
||||
_buildFunctionButton(
|
||||
@@ -155,8 +168,6 @@ class ProfilePageState extends State<ProfilePage> {
|
||||
children: [
|
||||
if (provider.isLoading)
|
||||
buildLoadingIndicator()
|
||||
else if (provider.error.isNotEmpty)
|
||||
Text(provider.error)
|
||||
else
|
||||
SingleChildScrollView(
|
||||
padding: const EdgeInsets.only(bottom: 90),
|
||||
|
||||
Reference in New Issue
Block a user