post method
Implementation
void post({String? key, dynamic data, Object? sendObject}) {
log.info('send = $sendObject, key = $key');
if (key == null) {
log.severe('post: the param error');
return;
}
var items = _notifications.where((element) => element.key == key).toList();
items.forEach((element) {
if (element.callback != null) {
try {
element.callback!(data);
} catch (e) {
/// ignore: avoid_print
print('发生异常:$e');
}
}
});
}