button method
Widget
button(
- AppModel app,
- BuildContext context, {
- Icon? icon,
- required String label,
- String? tooltip,
- 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);
}
}