addObserver method
Register callback function for notification. The function must have one and only one argument (an instance of NSNotification).
Implementation
void addObserver(id observer, Function function, String name, id object) {
SEL? selector = _registerNotificationCallback(observer, function);
if (selector == null) {
throw 'Selector($selector) already exists when register notification!';
}
performSync(SEL('addObserver:selector:name:object:'),
args: [observer, selector, name, object]);
}