FancyElevatedButton.icon constructor

const FancyElevatedButton.icon({
  1. Key? key,
  2. bool? isEnabled,
  3. required VoidCallback? onPressed,
  4. required Widget icon,
  5. required Widget label,
  6. bool isLoading = false,
  7. Widget? loadingLabel,
  8. Widget? loadingIndicator,
  9. ButtonStyle? style,
})

Creates a ElevatedButton with a leading icon.

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

  • isEnabled: false or
  • onPressed: null

child, icon and isLoading must not be null.

Implementation

const FancyElevatedButton.icon({
  super.key,
  super.isEnabled,
  required super.onPressed,
  required Widget super.icon,
  required Widget label,
  super.isLoading,
  Widget? loadingLabel,
  super.loadingIndicator,
  super.style,
}) : super(
        child: label,
        loadingChild: loadingLabel,
      );