Button.filled constructor

Button.filled(
  1. String text, {
  2. Key? key,
  3. double? fontSize,
  4. String? tooltip,
  5. EdgeInsets? padding,
  6. FocusNode? focusNode,
  7. bool canRequestFocus = true,
  8. bool autofocus = false,
  9. bool? active,
  10. bool enableAnimation = false,
  11. bool willChangeState = false,
  12. required VoidCallback? onPressed,
  13. VoidCallback? onLongPress,
  14. ButtonThemeData? theme,
})

Creates a button with a filled background.

Implementation

factory Button.filled(
  String text, {
  Key? key,
  double? fontSize,
  String? tooltip,
  EdgeInsets? padding,
  FocusNode? focusNode,
  bool canRequestFocus = true,
  bool autofocus = false,
  bool? active,
  bool enableAnimation = false,
  bool willChangeState = false,
  required VoidCallback? onPressed,
  VoidCallback? onLongPress,
  ButtonThemeData? theme,
}) {
  return Button(
    key: key,
    padding: padding,
    bodyPadding: padding != null ? EdgeInsets.zero : null,
    theme: theme,
    tooltip: tooltip,
    onPressed: onPressed,
    onLongPress: onLongPress,
    focusNode: focusNode,
    canRequestFocus: canRequestFocus,
    autofocus: autofocus,
    active: active,
    filled: true,
    willChangeState: willChangeState,
    enableAnimation: enableAnimation,
    body: Text(
      text,
      style: fontSize != null ? TextStyle(fontSize: fontSize) : null,
    ),
  );
}