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