execute method

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

Implementation

@override
Future<FutureOr<void>> execute(BuildContext context,
    {Map<String, dynamic>? arguments}) async {
  if (isAwaited == true) {
    ScaffoldMessenger.maybeOf(context)?.showSnackBar(SnackBar(
      content:
          Text(message.isEmpty ? 'Waiting for $milliseconds ms' : message),
      duration: Duration(milliseconds: milliseconds),
    ));

    await Future.delayed(Duration(milliseconds: milliseconds));

    if (context.mounted) {
      ScaffoldMessenger.maybeOf(context)?.hideCurrentSnackBar();
    }
  } else {
    Future.delayed(Duration(milliseconds: milliseconds));
  }
}