on method
EventEmitterListener
on(})
receive all update data
Implementation
EventEmitterListener on(
String type_update,
FutureOr<dynamic> Function(UpdateMt update) callback, {
void Function(Object data)? onError,
}) {
return event_emitter.on(
eventName: type_update,
onCallback: (listener, update) {
return "";
},
);
// return event_emitter.on(type_update, null, (Event ev, context) async {
// try {
// if (ev.eventData is MtprotoIsolateReceiveData) {
// MtprotoIsolateReceiveData tdlibIsolateReceiveData =
// (ev.eventData as MtprotoIsolateReceiveData);
// await callback(UpdateMt(
// update: tdlibIsolateReceiveData.updateData,
// client_id: tdlibIsolateReceiveData.clientId,
// client_option: tdlibIsolateReceiveData.clientOption,
// ));
// return;
// }
// } catch (e) {
// if (onError != null) {
// return onError(e);
// }
// }
// });
}