createMaterialWidget method
Implementation
@override
TextButton createMaterialWidget(BuildContext context) {
final data = material?.call(context, platform(context));
final icon = data?.icon;
if (icon != null) {
return TextButton.icon(
key: data?.widgetKey ?? widgetKey,
label: data?.child ?? child!,
icon: icon,
onPressed: data?.onPressed ?? onPressed,
onLongPress: data?.onLongPress,
autofocus: data?.autofocus ?? false,
clipBehavior: data?.clipBehavior ?? Clip.none,
focusNode: data?.focusNode,
style: data?.style ??
TextButton.styleFrom(
backgroundColor: color,
padding: padding,
alignment: alignment,
),
onHover: data?.onHover,
onFocusChange: data?.onFocusChange,
);
}
return TextButton(
key: data?.widgetKey ?? widgetKey,
child: data?.child ?? child!,
onPressed: data?.onPressed ?? onPressed,
onLongPress: data?.onLongPress,
autofocus: data?.autofocus ?? false,
clipBehavior: data?.clipBehavior ?? Clip.none,
focusNode: data?.focusNode,
style: data?.style ??
TextButton.styleFrom(
backgroundColor: color,
padding: padding,
alignment: alignment,
),
onHover: data?.onHover,
onFocusChange: data?.onFocusChange,
statesController: data?.statesController,
);
}