英文:
Flutter date range picker's in between color won't change
问题
我有一个使用showDateRangePicker
选择日期范围的Flutter应用程序。但是,当我选择一个范围时,选定日期之间的颜色变成了青色。我猜想这是标准应用程序颜色之一,因为我自己没有选择青色,但我似乎找不到正确的颜色,以便我可以更改它。
有人能帮帮我吗?
我已经更改了colorScheme
内的每个颜色,但它没有改变范围的颜色。
英文:
I have a Flutter app that uses showDateRangePicker
to pick a date range. When I pick a range, though, the color in between the picked dates is somehow cyan. I'm assuming it's one of the standard application colors since I haven't selected cyan anywhere myself, but I can't seem to find the right one so I can change it.
Someone please help me out!
I've changed every color inside of colorScheme
and it did not change the color of the range.
答案1
得分: 0
在你的主题中设置一个datePickerTheme,并覆盖rangeSelectionBackgroundColor:
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
datePickerTheme: const DatePickerThemeData(
rangeSelectionBackgroundColor: Colors.red),
useMaterial3: true,
),
英文:
Set inside your theme a datePickerTheme and overwrite the rangeSelectionBackgroundcolor:
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
datePickerTheme: const DatePickerThemeData(
rangeSelectionBackgroundColor: Colors.red),
useMaterial3: true,
),
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论