findUserById method
Returns a FindUserResponse
for user with userId
Upon success a User
object is provided and error is set to null
In case of error a ResponseError
is set and no User
is provided
Implementation
@override
Future<FindUserResponse> findUserById(String userId) {
return catchDioError<FindUserResponse>(
client.get(_getUserUrl(userId)).then((Response<dynamic> response) =>
parseUser(userId, parseDocument(response.data))),
(de) => FindUserResponse(
error: toResponseError(de, context: contextUser, target: userId)));
}