textButton static method

Widget textButton(
  1. String text, {
  2. double? width,
  3. double? height,
  4. double? size,
  5. Color textColor = Colors.black,
  6. double fontSize = buttonFontSize,
  7. FontWeight? fontWeight,
  8. TextOverflow? overflow,
  9. VoidCallback? onPressed,
  10. AlignmentGeometry? alignment,
  11. TextDecoration? decoration,
  12. EdgeInsetsGeometry padding = const EdgeInsets.all(8.0),
})

Implementation

static Widget textButton(String text,
    {double? width,
    double? height,
    double? size,
    Color textColor = Colors.black,
    double fontSize = buttonFontSize,
    FontWeight? fontWeight,
    TextOverflow? overflow,
    VoidCallback? onPressed,
    AlignmentGeometry? alignment,
    TextDecoration? decoration,
    EdgeInsetsGeometry padding = const EdgeInsets.all(8.0)}) {
  return TextButton(
    onPressed: onPressed,
    style: ButtonStyle(
        visualDensity: VisualDensity.comfortable,
        alignment: alignment,
        backgroundColor: ButtonStyleButton.allOrNull<Color>(Colors.transparent),
        overlayColor: ButtonStyleButton.allOrNull<Color>(Colors.transparent),
        elevation: ButtonStyleButton.allOrNull<double>(0),
        padding: ButtonStyleButton.allOrNull<EdgeInsetsGeometry>(padding),
        maximumSize: ButtonStyleButton.allOrNull<Size>(Size(size ?? width ?? double.infinity, size ?? height ?? double.infinity)),
        minimumSize: ButtonStyleButton.allOrNull<Size>(Size(size ?? width ?? 0, size ?? height ?? 0))),
    child: Text(text, style: TextStyle(color: textColor, fontSize: fontSize, fontWeight: fontWeight, decoration: decoration), overflow: overflow),
  );
}