CustomButton.floating constructor
const
CustomButton.floating({
- Key? key,
- required IconData? icon,
- required VoidCallback onPressed,
- 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;