feat:更新主题色有些失效的场景

This commit is contained in:
2025-11-11 21:40:07 +08:00
parent 741d6842b8
commit 4960158dcc
5 changed files with 47 additions and 38 deletions

View File

@@ -32,13 +32,14 @@ class _TodoFormState extends State<TodoForm> {
final int maxTitleCount = 10;
final int maxContentCount = 20;
final provider = Provider.of<TodoProvider>(context);
final colors = Theme.of(context).colorScheme;
Widget buildTitle() {
return Row(
children: [
Icon(
widget.isEditing ? Icons.edit_note : Icons.add_task,
color: Theme.of(context).primaryColor,
color: colors.primary,
size: 24,
),
SizedBox(width: 8),
@@ -47,7 +48,7 @@ class _TodoFormState extends State<TodoForm> {
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Theme.of(context).primaryColor,
color: colors.primary,
),
),
],
@@ -67,10 +68,7 @@ class _TodoFormState extends State<TodoForm> {
label: RichText(
text: TextSpan(
text: '标题',
style: TextStyle(
color: Colors.grey.shade700,
fontSize: 16,
),
style: TextStyle(color: Colors.grey.shade700, fontSize: 16),
children: const [
TextSpan(
text: '*',
@@ -96,10 +94,10 @@ class _TodoFormState extends State<TodoForm> {
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: Colors.orange),
borderSide: BorderSide(color: colors.primary),
),
filled: true,
fillColor: Colors.white,
fillColor: colors.surface,
prefixIcon: Icon(Icons.title, color: Colors.blue),
contentPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 14),
),
@@ -140,10 +138,10 @@ class _TodoFormState extends State<TodoForm> {
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: Colors.orange),
borderSide: BorderSide(color: colors.primary),
),
filled: true,
fillColor: Colors.white,
fillColor: colors.surface,
prefixIcon: Icon(Icons.description, color: Colors.green),
contentPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 14),
),
@@ -203,10 +201,10 @@ class _TodoFormState extends State<TodoForm> {
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: Colors.orange),
borderSide: BorderSide(color: colors.primary),
),
filled: true,
fillColor: Colors.white,
fillColor: colors.surface,
contentPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 14),
suffixIcon:
provider.formItem.dueDate != null
@@ -268,10 +266,10 @@ class _TodoFormState extends State<TodoForm> {
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: Colors.orange),
borderSide: BorderSide(color: colors.primary),
),
filled: true,
fillColor: Colors.white,
fillColor: colors.surface,
contentPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 14),
suffixIcon:
provider.formItem.scheduledTime != null
@@ -320,7 +318,7 @@ class _TodoFormState extends State<TodoForm> {
Container buildPriorityField() {
return Container(
decoration: BoxDecoration(
color: Colors.white,
color: colors.surface,
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.grey.shade300, width: 1),
),