title: Flutter Dark Mode works initially, but once I leave the Drawer it stops
body: <p>I am having an issue with my DarkMode, it only works the first time I click into my Drawer and then it stops after that (see the screen recording) - wondering if someone could take a look and provide any guidance on how to fix this.</p>
  <p>Link to what this looks like: <a href="https://imgur.com/a/Qzv9AsV" rel="nofollow noreferrer">https://imgur.com/a/Qzv9AsV</a></p>
  <pre><code>// main.dart
   Future&lt;void&gt; main() async {
    WidgetsFlutterBinding.ensureInitialized();
    await Settings.init(cacheProvider: SharePreferenceCache());
  
    return runApp(
      ValueChangeObserver&lt;bool&gt;(
        cacheKey: DarkModeWidget.keyDarkMode,
        defaultValue: false,
        builder: (_, isDarkMode, __) =&gt; MaterialApp(
          title: 'Smash Up Companion',
          theme: isDarkMode
              ? ThemeData.dark().copyWith(
                  primaryColor: AppColors.mainGreenColor,
                  scaffoldBackgroundColor: const Color(0xFF170635),
                  canvasColor: const Color(0xFF170635),
                  //primarySwatch: Colors.blue,
                  dividerColor: Colors.white,
                )
              : ThemeData.light().copyWith(
                  primaryColor: AppColors.mainBlueColor,
                  scaffoldBackgroundColor: Colors.white,
                  canvasColor: Colors.white,
                  dividerColor: AppColors.mainBlueColor),
  ...
  }
  
  //Dark Mode class
  class DarkModeWidget extends StatelessWidget {
    static const keyDarkMode = 'key-dark-mode';
    const DarkModeWidget({Key? key}) : super(key: key);
  
    @override
    Widget build(BuildContext context) {
      return SwitchSettingsTile(
        settingKey: keyDarkMode,
        leading: const IconWidget(
          icon: Icons.dark_mode,
          color: Color(0xFF642ef3),
        ),
        title: 'Dark Mode',
        onChange: (_) {},
      );
    }
  }
  </code></pre>