ActionItem class
ActionItem is the type of items displayed in CometChatActionSheet
ActionItem item = ActionItem(
id: '1',
title: 'Like',
iconUrl: 'https://www.example.com/like.png',
iconTint: Colors.red,
background: Colors.white,
cornerRadius: 10.0,
titleStyle: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
color: Colors.black,
),
onItemClick: () {
print('Like button clicked!');
},
);
Constructors
- ActionItem({required String id, required String title, String? iconUrl, String? iconUrlPackageName, Color? iconTint, Color? iconBackground, double? iconCornerRadius, Color? background, double? cornerRadius, TextStyle? titleStyle, dynamic onItemClick})
-
ActionItem constructor requires
id
andtitle
while initializing.const
Properties
- background → Color?
-
background is the background color of the action item
final
- cornerRadius → double?
-
cornerRadius is the corner radius of the action item
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- iconBackground → Color?
-
iconBackground is the background color of the icon
final
- iconCornerRadius → double?
-
iconCornerRadius is the corner radius of the icon
final
- iconTint → Color?
-
iconTint is the color of the icon
final
- iconUrl → String?
-
iconUrl is the path to the icon image for this action item
final
- iconUrlPackageName → String?
-
iconUrlPackageName is the name of the package where the icon for this action item is located
final
- id → String
-
id is an unique id for this action item
final
- onItemClick → dynamic
-
onItemClick is the callback function when this action item is selected
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title → String
-
title is the name for this action item
final
- titleStyle → TextStyle?
-
titleStyle is the styling provided to the name of this action item
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited