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
| Property | Description |
|---|---|
onPressed | Callback when pressed (required unless disabled). |
child | Widget inside the FAB (usually Icon). |
tooltip | Shown when user long-presses the button. |
backgroundColor | Custom background color. |
foregroundColor | Color of the child (e.g., icon). |
shape | Change the shape (e.g., RoundedRectangleBorder for square FAB). |
mini | Reduces the size (mini: true). |
elevation | Adds shadow under the button. |
heroTag | Tag for animation transitions between screens. |
