BirjuVachhani / adaptive_theme

Easiest way to add support for light and dark theme in your flutter app.
https://pub.dev/packages/adaptive_theme
Apache License 2.0
464 stars 37 forks source link

How to change default light white mode #28

Closed zakblacki closed 2 years ago

zakblacki commented 2 years ago

I don't want to use light mode how do I use my own custom theme color (orange) with dark mode ?

For example this my code

    `AdaptiveTheme(
      light: ThemeData(
        brightness: Brightness.light,
        primarySwatch: Colors.blue,
      ),
      dark: ThemeData(
        brightness: Brightness.dark,
        primarySwatch: Colors.orange,
      ),
      initial: AdaptiveThemeMode.light,
      builder: (theme, darkTheme) => GetMaterialApp(
        debugShowCheckedModeBanner: false,
        theme: theme,
        darkTheme: darkTheme,
        home:  MyHome(),
        ),
        ),

       SwitchListTile(
        activeColor: Colors.orange,
        value: darkmode,
        onChanged: (bool value) {
          print(value);
          if (value == true) {
            AdaptiveTheme.of(context).setDark();
          } else {
            AdaptiveTheme.of(context).setLight();
          }
          setState(() {
            darkmode = value;
          });
        },
        ),`