factor:布局颜色重构
This commit is contained in:
@@ -49,17 +49,9 @@ class _HomePage extends State<HomePage> {
|
||||
)
|
||||
],
|
||||
),
|
||||
backgroundColor: Color(0xFFF5F5F5),
|
||||
// backgroundColor: Color(0xFFF5F5F5),
|
||||
drawer: SettingsDrawer(),
|
||||
body: Padding(padding: EdgeInsets.all(4), child: tabPages[_currentIndex]),
|
||||
// floatingActionButton: FloatingActionButton(
|
||||
// backgroundColor: Theme.of(context).colorScheme.primary,
|
||||
// onPressed: () => buildBottomSheet(context),
|
||||
// shape: const CircleBorder(),
|
||||
// mini: true,
|
||||
// child: const Icon(Icons.add, color: Colors.white, size: 30),
|
||||
// ),
|
||||
// floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||
body: Padding(padding: EdgeInsets.all(10), child: tabPages[_currentIndex]),
|
||||
bottomNavigationBar: buildBottomNavBar(
|
||||
currentIndex: _currentIndex,
|
||||
onTap: (index) {
|
||||
|
||||
@@ -79,9 +79,10 @@ class _MomentPageState extends State<MomentPage> {
|
||||
void _scrollToTop() => scrollToTopAnimateTo(_scrollController);
|
||||
|
||||
Widget _buildMomentList(FoodProvider provider) {
|
||||
return ListView.builder(
|
||||
return ListView.separated(
|
||||
controller: _scrollController,
|
||||
itemCount: provider.momentList.length,
|
||||
separatorBuilder: (context, index) => SizedBox(height: 8),
|
||||
itemBuilder: (context, index) {
|
||||
return MomentCard(moment: provider.momentList[index]);
|
||||
},
|
||||
|
||||
@@ -143,7 +143,7 @@ class _MomentFormPageState extends State<MomentFormPage> {
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(5),
|
||||
child: buildCard(context: context, child: _buildFormBuilder()),
|
||||
child: BuildCard(child: _buildFormBuilder()),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -55,9 +55,8 @@ class _RecipeDetailState extends State<RecipeDetailPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text('菜谱信息')),
|
||||
backgroundColor: Color(0xFFF5F5F5),
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(padding: EdgeInsets.all(5), child: _buildRecipeDetail()),
|
||||
child: Padding(padding: EdgeInsets.all(10), child: _buildRecipeDetail()),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -67,12 +66,14 @@ class _RecipeDetailState extends State<RecipeDetailPage> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
_buildTitleSection(),
|
||||
SizedBox(height: 8),
|
||||
_buildInfoCard(
|
||||
context,
|
||||
icon: Icons.info,
|
||||
title: "基础信息",
|
||||
content: buildTag(context, recipe.category),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
_buildInfoCard(
|
||||
context,
|
||||
icon: Icons.shopping_cart,
|
||||
@@ -86,6 +87,7 @@ class _RecipeDetailState extends State<RecipeDetailPage> {
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
_buildInfoCard(
|
||||
context,
|
||||
icon: Icons.list,
|
||||
@@ -95,6 +97,7 @@ class _RecipeDetailState extends State<RecipeDetailPage> {
|
||||
recipe.stepList.map((step) => _buildStepSection(step)).toList(),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
_buildInfoCard(
|
||||
context,
|
||||
icon: Icons.note,
|
||||
@@ -183,8 +186,7 @@ class _RecipeDetailState extends State<RecipeDetailPage> {
|
||||
required String title,
|
||||
required Widget content,
|
||||
}) {
|
||||
return buildCard(
|
||||
context: context,
|
||||
return BuildCard(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
||||
@@ -297,11 +297,10 @@ class _RecordFormPageState extends State<RecordFormPage> {
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
),
|
||||
backgroundColor: const Color(0xFFF5F5F5),
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(5),
|
||||
child: buildCard(context: context, child: _buildFormBuilder()),
|
||||
padding: EdgeInsets.all(10),
|
||||
child: BuildCard(child: _buildFormBuilder()),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -31,8 +31,8 @@ class _StatsPage extends State<StatsPage> {
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
// 禁用网格自身滚动
|
||||
crossAxisCount: 2,
|
||||
// crossAxisSpacing: 5,
|
||||
// mainAxisSpacing: 5,
|
||||
crossAxisSpacing: 8,
|
||||
mainAxisSpacing: 8,
|
||||
childAspectRatio: 2,
|
||||
children: [
|
||||
StatisticCard(
|
||||
@@ -121,23 +121,20 @@ class _StatsPage extends State<StatsPage> {
|
||||
return Column(
|
||||
children: [
|
||||
_buildSummaryStats(provider),
|
||||
SizedBox(height: 8),
|
||||
SizedBox(
|
||||
height: chartHeight,
|
||||
child: buildCard(
|
||||
context: context,
|
||||
child: _buildRecordStats(provider),
|
||||
),
|
||||
child: BuildCard(child: _buildRecordStats(provider)),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
SizedBox(
|
||||
height: chartHeight,
|
||||
child: buildCard(
|
||||
context: context,
|
||||
child: _buildCategoryStats(provider),
|
||||
),
|
||||
child: BuildCard(child: _buildCategoryStats(provider)),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
SizedBox(
|
||||
height: chartHeight,
|
||||
child: buildCard(context: context, child: _buildRankStats(provider)),
|
||||
child: BuildCard(child: _buildRankStats(provider)),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user