diff --git a/lib/views/more/settings/appearance/dark_mode_button.dart b/lib/views/more/settings/appearance/dark_mode_button.dart index b53ddad3..cb020f48 100644 --- a/lib/views/more/settings/appearance/dark_mode_button.dart +++ b/lib/views/more/settings/appearance/dark_mode_button.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:mangayomi/views/more/settings/appearance/thememode_provider.dart'; -import 'package:rive/rive.dart'; +// import 'package:rive/rive.dart'; class DarkModeButton extends ConsumerStatefulWidget { const DarkModeButton({ @@ -13,40 +13,50 @@ class DarkModeButton extends ConsumerStatefulWidget { } class _DarkModeButtonState extends ConsumerState { - SMIBool? _bump; + // SMIBool? _bump; - void _onRiveInit(Artboard artboard) { - final controller = - StateMachineController.fromArtboard(artboard, 'State Machine 1'); - artboard.addController(controller!); - _bump = controller.findInput('isDark') as SMIBool; - _bump?.value = !ref.watch(themeModeProvider); - } + // void _onRiveInit(Artboard artboard) { + // final controller = + // StateMachineController.fromArtboard(artboard, 'State Machine 1'); + // artboard.addController(controller!); + // _bump = controller.findInput('isDark') as SMIBool; + // _bump?.value = !ref.watch(themeModeProvider); + // } - void _hitBump(bool value) => _bump?.value = value; + // void _hitBump(bool value) => _bump?.value = value; @override Widget build(BuildContext context) { bool isLight = ref.watch(themeModeProvider); - _hitBump(!isLight); + // _hitBump(!isLight); return ListTile( - onTap: () { - if (!isLight == true) { - ref.read(themeModeProvider.notifier).setLightTheme(); - } else { - ref.read(themeModeProvider.notifier).setDarkTheme(); - } - }, - title: const Text("Theme mode"), - subtitle: Text(ref.watch(themeModeProvider) ? 'Light' : 'Dark'), - trailing: SizedBox( - height: 80, - width: 80, - child: RiveAnimation.asset( - 'assets/switch.riv', - onInit: _onRiveInit, - ), - ), - ); + onTap: () { + if (!isLight == true) { + ref.read(themeModeProvider.notifier).setLightTheme(); + } else { + ref.read(themeModeProvider.notifier).setDarkTheme(); + } + }, + title: const Text("Theme mode"), + subtitle: Text(ref.watch(themeModeProvider) ? 'Light' : 'Dark'), + trailing: Switch( + value: !isLight, + onChanged: (dd) { + if (!isLight == true) { + ref.read(themeModeProvider.notifier).setLightTheme(); + } else { + ref.read(themeModeProvider.notifier).setDarkTheme(); + } + }) + + // SizedBox( + // height: 80, + // width: 80, + // child: RiveAnimation.asset( + // 'assets/switch.riv', + // onInit: _onRiveInit, + // ), + // ), + ); } }