Flutter Floating Button

Source Code​

				
					FloatingActionButton(
  onPressed: () {
    print('FAB Pressed');
  },
  backgroundColor: Colors.teal,
  foregroundColor: Colors.white,
  tooltip: 'Create Task',
  elevation: 6,
  child: Icon(Icons.create),
)

				
			

Ai Code Analizer

🎨 Customization Options

PropertyDescription
onPressedCallback when pressed (required unless disabled).
childWidget inside the FAB (usually Icon).
tooltipShown when user long-presses the button.
backgroundColorCustom background color.
foregroundColorColor of the child (e.g., icon).
shapeChange the shape (e.g., RoundedRectangleBorder for square FAB).
miniReduces the size (mini: true).
elevationAdds shadow under the button.
heroTagTag for animation transitions between screens.