AssistBubbleSettings class

Represents the settings for the assist bubble.

The AssistBubbleSettings class used to store a customization details of request and response bubble and it's elements, that control the appearance and behavior of the assist bubble.

Example:

@override
Widget build(BuildContext context) {
  return SfAIAssistView(
    requestBubbleSettings: const AssistBubbleSettings(
      showUserName: true,
      showTimestamp: true,
      showUserAvatar: true,
      widthFactor: 0.5,
      avatarSize: Size.square(40.0),
      padding: EdgeInsets.all(2.0),
      contentPadding:
          EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
      headerPadding:
          EdgeInsetsDirectional.only(top: 10.0, bottom: 14.0),
      footerPadding: EdgeInsetsDirectional.only(top: 14.0),
    ),
    responseBubbleSettings: const AssistBubbleSettings(
      showUserName: true,
      showTimestamp: true,
      showUserAvatar: true,
      widthFactor: 0.9,
      avatarSize: Size.square(24.0),
      padding: EdgeInsets.all(2.0),
      contentPadding:
          EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
      headerPadding: EdgeInsetsDirectional.only(bottom: 10.0),
      footerPadding: EdgeInsetsDirectional.only(top: 10.0),
    ),
  );
}

Constructors

AssistBubbleSettings({bool showUserName = false, bool showTimestamp = false, bool? showUserAvatar, DateFormat? timestampFormat, TextStyle? textStyle, TextStyle? headerTextStyle, Color? contentBackgroundColor, ShapeBorder? contentShape, double widthFactor = 0.8, Size avatarSize = const Size.square(32.0), EdgeInsetsGeometry? padding, EdgeInsetsGeometry? contentPadding, EdgeInsetsGeometry? avatarPadding, EdgeInsetsGeometry headerPadding = const EdgeInsetsDirectional.only(bottom: 3.0), EdgeInsetsGeometry footerPadding = const EdgeInsetsDirectional.only(top: 4.0)})
const

Properties

avatarPadding EdgeInsetsGeometry?
Determine the padding around the avatar.
final
avatarSize Size
Size of the avatar.
final
contentBackgroundColor Color?
Used to set background color for the request and response bubble content.
final
contentPadding EdgeInsetsGeometry?
It determines a padding around the content with in the message bubble.
final
contentShape ShapeBorder?
To set the custom shape of the request and response bubble.
final
footerPadding EdgeInsetsGeometry
Padding for the footer.
final
hashCode int
The hash code for this object.
no setterinherited
headerPadding EdgeInsetsGeometry
Padding for the header.
final
headerTextStyle TextStyle?
Text style for the header.
final
padding EdgeInsetsGeometry?
Determine padding around the bubble.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showTimestamp bool
The showTimestamp property is to determines whether the time stamp is displayed or not.
final
showUserAvatar bool?
The showUserAvatar property is to determines whether the user avatar is displayed or not.
final
showUserName bool
The showUserName property is to determines whether the user name is displayed or not.
final
textStyle TextStyle?
Text style for the request and response.
final
timestampFormat → DateFormat?
The timestampFormat property specifies the format used for displaying timestamps.
final
widthFactor double
The widthFactor property specifies the proportional width of a bubble.
final

Methods

copyWith({bool? showUserName, bool? showTimestamp, bool? showUserAvatar, DateFormat? timestampFormat, TextStyle? textStyle, TextStyle? headerTextStyle, Color? contentBackgroundColor, ShapeBorder? contentShape, double? widthFactor, Size? avatarSize, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? contentPadding, EdgeInsetsGeometry? avatarPadding, EdgeInsetsGeometry? headerPadding, EdgeInsetsGeometry? footerPadding}) AssistBubbleSettings
Creates a copy of this bubble settings with the given fields replaced by the new values.
mergeWith(AssistBubbleSettings settings) AssistBubbleSettings
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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