builder: (context, child) {
return Theme(
data: Theme.of(context).copyWith(
colorScheme: const ColorScheme.light(
primary: Colors.white,
onPrimary: Colors.black,
),
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
foregroundColor: Colors.black,
),
),
),
child: child!,
);
},

這是我的代碼。我想讓標題變白。但是當標題為白色時該按鈕不可見。我應該怎么辦?
uj5u.com熱心網友回復:
今天的顏色是colorScheme.primary白色的,我們看不見。
final Color todayColor = colorScheme.primary;
.....
} else if (isToday) {
// The current day gets a different text color and a circle stroke
// border.
dayColor = todayColor;
decoration = BoxDecoration(
border: Border.all(color: todayColor),
shape: BoxShape.circle,
);
}
你可以檢查calendar_date_picker.dart
現在,我可以考慮創建一個本地檔案并自定義顏色,或者更改選擇器顏色。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/537203.html
