invokeSafely<T> static method
Invokes the given function safely. By safely, we mean it will catch all exceptions and ignore them.
Implementation
static Future<T?> invokeSafely<T>(FutureOr<T> action()) async {
try {
return await action();
} catch (_) {
}
}