CustomButton.floating constructor

const CustomButton.floating({
  1. Key? key,
  2. required IconData? icon,
  3. required VoidCallback onPressed,
  4. Color? color,
})

Creates a floating action button with the specified icon and onPressed callback

The color parameter can be used to override the default button color.

Example:

Scaffold(
  floatingActionButton: CustomButton.floating(
    icon: Icons.add,
    onPressed: () => showAddDialog(),
    color: Colors.orange,
  ),
)

Implementation

const CustomButton.floating({
  super.key,
  required this.icon,
  required this.onPressed,
  this.color,
})  : type = CustomButtonType.floating,
      text = null;