Allow AppBtn.onPressed to be null

This commit is contained in:
Shawn 2023-01-03 10:35:53 -07:00
parent 15e1892589
commit 23cd1b4c71

View File

@ -83,7 +83,7 @@ class AppBtn extends StatelessWidget {
super(key: key); super(key: key);
// interaction: // interaction:
final VoidCallback onPressed; final VoidCallback? onPressed;
late final String semanticLabel; late final String semanticLabel;
final bool enableFeedback; final bool enableFeedback;
@ -128,7 +128,7 @@ class AppBtn extends StatelessWidget {
); );
Widget button = TextButton( Widget button = TextButton(
onPressed: () => onPressed(), onPressed: onPressed,
style: style, style: style,
child: DefaultTextStyle( child: DefaultTextStyle(
style: DefaultTextStyle.of(context).style.copyWith(color: textColor), style: DefaultTextStyle.of(context).style.copyWith(color: textColor),