leadView method

  1. @override
Future<Either<AppException, Response>> leadView(
  1. Map<String, dynamic> data
)
override

Implementation

@override
Future<Either<AppException, response.Response>> leadView(
    Map<String, dynamic> data) async {
  try {
    final eitherType = await networkService.get(
      'leads-master/${data['id']}',
    );
    return eitherType.fold(
      (exception) {
        return Left(exception);
      },
      (response) {
        return Right(response);
      },
    );
  } catch (e) {
    return Left(
      AppException(
        message: 'Unknown error occured',
        statusCode: 1,
        identifier: '${e.toString()}\nLoginUserRemoteDataSource.loginUser',
      ),
    );
  }
}