A lightweight and intuitive observer pattern manager for Dart/Flutter in the style of the iOS Notification Center
Migrate dart_notification_center package to null safety
Author : Bruce Brookshire
dependencies:
dart_notification_center_2:
git:
url: https://github.com/hengkysteen/dart_notification_center_2.git
ref: master
import 'package:dart_notification_center_2/dart_notification_center_2.dart';
FlutterNotificationCenter.subscribe(
channel: 'examples',
observer: this,
onNotification: (options) {
print('Notified: ${options}');
},
);
FlutterNotificationCenter.post(channel: 'examples', options: 'Congrats you did it!');
FlutterNotificationCenter.unsubscribe(channel: 'examples', observer: this);