File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,6 @@ class ChatBoxState extends State<ChatBox> {
190190 }
191191
192192 return InAppWebView (
193- initialUrlRequest: URLRequest (url: null ),
194193 initialSettings: InAppWebViewSettings (
195194 useHybridComposition: true ,
196195 disableInputAccessoryView: true ,
@@ -386,7 +385,7 @@ class ChatBoxState extends State<ChatBox> {
386385 print ('📗 chatbox._onLoadStop ($url )' );
387386 }
388387
389- if ((url. toString () != 'about:blank' ) && ( _webViewController == null ) ) {
388+ if (_webViewController == null ) {
390389 _webViewController = controller;
391390
392391 // Wait for TalkJS to be ready
Original file line number Diff line number Diff line change @@ -150,7 +150,6 @@ class ConversationListState extends State<ConversationList> {
150150 }
151151
152152 return InAppWebView (
153- initialUrlRequest: URLRequest (url: null ),
154153 initialSettings: InAppWebViewSettings (
155154 useHybridComposition: true ,
156155 disableInputAccessoryView: true ,
@@ -208,16 +207,15 @@ class ConversationListState extends State<ConversationList> {
208207 controller.addJavaScriptHandler (handlerName: 'JSCLoadingState' , callback: _jscLoadingState);
209208
210209 String htmlData = await rootBundle.loadString ('packages/talkjs_flutter/assets/index.html' );
211- Uri uri = Uri .dataFromString (htmlData, mimeType: 'text/html' , encoding: Encoding .getByName ('utf-8' ));
212- controller.loadUrl (urlRequest: URLRequest (url: uri));
210+ controller.loadData (data: htmlData, baseUrl: Uri .parse ("https://app.talkjs.com" ));
213211 }
214212
215213 void _onLoadStop (InAppWebViewController controller, Uri ? url) async {
216214 if (kDebugMode) {
217215 print ('📗 conversationlist._onLoadStop ($url )' );
218216 }
219217
220- if ((url. toString () != 'about:blank' ) && ( _webViewController == null ) ) {
218+ if (_webViewController == null ) {
221219 _webViewController = controller;
222220
223221 // Wait for TalkJS to be ready
You can’t perform that action at this time.
0 commit comments