Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

178
Vistas
How to listen to a Javascript EventEmitter from Flutter web

I am trying to port the Twilio Conversations Javascript SDK to Dart/Flutter using package:js.

The twilio SDK: http://media.twiliocdn.com/sdk/js/conversations/releases/2.0.1/docs/classes/Client.html

In Javascript, CDN script allows access to global Twilio.Conversations. You then call Twilio.Conversations.Client(token), which returns a ReplayEventEmitter, their extension of an EventEmitter. You then listen to the events coming out to know first when initialization/connection is complete and then when messages or conversations are coming through.

Using package:js, I start with barebones:

@JS('Twilio.Conversations')
library twilio_conversations;

import 'package:js/js.dart';

external TwilClient get client;

@JS('Client')
Class TwilClient {
  external TwilClient(String token)
}

And this is easy to conceptualize adding methods to, but is there a straightforward way to turn the event emitter into a Dart class? Or would it be better to try to import the JS ReplayEventEmitter class, have 'Client' returned as the javascript object, then have the events coming out of it channeled into Dart code?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda