feat:增加主题颜色和暗黑模式
This commit is contained in:
@@ -11,7 +11,7 @@ Widget buildStatsCard(List<Flisp> flisps) {
|
||||
int workCount = flisps.where((flisp) => flisp.tag == FlispTag.work).length;
|
||||
int studyCount = flisps.where((flisp) => flisp.tag == FlispTag.study).length;
|
||||
|
||||
return buildCard(
|
||||
return BuildCard(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
@@ -42,6 +42,7 @@ Widget _buildStatItem(String label, int count, Color color) {
|
||||
}
|
||||
|
||||
Widget buildTabs({
|
||||
required BuildContext context,
|
||||
required FlispTab currentTab,
|
||||
required ValueChanged<FlispTab> onTabChanged,
|
||||
}) {
|
||||
@@ -53,7 +54,7 @@ Widget buildTabs({
|
||||
initialLabelIndex: FlispTab.values.indexOf(currentTab),
|
||||
totalSwitches: FlispTab.values.length,
|
||||
labels: FlispTab.values.map((e) => e.label).toList(),
|
||||
activeBgColor: [Colors.orange.shade600],
|
||||
activeBgColor: [Theme.of(context).colorScheme.primary],
|
||||
activeFgColor: Colors.white,
|
||||
inactiveBgColor: Colors.grey.shade200,
|
||||
inactiveFgColor: Colors.grey.shade700,
|
||||
@@ -89,11 +90,15 @@ Widget buildFlispList({
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildFlispContent(Flisp flisp) {
|
||||
Widget _buildFlispContent(BuildContext context, Flisp flisp) {
|
||||
return RichText(
|
||||
text: TextSpan(
|
||||
text: flisp.content,
|
||||
style: const TextStyle(color: Colors.black87, fontSize: 16),
|
||||
style: TextStyle(
|
||||
fontFamily: 'CustomFont',
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -281,15 +286,13 @@ Widget _buildFlispItem({
|
||||
onDismissed: (direction) {
|
||||
onDelete(flisp);
|
||||
},
|
||||
child: Container(
|
||||
decoration: buildBoxDecoration(),
|
||||
padding: EdgeInsets.all(16),
|
||||
child: BuildCard(
|
||||
child: InkWell(
|
||||
onTap: () => onEdit(flisp),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildFlispContent(flisp),
|
||||
_buildFlispContent(context, flisp),
|
||||
const SizedBox(height: 8),
|
||||
if (hasImage) buildFlispImage(flisp: flisp, showDelete: false),
|
||||
const SizedBox(height: 4),
|
||||
@@ -337,16 +340,19 @@ Widget _buildDismissBackground() {
|
||||
}
|
||||
|
||||
// 空状态
|
||||
Widget buildEmptyState() {
|
||||
Widget buildEmptyState(BuildContext context) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.flash_on, size: 80, color: Colors.orange.shade600),
|
||||
Icon(Icons.flash_on, size: 80, color: colors.primary),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
'📝 还没有闪灵\n点击➕号添加第一个灵感吧~',
|
||||
'📝 还没有该类别闪灵\n点击➕号添加第一个灵感吧~',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.orange.shade600),
|
||||
style: TextStyle(color: colors.onSurface, fontSize: 16),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user