upgrade: new version syntax

This commit is contained in:
guozhigq
2024-06-08 13:29:36 +08:00
parent 872a873d68
commit 2fbd1045db
28 changed files with 52 additions and 56 deletions

View File

@ -240,10 +240,10 @@ class _ExtraSettingState extends State<ExtraSetting> {
alignment: Alignment.centerRight,
scale: 0.8,
child: Switch(
thumbIcon: MaterialStateProperty.resolveWith<Icon?>(
(Set<MaterialState> states) {
thumbIcon: WidgetStateProperty.resolveWith<Icon?>(
(Set<WidgetState> states) {
if (states.isNotEmpty &&
states.first == MaterialState.selected) {
states.first == WidgetState.selected) {
return const Icon(Icons.done);
}
return null; // All other states will use the default thumbIcon.