feat:更新好友菜谱功能

This commit is contained in:
2026-06-28 19:54:32 +08:00
parent a340ba424e
commit c10e8e5ffb
13 changed files with 67 additions and 29 deletions

View File

@@ -19,7 +19,7 @@ class LoginPage extends StatefulWidget {
class _LoginPage extends State<LoginPage> {
final GlobalKey _formKey = GlobalKey<FormState>();
String _username = "Cxx0822", _password = "19940822Cxx";
String _username = "", _password = "";
bool _isRemember = false;
bool _isObscure = true;
bool _isLoading = false;

View File

@@ -158,7 +158,10 @@ class ProfilePageState extends State<ProfilePage> {
else if (provider.error.isNotEmpty)
Text(provider.error)
else
SingleChildScrollView(child: _buildContent(provider, context)),
SingleChildScrollView(
padding: const EdgeInsets.only(bottom: 90),
child: _buildContent(provider, context),
),
],
),
),

View File

@@ -74,7 +74,7 @@ class ProfileUserPageState extends State<ProfileUserPage> {
index: currentTab.index,
children: [
MomentList(momentList: provider.momentList, isUser: false),
Text('个人菜谱'),
RecipeList(userId: provider.currentUser.id!),
],
),
),
@@ -91,11 +91,11 @@ class ProfileUserPageState extends State<ProfileUserPage> {
appBar: AppBar(
title: Text(
'${provider.currentUser.username}的个人信息',
style: const TextStyle(color: Colors.white),
style: Theme.of(context).textTheme.titleLarge,
),
backgroundColor: colors.primary,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
leading: IconButton(
icon: const Icon(Icons.arrow_back, color: Colors.white),
icon: Icon(Icons.arrow_back, color: colors.primary),
onPressed: () => Navigator.pop(context),
),
),

View File

@@ -82,8 +82,17 @@ class _RecipeDetailState extends State<RecipeDetailPage> {
@override
Widget build(BuildContext context) {
final colors = Theme.of(context).colorScheme;
return Scaffold(
appBar: AppBar(title: Text('菜谱信息')),
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: Column(
children: [

View File

@@ -36,7 +36,7 @@ class _RecordPageState extends State<RecordPage> {
final ScrollController _scrollController = ScrollController();
bool _showScrollToTop = false;
final List<Widget> _tabPages = [
RecipeList(),
RecipeList(userId: 0),
RecipeCalendar(),
RecipeTimeline(),
];

View File

@@ -40,6 +40,7 @@ class _StatsPage extends State<StatsPage> {
GlassCard(
useOwnLayer: true,
settings: LiquidGlassSettings(glassColor: colors.surface),
padding: EdgeInsetsGeometry.all(10),
child: StatsCard(
icon: Icons.restaurant_menu,
title: '菜谱总数',
@@ -50,6 +51,7 @@ class _StatsPage extends State<StatsPage> {
GlassCard(
useOwnLayer: true,
settings: LiquidGlassSettings(glassColor: colors.surface),
padding: EdgeInsetsGeometry.all(10),
child: StatsCard(
icon: Icons.grid_view_rounded,
title: '菜谱类别',
@@ -60,6 +62,7 @@ class _StatsPage extends State<StatsPage> {
GlassCard(
useOwnLayer: true,
settings: LiquidGlassSettings(glassColor: colors.surface),
padding: EdgeInsetsGeometry.all(10),
child: StatsCard(
icon: Icons.flag,
title: '做菜次数',
@@ -70,6 +73,7 @@ class _StatsPage extends State<StatsPage> {
GlassCard(
useOwnLayer: true,
settings: LiquidGlassSettings(glassColor: colors.surface),
padding: EdgeInsetsGeometry.all(10),
child: StatsCard(
icon: Icons.show_chart,
title: '平均次数',
@@ -116,13 +120,10 @@ class _StatsPage extends State<StatsPage> {
),
),
SizedBox(height: 8),
SizedBox(
height: chartHeight,
child: GlassCard(
useOwnLayer: true,
settings: LiquidGlassSettings(glassColor: colors.surface),
child: RankChart(title: '排行榜', data: provider.rankStats, unit: ''),
),
GlassCard(
useOwnLayer: true,
settings: LiquidGlassSettings(glassColor: colors.surface),
child: RankChart(title: '排行榜', data: provider.rankStats, unit: ''),
),
],
);