A theme changing package for flutter created on provider package


  • Provides a super simple way to provide theme for your flutter app.
  • Will save and apply your user's last theme they had set.
  • You can provide your own custom ThemeData

Getting started

Just install a package it gives you the ability to change theme on the fly.


Provide the ThemeProvider() class by a ChangeNotifierProvider to your MaterialApp

Usage: Just use theme: theme.getTheme() in your material app's theme parameter. () Don't forget to wrap material app with a Consumer<ThemeProvider>

to /example folder.


At your MaterialApp()

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
            create: (context) =>
                ThemeProvider(defaultThemeName: "Light", themes: [
                  {"Light": ThemeData.light()},
                  {"Dark": ThemeData.dark()}
      child: Consumer<ThemeProvider>(
        builder: (context, theme, child) => MaterialApp(
          home: ThemeChangeScreen(),
          theme: theme.getTheme(),

Where you want to provide theme changing option

          builder: (context, theme, child) => PopupMenuButton<dynamic>(
            offset: Offset(100, 0),
            child: ListTile(
              leading: const Icon(Icons.brush),
              title: const Text(
                style: TextStyle(fontFamily: "Poppins"),
              subtitle: Text(
                style: TextStyle(fontFamily: "Poppins"),
              trailing: Icon(Icons.edit),
            itemBuilder: (context) => theme.getThemeNames
                .map((item) => PopupMenuItem(
                      value: item,
                      child: Text(item),
                      onTap: () => theme.setTheme(item),

Parameters of ThemeProvider()

Example with all parameters

    ThemeProvider(defaultThemeName: "Light", themes: [
        {"Light": ThemeData.light()},
        {"Dark": ThemeData.dark()}

Parameter's description

String defaultThemeName required named

themes: List<Map<String, ThemeData>> Provide your theme data in a list of map, where key is the Theme Name and value is the theme data. (This name is used to reffer the themes)

Additional information

If you want to contribute to the project please go to our github repo GitHub