TencentCloudChatTheme class

A class that manages the theme data for TencentCloudChat .

This class provides a singleton instance to manage the theme data for the entire application. It includes the color theme and text styles for both light and dark modes.

Example usage:

// Initialize the theme data with the current BuildContext
TencentCloudChatTheme.init(context);

// Access the theme data in your widgets
Color primaryColor = TencentCloudChatTheme().colorTheme.primaryColor;
TextStyle textStyle = TencentCloudChatTheme().textStyle.standardText;

Constructors

TencentCloudChatTheme({TencentCloudChatThemeModel? themeMode, Brightness? brightness})
Factory constructor that returns the singleton instance of TencentCloudChatTheme.
factory

Properties

brightness ↔ Brightness?
Getter for the brightness.
getter/setter pair
brightnessWithoutFire ← Brightness?
no getter
colorTheme → TencentCloudChatThemeColors
Getter for the color theme based on the current brightness.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
textStyle → TencentCloudChatTextStyle
Getter for the text style.
no setter
themeModel ↔ TencentCloudChatThemeModel
Getter for the theme model.
getter/setter pair

Methods

getThemeData({required BuildContext context, Brightness? brightness, bool needTextTheme = true, bool needColorScheme = true}) → ThemeData
Returns a ThemeData instance based on the current brightness and configuration.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setTextStyle({required TencentCloudChatTextStyle textStyle}) → void
Sets the global text style
setThemeColors({required Brightness brightness, required TencentCloudChatThemeColors themeColors}) → void
Sets the theme colors for the specified brightness.
toggleBrightnessMode({Brightness? brightness}) → void
Toggles the brightness mode between light and dark.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

init({Brightness? brightness, TencentCloudChatThemeModel? themeModel}) → dynamic
Initializes the theme data with the given BuildContext.