Build your own web plugin with JS interop
summary
Shows how to call real JavaScript libraries from Flutter web to mount Stripe’s PaymentElement, using the @JS annotation to declare external getters/methods, allowInterop to hand Dart callbacks to JS, and an HTML element view with registerViewFactory to render the element inside Flutter. Tests run in a browser by injecting a script tag. Covers limitations and future work: static interop / Wasm support and inline types to make JS bindings faster and safer.
AI-written summary · about
chapters (6)
- 0:00Introduction and motivation
- 10:32JavaScript interop basics
- 16:24Calling Dart from JavaScript
- 20:56Testing JavaScript interop
- 27:58Real-world Stripe integration demo
- 34:18Future of Flutter web with Wasm
related talks
27mJavaScript Plugin Architecture for Single-Page Applications
22mBuilding JavaScript for JavaScripters
53mDeveloping WebAssembly Rust plugins for Zellij
29mYour Own Build Tool Agnostic Web-Plugin? Easy as 1 2 3(D)
11mUI Plugin Development
23mThe Next Wave of Web Frameworks is BYOJS
27mGetting to know js_interop
37mElevating JavaScript interoperability with Dart
