26 lines
626 B
Dart
26 lines
626 B
Dart
import 'dart:developer';
|
|
|
|
import 'package:grpc/grpc_web.dart';
|
|
import 'package:softplayer_dart_proto/src/test/v1/test_v1.pb.dart';
|
|
import 'package:softplayer_dart_proto/src/test/v1/test_v1.pbgrpc.dart';
|
|
|
|
class TestAuthGrpc {
|
|
final GrpcWebClientChannel channel;
|
|
late TestAuthServiceClient serviceStub;
|
|
TestAuthGrpc({required this.channel});
|
|
|
|
void init() {
|
|
serviceStub = TestAuthServiceClient(channel);
|
|
}
|
|
|
|
Future<void> pong() async {
|
|
final request = PongRequest();
|
|
try {
|
|
final response = await serviceStub.pong(request);
|
|
log(response.toString());
|
|
} catch (e) {
|
|
rethrow;
|
|
}
|
|
}
|
|
}
|