feat:更新编辑菜谱功能
This commit is contained in:
@@ -1,19 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_common/utils/sp_utils.dart';
|
||||
import 'package:flutter_common/widget/common_widget.dart';
|
||||
import 'package:flutter_common/widget/dialog_widget.dart';
|
||||
import 'package:food_hub_app/models/session.dart';
|
||||
import 'package:food_hub_app/provider/app_provider.dart';
|
||||
import 'package:food_hub_app/provider/user_provider.dart';
|
||||
import 'package:food_hub_app/widgets/common/index.dart';
|
||||
import 'package:food_hub_app/widgets/moment/list.dart';
|
||||
import 'package:food_hub_app/widgets/profile/basic_info.dart';
|
||||
import 'package:food_hub_app/widgets/recipe/calendar.dart';
|
||||
import 'package:food_hub_app/widgets/recipe/list.dart';
|
||||
import 'package:food_hub_app/widgets/recipe/timeline.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
enum ProfileTab {
|
||||
profile('基础信息'),
|
||||
moment('朋友圈'),
|
||||
recipe('菜谱');
|
||||
|
||||
@@ -30,7 +25,7 @@ class ProfileUserPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class ProfileUserPageState extends State<ProfileUserPage> {
|
||||
late ProfileTab currentTab = ProfileTab.moment;
|
||||
late ProfileTab currentTab = ProfileTab.profile;
|
||||
|
||||
void _onTabChange(ProfileTab tab) {
|
||||
setState(() {
|
||||
@@ -60,10 +55,6 @@ class ProfileUserPageState extends State<ProfileUserPage> {
|
||||
Widget _buildContent(UserProvider provider) {
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: ProfileInfo(user: provider.currentUser),
|
||||
),
|
||||
_buildTabs(
|
||||
context: context,
|
||||
currentTab: currentTab,
|
||||
@@ -73,6 +64,9 @@ class ProfileUserPageState extends State<ProfileUserPage> {
|
||||
child: IndexedStack(
|
||||
index: currentTab.index,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: double.infinity, child: ProfileInfo(user: provider.currentUser)
|
||||
),
|
||||
MomentList(momentList: provider.momentList, isUser: false),
|
||||
RecipeList(userId: provider.currentUser.id!),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user