execute method

  1. @override
FutureOr<void> execute(
  1. BuildContext context, {
  2. Map<String, dynamic>? arguments,
})
override

Implementation

@override
FutureOr<void> execute(BuildContext context,
    {Map<String, dynamic>? arguments}) {
  final messenger = ScaffoldMessenger.maybeOf(context);
  if (messenger == null) {
    vyuh.log.debug('No ScaffoldMessenger found in the widget tree');
    return null;
  }

  final snackBar = SnackBar(
    content: Text(title ?? ''),
    showCloseIcon: allowClosing,
    duration: Duration(seconds: showForSeconds),
    behavior: behavior,
  );

  messenger.showSnackBar(snackBar);
}