sistrum 0.1.0
sistrum: ^0.1.0 copied to clipboard
Multi-channel notifications for Maat applications.
import 'package:sistrum/sistrum.dart';
class ConsoleChannel extends NotificationChannel {
@override
Future<Object?> send(Object notifiable, Notification notification) async {
print('Welcome, $notifiable!');
return null;
}
}
class WelcomeNotification extends Notification {
@override
List<String> via(Object notifiable) => const ['console'];
}
Future<void> main() async {
final notifications = ChannelManager(channels: {'console': ConsoleChannel()});
await notifications.send('Ada', WelcomeNotification());
}