Use this.id
This commit is contained in:
parent
60dd6dacaa
commit
9e403b8710
|
@ -93,22 +93,20 @@ class Site {
|
|||
this.rawConfig = rawConfig;
|
||||
this.lastManagedUpdate = lastManagedUpdate;
|
||||
|
||||
if (id != null) {
|
||||
_updates = EventChannel('net.defined.nebula/$id');
|
||||
_updates.receiveBroadcastStream().listen((d) {
|
||||
try {
|
||||
_updateFromJson(d);
|
||||
_change.add(null);
|
||||
} catch (err) {
|
||||
//TODO: handle the error
|
||||
print(err);
|
||||
}
|
||||
}, onError: (err) {
|
||||
_updateFromJson(err.details);
|
||||
var error = err as PlatformException;
|
||||
_change.addError(error.message ?? 'An unexpected error occurred');
|
||||
});
|
||||
}
|
||||
_updates = EventChannel('net.defined.nebula/${this.id}');
|
||||
_updates.receiveBroadcastStream().listen((d) {
|
||||
try {
|
||||
_updateFromJson(d);
|
||||
_change.add(null);
|
||||
} catch (err) {
|
||||
//TODO: handle the error
|
||||
print(err);
|
||||
}
|
||||
}, onError: (err) {
|
||||
_updateFromJson(err.details);
|
||||
var error = err as PlatformException;
|
||||
_change.addError(error.message ?? 'An unexpected error occurred');
|
||||
});
|
||||
}
|
||||
|
||||
factory Site.fromJson(Map<String, dynamic> json) {
|
||||
|
|
Loading…
Reference in New Issue