CenterBody constructor
const
CenterBody({
- Key? key,
- required IconData icon,
- String? message,
- String? actionText,
- VoidCallback? onActionPressed,
Creates a CenterBody widget.
The icon
parameter is required and specifies the icon to display.
The message
parameter is optional and provides explanatory text.
If both actionText
and onActionPressed
are provided, an action button
will be displayed below the message.
Example:
CenterBody(
icon: Icons.inbox,
message: "No messages found",
actionText: "Refresh",
onActionPressed: () => refreshMessages(),
)
Implementation
const CenterBody(
{super.key,
required this.icon,
this.message,
this.actionText,
this.onActionPressed});