@@ -246,7 +246,7 @@ class ChatBoxState extends State<ChatBox> {
246246
247247 // Notify the backend of the UI's focus state
248248 setTimeout(() => chatBox.onWindowVisibleChanged(document.visibilityState === "visible"), 1000);
249- }); true;
249+ });
250250 '''
251251 .trim (),
252252 );
@@ -280,7 +280,7 @@ class ChatBoxState extends State<ChatBox> {
280280 chatBox.mount(document.getElementById("talkjs-container")).then(() => {
281281 // Notify the backend of the UI's focus state
282282 setTimeout(() => chatBox.onWindowVisibleChanged(document.visibilityState === "visible"), 1000);
283- }); true;
283+ });
284284 '''
285285 .trim (),
286286 );
@@ -427,25 +427,23 @@ class ChatBoxState extends State<ChatBox> {
427427 translateConversations: widget.translateConversations,
428428 );
429429
430- // This statemement without the `true;` at the end results in a build that crashes on iOS 26.2 when built using Xcode 26.2
431- // Building on Xcode 26.1.1 and running on iOS 26.2 does not result in a crash.
432- execute ('chatBox = session.createChatbox(${_oldOptions }); true;' );
430+ execute ('chatBox = session.createChatbox(${_oldOptions });' );
433431
434432 _setMessageFilter ();
435433 _setHighlightedWords ();
436434
437435 execute (
438- 'chatBox.onSendMessage((event) => window.flutter_inappwebview.callHandler("JSCSendMessage", JSON.stringify(event))); true; ' ,
436+ 'chatBox.onSendMessage((event) => window.flutter_inappwebview.callHandler("JSCSendMessage", JSON.stringify(event)));' ,
439437 );
440438 execute (
441- 'chatBox.onTranslationToggled((event) => window.flutter_inappwebview.callHandler("JSCTranslationToggled", JSON.stringify(event))); true; ' ,
439+ 'chatBox.onTranslationToggled((event) => window.flutter_inappwebview.callHandler("JSCTranslationToggled", JSON.stringify(event)));' ,
442440 );
443441
444442 if (widget.onCustomMessageAction != null ) {
445443 _oldCustomMessageActions = Set .of (widget.onCustomMessageAction! .keys);
446444 for (var action in _oldCustomMessageActions) {
447445 execute (
448- 'chatBox.onCustomMessageAction("$action ", customMessageActionHandler); true; ' ,
446+ 'chatBox.onCustomMessageAction("$action ", customMessageActionHandler);' ,
449447 );
450448 }
451449 } else {
@@ -458,7 +456,7 @@ class ChatBoxState extends State<ChatBox> {
458456 );
459457 for (var action in _oldCustomConversationActions) {
460458 execute (
461- 'chatBox.onCustomConversationAction("$action ", customConversationActionHandler); true; ' ,
459+ 'chatBox.onCustomConversationAction("$action ", customConversationActionHandler);' ,
462460 );
463461 }
464462 } else {
@@ -507,7 +505,7 @@ class ChatBoxState extends State<ChatBox> {
507505 _oldCustomMessageActions.add (action);
508506
509507 execute (
510- 'chatBox.onCustomMessageAction("$action ", customMessageActionHandler); true; ' ,
508+ 'chatBox.onCustomMessageAction("$action ", customMessageActionHandler);' ,
511509 );
512510
513511 retval = true ;
@@ -540,7 +538,7 @@ class ChatBoxState extends State<ChatBox> {
540538 _oldCustomConversationActions.add (action);
541539
542540 execute (
543- 'chatBox.onCustomConversationAction("$action ", customConversationActionHandler); true; ' ,
541+ 'chatBox.onCustomConversationAction("$action ", customConversationActionHandler);' ,
544542 );
545543
546544 retval = true ;
@@ -564,13 +562,13 @@ class ChatBoxState extends State<ChatBox> {
564562
565563 if (_oldConversation != null ) {
566564 execute (
567- 'chatBox.select(${getConversationVariableName (_oldConversation !)}, ${json .encode (result )}); true; ' ,
565+ 'chatBox.select(${getConversationVariableName (_oldConversation !)}, ${json .encode (result )});' ,
568566 );
569567 } else {
570568 if (result.isNotEmpty) {
571- execute ('chatBox.select(undefined, ${json .encode (result )}); true; ' );
569+ execute ('chatBox.select(undefined, ${json .encode (result )});' );
572570 } else {
573- execute ('chatBox.select(undefined); true; ' );
571+ execute ('chatBox.select(undefined);' );
574572 }
575573 }
576574 }
@@ -591,7 +589,7 @@ class ChatBoxState extends State<ChatBox> {
591589 _oldHighlightedWords = List .of (widget.highlightedWords);
592590
593591 execute (
594- 'chatBox.setHighlightedWords(${json .encode (_oldHighlightedWords )}); true; ' ,
592+ 'chatBox.setHighlightedWords(${json .encode (_oldHighlightedWords )});' ,
595593 );
596594 }
597595
@@ -775,15 +773,13 @@ class ChatBoxState extends State<ChatBox> {
775773
776774 _users[user.id] = variableName;
777775
778- execute (
779- 'let $variableName = new Talk.User(${user .getJsonString ()}); true;' ,
780- );
776+ execute ('let $variableName = new Talk.User(${user .getJsonString ()});' );
781777
782778 _userObjs[user.id] = User .of (user);
783779 } else if (_userObjs[user.id] != user) {
784780 final variableName = _users[user.id]! ;
785781
786- execute ('$variableName = new Talk.User(${user .getJsonString ()}); true; ' );
782+ execute ('$variableName = new Talk.User(${user .getJsonString ()});' );
787783
788784 _userObjs[user.id] = User .of (user);
789785 }
@@ -799,7 +795,7 @@ class ChatBoxState extends State<ChatBox> {
799795 _conversations[conversation.id] = variableName;
800796
801797 execute (
802- 'let $variableName = session.getOrCreateConversation("${conversation .id }"); true; ' ,
798+ 'let $variableName = session.getOrCreateConversation("${conversation .id }");' ,
803799 );
804800
805801 _setConversationAttributes (variableName, conversation);
@@ -868,7 +864,9 @@ class ChatBoxState extends State<ChatBox> {
868864 print ('📗 chatbox.execute: $statement ' );
869865 }
870866
871- controller.evaluateJavascript (source: statement);
867+ // This statemement without the `true;` at the end results in a build that crashes on iOS 26.2 when built using Xcode 26.2
868+ // Building on Xcode 26.1.1 and running on iOS 26.2 does not result in a crash.
869+ controller.evaluateJavascript (source: '$statement ; true;' );
872870 } else {
873871 if (kDebugMode) {
874872 print ('📘 chatbox.execute: $statement ' );
0 commit comments