Fab constructor

const Fab({
  1. Key? key,
  2. required Widget child,
  3. Widget? leading,
  4. VoidCallback? onPressed,
})

Creates a Fab widget.

The child parameter is required and specifies the content of the button. The onPressed parameter is optional and specifies the callback when the button is pressed.

Example:

Fab(
  child: Icon(Icons.add),
  onPressed: () => print("FAB pressed"),
)

Implementation

const Fab({super.key, required this.child, this.leading, this.onPressed});