title: How to manually set dark mode in flutter using ThemeData in Flutter?
body: <p>How to manually set dark mode in flutter using ThemeData in Flutter?</p>
  <p>I am currently using ThemeData to handle my darkMode events:</p>
  <pre><code>class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'App',
        themeMode: ThemeMode.system,
        theme: MainTheme.light,
        darkTheme: MainTheme.dark,
        home: HomeScreen(),
        debugShowCheckedModeBanner: false,
      );
    }
  }
  </code></pre>
  <p>I wanted to know, how to turn on dark mode manually in Flutter when I see a specific widget?
  In every Widget I make, I use this code to create a variable that checks if dark mode is activated or not so I can manually manage the colors:</p>
  <pre><code>var brightness = MediaQuery.of(context).platformBrightness;
  darkModeOn = brightness == Brightness.dark;
  </code></pre>