File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
packages/firebase_ai/firebase_ai/lib/src Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,11 @@ import 'dart:convert';
1818import 'package:firebase_app_check/firebase_app_check.dart' ;
1919import 'package:firebase_auth/firebase_auth.dart' ;
2020import 'package:firebase_core/firebase_core.dart' ;
21+ import 'package:flutter/foundation.dart' ;
2122import 'package:http/http.dart' as http;
2223import 'package:meta/meta.dart' ;
2324import 'package:web_socket_channel/io.dart' ;
25+ import 'package:web_socket_channel/web_socket_channel.dart' ;
2426
2527import 'api.dart' ;
2628import 'client.dart' ;
Original file line number Diff line number Diff line change @@ -89,7 +89,10 @@ final class LiveGenerativeModel extends BaseModel {
8989
9090 final request = jsonEncode (setupJson);
9191 final headers = await BaseModel .firebaseTokens (_appCheck, _auth, _app)();
92- var ws = IOWebSocketChannel .connect (Uri .parse (uri), headers: headers);
92+
93+ var ws = kIsWeb
94+ ? WebSocketChannel .connect (Uri .parse (uri))
95+ : IOWebSocketChannel .connect (Uri .parse (uri), headers: headers);
9396 await ws.ready;
9497
9598 ws.sink.add (request);
You can’t perform that action at this time.
0 commit comments