Skip to content

Commit 1cdaee1

Browse files
committed
button [nfc]: Make onPressed required
All callers pass an `onPressed`, and the behavior when it's not passed isn't coherent -- some aspects of the button take on a disabled appearance following Material defaults (e.g. the background is faded), but some don't, notably the icon color if an icon is present.
1 parent 92230c0 commit 1cdaee1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/widgets/button.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,15 @@ class ZulipMenuItemButton extends StatelessWidget {
291291
this.style = ZulipMenuItemButtonStyle.menu,
292292
required this.label,
293293
this.subLabel,
294-
this.onPressed,
294+
required this.onPressed,
295295
this.icon,
296296
this.toggle,
297297
});
298298

299299
final ZulipMenuItemButtonStyle style;
300300
final String label;
301301
final TextSpan? subLabel;
302-
final VoidCallback? onPressed;
302+
final VoidCallback onPressed;
303303
final IconData? icon;
304304

305305
/// A [Toggle] to go before [icon], or in its place if it's null.

0 commit comments

Comments
 (0)