【发布时间】:2022-01-10 20:41:01
【问题描述】:
有一个 animated_theme_switcher 打包并分配了一个代码来改变切换后的图标,但它没有改变..需要什么代码? 请帮助..我将不胜感激 我的代码:
Container(
margin: const EdgeInsets.only(
),
child: ThemeSwitcher(
clipper: const ThemeSwitcherCircleClipper(),
builder: (context)
{
return IconButton(
onPressed: () async {
var themeName =
ThemeModelInheritedNotifier
.of(context)
.theme
.brightness ==
Brightness.light
? 'dark'
: 'light';
var service = await ThemeService.instance
..save(themeName);
var theme = service.getByName(themeName);
ThemeSwitcher.of(context).changeTheme(theme: theme);
},
icon: Icon(ThemeModelInheritedNotifier
.of(context)
.theme == Brightness.light ? Icons.light_mode_outlined : Icons.dark_mode_outlined),
);
},
),
),
【问题讨论】:
标签: flutter animation button icons themes