radioThemeData static method
RadioThemeData
radioThemeData(
- Palette colors
)
Implementation
static RadioThemeData radioThemeData(Palette colors) {
// States have choices that look odd compared to other components.
// This component is particularly challenging due to it being essentially
// a fill with a circle surrounding it for hover state. These were
// picked thoughtfully.
return RadioThemeData(
fillColor: WidgetStateProperty.resolveWith((Set<WidgetState> states) {
if (states.contains(WidgetState.hovered)) {
return colors.textHoveredText;
}
if (states.contains(WidgetState.selected)) {
return colors.text;
}
return colors.text;
}),
overlayColor: WidgetStateProperty.resolveWith((Set<WidgetState> states) {
return colors.textHovered;
}),
splashRadius: 20.0, // match checkbox default,
materialTapTargetSize: null, // let Theme manage it
visualDensity: null, // let Theme manage it
);
}