showSnackbar static method

Future<ABUSResult> showSnackbar({
  1. required String message,
  2. SnackbarType type = SnackbarType.info,
  3. String? actionLabel,
  4. VoidCallback? onAction,
  5. Duration? duration,
  6. Set<String>? tags,
  7. int priority = 0,
  8. bool replace = false,
})

Show a snackbar

Implementation

static Future<ABUSResult> showSnackbar({
  required String message,
  SnackbarType type = SnackbarType.info,
  String? actionLabel,
  VoidCallback? onAction,
  Duration? duration,
  Set<String>? tags,
  int priority = 0,
  bool replace = false,
}) {
  final event = SnackbarEvent(
    id: 'snackbar_${DateTime.now().millisecondsSinceEpoch}',
    message: message,
    type: type,
    actionLabel: actionLabel,
    onAction: onAction,
    duration: duration,
    tags: tags ?? {},
    priority: priority,
  );

  return ABUS
      .execute(ShowFeedbackInteraction(event: event, replace: replace));
}