Aseem Wangoo

Senior Software Engineer at ShopBack and Founder of Flatteredwithflutter

Talk Title

Enabling smooth communication between JavaScript and Dart in Flutter






13:40 > 40 min


on Twitter

This talk is ideal for developers who are already familiar with Flutter and want to explore its potential for web development. We will also learn about state management between Flutter and JavaScript and how to customize Flutter web app initialization.

Using the js package, you can mark any function in your Dart code with the @JSExport attribute and subsequently invoke it from your JavaScript code. This helps to facilitate smooth interoperability between JavaScript and Dart code.

We showcase the power of interoperability and come up with an exciting scenario.

We leverage the potential of interoperability to integrate ChatGPT into Flutter Web. There are three essential steps to follow.

- Set up a localhost server that invokes the OpenAI APIs.
- Create a Flutter web project and develop a plain vanilla Javascript and HTML mock of the ChatGPT UI.
- Integrate the localhost server established in the first step into the Flutter web app.

The 3rd step involves Element embedding

It's a feature introduced in Flutter that allows developers to embed Flutter content into any web application using an HTML element. This feature enables developers to create complex user interfaces by combining the performance of Flutter with the flexibility of the web.

Using JS-Dart interoperability, the ChatGPT UI responds to the queries sent by the Flutter web and returns the corresponding answers.

- Element Embedding can be particularly useful for web developers with HTML and CSS experience.

- Element embedding allows developers to integrate Flutter content into existing HTML pages or web apps, which can help enhance the user experience and leverage the strengths of both technologies.

- JavaScript can be used to render the web-based component, like ChatGPT, inside the embedded HTML element.

Speaker Works:



- Google Singapore Talk:

- Geekle 2021:

- Google Singapore Online Dart and CLI Talk:

- DartUp talk:

- Dart CLI Talk:

- Dart Cloud Run Talk:

- Calling C from Flutter:

This talk is completely fresh and has not been delivered previously.

Speaker Bio

Founder of Flatteredwithflutter. YouTuber, blogger, event speaker and technical writer. Working with SouthEast Asia’s largest online loyalty platform, ShopBack

Ranked in the Top 30 best flutter blogs. Speaker at Google Singapore and tech events based in Singapore (eg Flutter Meetups etc). Given online talks with Geekle, DartUp and other tech communities.