OudsTopBarActionConfig.icon constructor

OudsTopBarActionConfig.icon({
  1. required String icon,
  2. VoidCallback? onActionPressed,
  3. String? contentDescription,
  4. OudsTopAppBarActionBadge? badge,
})

Creates a configuration for an icon-based action.

The badge parameter is only applied on Material and will be ignored on iOS.

Implementation

factory OudsTopBarActionConfig.icon({
  required String icon, // Make this non-nullable for clarity
  VoidCallback? onActionPressed,
  String? contentDescription,
  OudsTopAppBarActionBadge? badge, // Material-only
}) {
  return OudsTopBarActionConfig._(
    type: OudsTopBarActionType.icon,
    icon: icon,
    onActionPressed: onActionPressed,
    contentDescription: contentDescription,
    badge: badge,
  );
}