Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,13 +4,33 @@ 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 TestServiceClient serviceStub;
|
||||
TestAuthGrpc({required this.channel});
|
||||
|
||||
void init() {
|
||||
serviceStub = TestServiceClient(channel);
|
||||
}
|
||||
|
||||
Future<void> pong() async {
|
||||
final request = PongRequest();
|
||||
try {
|
||||
final response = await serviceStub.pong(request);
|
||||
log(response.toString());
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TestNoAuthGrpc {
|
||||
final GrpcWebClientChannel channel;
|
||||
late TestNoAuthServiceClient serviceStub;
|
||||
late PublicTestServiceClient serviceStub;
|
||||
TestNoAuthGrpc({required this.channel});
|
||||
|
||||
void init() {
|
||||
serviceStub = TestNoAuthServiceClient(channel);
|
||||
serviceStub = PublicTestServiceClient(channel);
|
||||
}
|
||||
|
||||
Future<void> ping() async {
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:softplayer_web/api/grpc/test_auth.dart';
|
||||
import 'package:softplayer_web/api/grpc/test_no_auth.dart';
|
||||
import 'package:softplayer_web/api/grpc/test_service.dart';
|
||||
import 'package:web/web.dart' as web;
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Reference in New Issue
Block a user