ChatTheme class abstract
Defines the visual styling for the chat UI.
Includes color scheme, typography, and shape definitions. Uses Freezed for immutable data classes.
- Available extensions
- Annotations
-
- @Freezed.new(fromJson: false, toJson: false)
Constructors
- ChatTheme({required ChatColors colors, required ChatTypography typography, required BorderRadiusGeometry shape})
-
Creates a ChatTheme instance.
constfactory
- ChatTheme.dark({String? fontFamily})
-
Creates a default dark theme.
Optionally specify a
fontFamily.factory - ChatTheme.fromThemeData(ThemeData themeData)
-
Creates a ChatTheme based on a Material ThemeData.
Extracts relevant colors and text styles.
factory
- ChatTheme.light({String? fontFamily})
-
Creates a default light theme.
Optionally specify a
fontFamily.factory
Properties
- colors → ChatColors
-
The color scheme used throughout the chat UI.
no setterinherited
-
copyWith
→ $ChatThemeCopyWith<
ChatTheme> -
Create a copy of ChatTheme
with the given fields replaced by the non-null parameter values.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shape → BorderRadiusGeometry
-
The default border radius for message bubbles only.
no setterinherited
- typography → ChatTypography
-
The text styles used for various elements.
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_ChatTheme value)) → TResult -
Available on ChatTheme, provided by the ChatThemePatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_ChatTheme value)?) → TResult? -
Available on ChatTheme, provided by the ChatThemePatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_ChatTheme value)?, {required TResult orElse()}) → TResult -
Available on ChatTheme, provided by the ChatThemePatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(ChatColors colors, ChatTypography typography, BorderRadiusGeometry shape)?, {required TResult orElse()}) → TResult -
Available on ChatTheme, provided by the ChatThemePatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
merge(
ChatTheme? other) → ChatTheme - Merges this theme with another ChatTheme.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> (TResult $default(ChatColors colors, ChatTypography typography, BorderRadiusGeometry shape)) → TResult -
Available on ChatTheme, provided by the ChatThemePatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(ChatColors colors, ChatTypography typography, BorderRadiusGeometry shape)?) → TResult? -
Available on ChatTheme, provided by the ChatThemePatterns extension
A variant ofwhenthat fallback to returningnull -
withDarkColors(
{Color? primary, Color? onPrimary, Color? surface, Color? onSurface, Color? surfaceContainer, Color? surfaceContainerLow, Color? surfaceContainerHigh}) → ChatTheme -
Available on ChatTheme, provided by the ChatThemeExtensions extension
Creates a copy of the theme with updated dark colors. -
withLightColors(
{Color? primary, Color? onPrimary, Color? surface, Color? onSurface, Color? surfaceContainer, Color? surfaceContainerLow, Color? surfaceContainerHigh}) → ChatTheme -
Available on ChatTheme, provided by the ChatThemeExtensions extension
Creates a copy of the theme with updated light colors.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited