Fab constructor

const Fab({
  1. Key? key,
  2. required Widget child,
  3. Widget? leading,
  4. VoidCallback? onPressed,
  5. double threshold = 350,
  6. List<MenuItem> menu = const [],
})

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,
  this.threshold = 350,
  this.menu = const [],
});