CenterBody constructor

const CenterBody({
  1. Key? key,
  2. required IconData icon,
  3. String? message,
  4. String? actionText,
  5. 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});