FancyFab constructor

const FancyFab({
  1. Key? key,
  2. bool? isEnabled,
  3. required VoidCallback? onPressed,
  4. required Widget child,
  5. bool isLoading = false,
  6. Widget? loadingLabel,
  7. Widget? loadingIndicator,
  8. Color? backgroundColor,
  9. ShapeBorder? shape,
})

Creates a circular FloatingActionButton.

Use isEnabled to avoid ternary statements for onPressed — you can disable the button with:

  • isEnabled: false or
  • onPressed: null

child and isLoading must not be null.

Implementation

const FancyFab({
  Key? key,
  bool? isEnabled,
  required VoidCallback? onPressed,
  required Widget child,
  bool isLoading = false,
  Widget? loadingLabel,
  Widget? loadingIndicator,
  this.backgroundColor,
  this.shape,
})  : reverseChildren = false,
      super(
        key: key,
        isEnabled: isEnabled,
        onPressed: onPressed,
        child: child,
        isLoading: isLoading,
        loadingIndicator: loadingIndicator,
        loadingChild: loadingLabel,
      );