upgrade: new version syntax

This commit is contained in:
guozhigq
2024-06-08 13:29:36 +08:00
parent 57b8ebfa6f
commit f4b7f77e44
28 changed files with 52 additions and 56 deletions

View File

@ -70,9 +70,9 @@ class _SetSwitchItemState extends State<SetSwitchItem> {
alignment: Alignment.centerRight, // 缩放Switch的大小后保持右侧对齐, 避免右侧空隙过大
scale: 0.8,
child: Switch(
thumbIcon: MaterialStateProperty.resolveWith<Icon?>(
(Set<MaterialState> states) {
if (states.isNotEmpty && states.first == MaterialState.selected) {
thumbIcon:
WidgetStateProperty.resolveWith<Icon?>((Set<WidgetState> states) {
if (states.isNotEmpty && states.first == WidgetState.selected) {
return const Icon(Icons.done);
}
return null; // All other states will use the default thumbIcon.