Skip to main content
Reown Docs

Theming

1 min read

To theme the AppKitModal, you must wrap your MaterialApp with a ReownAppKitModalTheme widget.

Default themes#

ReownAppKitModalTheme already comes with 2 default themes.
A light option: ReownAppKitModalColors.lightMode
A dark option: ReownAppKitModalColors.darkMode.
You can switch between them by toggling the isDarkMode: parameter in ReownAppKitModalTheme like so:

You can check the Flutter documentation here to learn how to listen to device's theme changes

Custom themes#

You can define your own light and dark themes by tweaking ReownAppKitModalThemeData parameters. For instance, if you want to change the main foreground and background color you could do:

and pass this object to the ReownAppKitModalTheme's themeData: parameter:

Preset theme shortcuts#

ReownAppKitModalTheme comes with default border radiuses but you can override these values by passing your own values to ReownAppKitModalRadiuses() object and then adding this object to ReownAppKitModalThemeData's radiuses: parameter.

But you can also set no corner radiuses at all by setting this value to ReownAppKitModalRadiuses.square or everything circular by using ReownAppKitModalRadiuses.circular

Note

If you don't wrap your MaterialApp with a ReownAppKitModalTheme widget, the ReownAppKitModal will use the default light theme.

ReownAppKitModalTheme is an InheritedWidget, so it comes with a few handy methods for you to use:

Check if the current time is dark:

Get current ReownAppKitModalThemeData object:

Get current ReownAppKitModalColors object:

You can build your own theme by creating a ReownAppKitModalThemeData object. (More and easier customization options will come in the future)