Button.filled constructor
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,
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,
),
);
}