factor:布局颜色重构
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:blog_app/utils/index.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:blog_app/provider/blog.dart';
|
||||
import 'package:blog_app/widget/blog.dart';
|
||||
@@ -131,29 +132,35 @@ class StatsPageState extends State<StatsPage> {
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
childAspectRatio: 2,
|
||||
mainAxisSpacing: 8,
|
||||
crossAxisSpacing: 8,
|
||||
children: [
|
||||
buildStatsCard(
|
||||
icon: Icons.article,
|
||||
context: context,
|
||||
title: '博客数量',
|
||||
count: provider.overviewStats.blogCount,
|
||||
count: provider.overviewStats.blogCount.toString(),
|
||||
unit: '篇',
|
||||
),
|
||||
buildStatsCard(
|
||||
icon: Icons.folder,
|
||||
context: context,
|
||||
title: '分类数量',
|
||||
count: provider.overviewStats.categoryCount,
|
||||
count: provider.overviewStats.categoryCount.toString(),
|
||||
unit: '个',
|
||||
),
|
||||
buildStatsCard(
|
||||
icon: Icons.remove_red_eye,
|
||||
context: context,
|
||||
title: '访问量',
|
||||
count: provider.overviewStats.visitCount,
|
||||
count: formatChineseDecimal(provider.overviewStats.visitCount),
|
||||
unit: '次',
|
||||
),
|
||||
buildStatsCard(
|
||||
icon: Icons.text_fields,
|
||||
context: context,
|
||||
title: '总字数',
|
||||
count: provider.overviewStats.wordCount,
|
||||
count: formatChineseDecimal(provider.overviewStats.wordCount),
|
||||
unit: '字',
|
||||
),
|
||||
],
|
||||
@@ -181,44 +188,32 @@ class StatsPageState extends State<StatsPage> {
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
const SizedBox(height: 8),
|
||||
_buildBlogStatsGrid(provider),
|
||||
const SizedBox(height: 6),
|
||||
const SizedBox(height: 8),
|
||||
SizedBox(
|
||||
height: chartHeight,
|
||||
child: buildCard(
|
||||
context: context,
|
||||
child: _buildApprovedStats(provider),
|
||||
),
|
||||
child: BuildCard(child: _buildApprovedStats(provider)),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
const SizedBox(height: 8),
|
||||
SizedBox(
|
||||
height: chartHeight,
|
||||
child: buildCard(context: context, child: _buildVisitStats(provider)),
|
||||
child: BuildCard(child: _buildVisitStats(provider)),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
const SizedBox(height: 8),
|
||||
SizedBox(
|
||||
height: chartHeight,
|
||||
child: buildCard(
|
||||
context: context,
|
||||
child: _buildVisitRankStats(provider),
|
||||
),
|
||||
child: BuildCard(child: _buildVisitRankStats(provider)),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
const SizedBox(height: 8),
|
||||
SizedBox(
|
||||
height: chartHeight,
|
||||
child: buildCard(
|
||||
context: context,
|
||||
child: _buildCategoryStats(provider),
|
||||
),
|
||||
child: BuildCard(child: _buildCategoryStats(provider)),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
const SizedBox(height: 8),
|
||||
SizedBox(
|
||||
height: chartHeight,
|
||||
child: buildCard(
|
||||
context: context,
|
||||
child: _buildReadRankStats(provider),
|
||||
),
|
||||
child: BuildCard(child: _buildReadRankStats(provider)),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -233,8 +228,8 @@ class StatsPageState extends State<StatsPage> {
|
||||
if (blogProvider.isLoading)
|
||||
buildLoadingIndicator()
|
||||
else
|
||||
SingleChildScrollView(child: _buildContent(blogProvider))
|
||||
]
|
||||
SingleChildScrollView(child: _buildContent(blogProvider)),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user