button method

  1. @override
Widget button(
  1. AppModel app,
  2. BuildContext context, {
  3. Icon? icon,
  4. required String label,
  5. String? tooltip,
  6. VoidCallback? onPressed,
})
override

Implementation

@override
Widget button(AppModel app, BuildContext context,
    {Icon? icon,
    required String label,
    String? tooltip,
    VoidCallback? onPressed}) {
  GestureDetector returnMe;
  if (icon != null) {
    returnMe = GestureDetector(
        onTap: onPressed,
        child: Padding(
            padding: const EdgeInsets.all(7.0),
            child: _style
                .frontEndStyle()
                .containerStyle()
                .actionContainer(app, context, child: icon)));
  } else {
    returnMe = GestureDetector(
        onTap: onPressed,
        child: _style.frontEndStyle().containerStyle().actionContainer(
            app, context,
            child: Padding(
                padding: const EdgeInsets.all(7.0),
                child: FittedBox(
                    fit: BoxFit.scaleDown,
                    child: _style
                        .frontEndStyle()
                        .textStyle()
                        .text(app, context, label)))));
  }
  if (tooltip == null) {
    return returnMe;
  } else {
    return Tooltip(message: tooltip, child: returnMe);
  }
}