2
0
mirror of https://github.com/esiur/esiur-dart.git synced 2025-05-06 12:02:57 +00:00
This commit is contained in:
Ahmed Zamil 2022-02-12 15:39:02 +03:00
parent d41911b1ab
commit 32d36144a4
2 changed files with 22 additions and 4 deletions

View File

@ -1,7 +1,10 @@
import 'dart:async'; import 'dart:async';
import 'PropertyModificationInfo.dart';
class IEventHandler { class IEventHandler {
final _propertyModifiedController = StreamController<String>(); final _propertyModifiedController =
StreamController<PropertyModificationInfo>();
Map<String, List<Function>> _events = {}; Map<String, List<Function>> _events = {};
@ -11,10 +14,11 @@ class IEventHandler {
IEventHandler() {} IEventHandler() {}
Stream get properyModified => _propertyModifiedController.stream; Stream<PropertyModificationInfo> get properyModified =>
_propertyModifiedController.stream;
emitProperty(String name) { emitProperty(PropertyModificationInfo event) {
_propertyModifiedController.add(name); _propertyModifiedController.add(event);
} }
emitArgs(String event, List arguments) { emitArgs(String event, List arguments) {

View File

@ -0,0 +1,14 @@
import '../Resource/IResource.dart';
import '../Resource/Template/PropertyTemplate.dart';
class PropertyModificationInfo {
final PropertyTemplate propertyTemplate;
final value;
final int age;
final IResource resource;
String get name => propertyTemplate.name;
PropertyModificationInfo(
this.resource, this.propertyTemplate, this.value, this.age);
}