factor:布局颜色重构
This commit is contained in:
@@ -62,16 +62,16 @@ class _RecipeCalendarState extends State<RecipeCalendar> {
|
||||
if (provider.selectRecordList.isEmpty)
|
||||
buildEmptyData()
|
||||
else
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
itemCount: provider.selectRecordList.length,
|
||||
itemBuilder: (context, index) {
|
||||
return _buildRecordItem(
|
||||
context,
|
||||
provider.selectRecordList[index],
|
||||
);
|
||||
},
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: provider.selectRecordList.length,
|
||||
itemBuilder: (context, index) {
|
||||
return _buildRecordItem(
|
||||
context,
|
||||
provider.selectRecordList[index],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -188,13 +188,9 @@ class _RecipeCalendarState extends State<RecipeCalendar> {
|
||||
Widget _buildContent(FoodProvider provider) {
|
||||
return Column(
|
||||
children: [
|
||||
buildCard(context: context, child: _recipeCalendar(provider)),
|
||||
Expanded(
|
||||
child: buildCard(
|
||||
context: context,
|
||||
child: _dailyItem(context, provider),
|
||||
),
|
||||
),
|
||||
BuildCard(child: _recipeCalendar(provider)),
|
||||
SizedBox(height: 8),
|
||||
Expanded(child: BuildCard(child: _dailyItem(context, provider))),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -81,8 +81,7 @@ class RecipeCard extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
return buildCard(
|
||||
context: context,
|
||||
return BuildCard(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
||||
@@ -83,8 +83,9 @@ class _RecipeListState extends State<RecipeList> {
|
||||
_buildSelectCategory(provider),
|
||||
SizedBox(height: 5),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
child: ListView.separated(
|
||||
itemCount: provider.recipeSummaryList.length,
|
||||
separatorBuilder: (context, index) => SizedBox(height: 8),
|
||||
itemBuilder: (context, index) {
|
||||
return RecipeCard(recipe: provider.recipeSummaryList[index]);
|
||||
},
|
||||
|
||||
@@ -16,8 +16,7 @@ class RecipeTimeline extends StatefulWidget {
|
||||
|
||||
class _RecipeTimeline extends State<RecipeTimeline> {
|
||||
Widget buildTimelineCard(BuildContext context, FoodRecord record) {
|
||||
return buildCard(
|
||||
context: context,
|
||||
return BuildCard(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -69,7 +68,10 @@ class _RecipeTimeline extends State<RecipeTimeline> {
|
||||
);
|
||||
},
|
||||
contentsBuilder: (context, index) {
|
||||
return buildTimelineCard(context, recordList[index]);
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
child: buildTimelineCard(context, recordList[index]),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user