All checks were successful
ci/woodpecker/push/build Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@posteo.com>
36 lines
921 B
Dart
36 lines
921 B
Dart
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:grpc/grpc_web.dart';
|
|
import 'package:softplayer_dart_proto/accounts/v1/accounts_v1.pbgrpc.dart';
|
|
import 'package:softplayer_web/core/grpc/grpc_client.dart';
|
|
|
|
final publicAccountsGrpcProvider = Provider<PublicAccountsGrpcRepository>((
|
|
ref,
|
|
) {
|
|
return PublicAccountsGrpcRepository(
|
|
ref.watch(publicAccountsServiceClientProvider),
|
|
);
|
|
});
|
|
|
|
class PublicAccountsGrpcRepository {
|
|
PublicAccountsGrpcRepository(this._client);
|
|
final PublicAccountsServiceClient _client;
|
|
|
|
ResponseFuture<SignInResponse> signIn(SignInRequest req) {
|
|
try {
|
|
final response = _client.signIn(req);
|
|
return response;
|
|
} catch (error) {
|
|
rethrow;
|
|
}
|
|
}
|
|
|
|
ResponseFuture<SignUpResponse> signUp(SignUpRequest req) {
|
|
try {
|
|
final response = _client.signUp(req);
|
|
return response;
|
|
} catch (error) {
|
|
rethrow;
|
|
}
|
|
}
|
|
}
|