ignoreError method

Future<T?> ignoreError()

Ignores any error that occurs during the future execution. Usage: fetchData().ignoreError()

Implementation

Future<T?> ignoreError() async {
  try {
    return await this;
  } catch (_) {
    return null;
  }
}