Chat UIKit Flutter v3
Chat UIKit Flutter
Chat UIKit
Flutter
Version 3

Themes

Copy link

By default, Sendbird UIKit for Flutter provides two themes: Light and Dark.


Setup the default theme

Copy link

UIKit for Flutter's Light or Dark theme can be applied using the SBUThemeProvider().setTheme() method.

Light theme

Copy link

This is the default theme for UIKit if another theme hasn’t been specified.

SBUThemeProvider().setTheme(SBUTheme.light);

Dark theme

Copy link

The Dark theme can be applied as below.

SBUThemeProvider().setTheme(SBUTheme.dark);


Handle dynamic updates

Copy link

To dynamically respond to changes in the theme (such as switching between light and dark themes), you can utilize the ChangeNotifier of the SBUThemeProvider. This setup allows widgets to rebuild automatically whenever the theme changes.

@override
Widget build(BuildContext context) {
  SBUThemeProvider themeProvider = context.watch<SBUThemeProvider>();
  bool isLightTheme = themeProvider.isLight();
}