build method

  1. @override
Widget build(
  1. BuildContext context,
  2. WidgetRef ref,
  3. ThemeSwitcherNotifier notifier,
  4. ThemeMode state,
)
override

Implementation

@override
Widget build(
  BuildContext context,
  WidgetRef ref,
  ThemeSwitcherNotifier notifier,
  ThemeMode state,
) {
  return IconButton(
    onPressed: () => notifier.switchTheme(
      state == ThemeMode.light ? ThemeMode.dark : ThemeMode.light,
    ),
    icon: Icon(state == ThemeMode.light ? PhosphorIcons.sun() : PhosphorIcons.moon()),
  );
}