4

現在 Web およびモバイル用の Flutter アプリを作成していて、GRPC と WebGrpc を使用したいという私の問題を誰かが助けてくれることを願っています。Grpc ではすべて正常に動作しますが、Web Grpc ではエラーが発生しました

   if (kIsWeb) {
    print("flutter web");
    clientChannel =
        GrpcWebClientChannel.xhr(Uri.parse('http://192.168.2.146:8880'));
    AuthClient(clientChannel).authenticate(AuthenticationRequest()
      ..login = "Apfel"
      ..password= "Hello").then((res) => print(res)).catchError((err) => print(err));
  } else {
    print("flutter mobil");
    clientChannel = ClientChannel('192.168.2.146',
        port: 3009,
        options:
        ChannelOptions(credentials: ChannelCredentials.insecure()));
  }

次のエラーが発生しましたタイプ「ClientChannel」の値が必要ですが、タイプ「GrpcWebClientChannel」の1つを取得しました

4

0 に答える 0