2
0
mirror of https://github.com/esiur/esiur-dart.git synced 2026-04-03 17:58:21 +00:00
This commit is contained in:
2022-03-12 16:21:29 +03:00
parent 92a26b8ce5
commit 88eba227ae
64 changed files with 38165 additions and 2952 deletions

View File

@@ -8,7 +8,7 @@ class IEventHandler {
Map<String, List<Function>> _events = {};
register(String event) {
void register(String event) {
_events[event.toLowerCase()] = [];
}
@@ -17,11 +17,11 @@ class IEventHandler {
Stream<PropertyModificationInfo> get properyModified =>
_propertyModifiedController.stream;
emitProperty(PropertyModificationInfo event) {
void emitProperty(PropertyModificationInfo event) {
_propertyModifiedController.add(event);
}
emitArgs(String event, List arguments) {
bool emitArgs(String event, List arguments) {
//event = event.toLowerCase();
var et = _events[event.toLowerCase()];
@@ -33,14 +33,13 @@ class IEventHandler {
return false;
}
on(String event, Function callback) {
void on(String event, Function callback) {
event = event.toLowerCase();
if (!_events.containsKey(event)) register(event);
_events[event]?.add(callback);
return this;
}
off(String event, callback) {
void off(String event, Function? callback) {
event = event.toLowerCase();
if (_events.containsKey(event)) {
if (callback != null)