call method

  1. @override
Future<Either<InternetConnectionDriverError, Stream<InternetConnectionStatus>>> call()
override

Implementation

@override
Future<
    Either<InternetConnectionDriverError,
        Stream<InternetConnectionStatus>>> call() async {
  InternetConnectionDriver connection = InternetConnectionDriverImpl();

  try {
    return right(await connection.checkInternetConnection());
  } catch (e) {
    return left(InternetConnectionDriverError());
  }
}