feat:增加主题色模块

This commit is contained in:
2025-11-21 17:15:40 +08:00
parent 41fe9d6a24
commit 1ac504f3d7
15 changed files with 609 additions and 321 deletions

View File

@@ -43,7 +43,7 @@ class BuildCard extends StatelessWidget {
borderRadius: BorderRadius.circular(12),
// border: Border.all(color: colors.outline.withAlpha(50), width: 1),
),
padding: const EdgeInsets.all(16),
padding: const EdgeInsets.all(10),
child: child,
);
}
@@ -62,16 +62,18 @@ Widget buildToggleSwitch<T extends Enum>({
required List<String> labels,
required ValueChanged<T> onTabChanged,
}) {
final colors = Theme.of(context).colorScheme;
return ToggleSwitch(
minWidth: 90.0,
minHeight: 40.0,
initialLabelIndex: tabValues.indexOf(currentTab),
totalSwitches: tabValues.length,
labels: labels,
activeBgColor: [Theme.of(context).colorScheme.primary],
activeBgColor: [colors.primary],
activeFgColor: Colors.white,
inactiveBgColor: Colors.grey.shade200,
inactiveFgColor: Colors.grey.shade700,
inactiveBgColor: colors.surfaceContainer,
inactiveFgColor: colors.onSurface,
cornerRadius: 12.0,
customTextStyles: [TextStyle(fontSize: 12, fontWeight: FontWeight.w500)],
onToggle: (index) {
@@ -111,7 +113,7 @@ Widget buildTag(BuildContext context, String title) {
return Container(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4),
decoration: BoxDecoration(
color: Color.lerp(colors.primary, Colors.white, 0.8),
color: colors.primary.withAlpha(60),
borderRadius: BorderRadius.circular(10),
),
child: Text(title, style: TextStyle(color: colors.primary)),