Implement streaming data into Flutter

This commit is contained in:
2023-07-28 13:54:57 +02:00
parent da851a985b
commit fb9dab3d1e
11 changed files with 374 additions and 32 deletions

View File

@@ -72,6 +72,31 @@ class MessagingNotification {
final List<NotificationMessage?> messages;
}
enum NotificationEventType {
markAsRead,
reply,
open,
}
class NotificationEvent {
const NotificationEvent(
this.jid,
this.type,
this.payload,
);
/// The JID the notification was for.
final String jid;
/// The type of event.
final NotificationEventType type;
/// An optional payload.
/// - type == NotificationType.reply: The reply message text.
/// Otherwise: undefined.
final String? payload;
}
@HostApi()
abstract class MoxplatformApi {
void createNotificationChannel(String title, String id, bool urgent);
@@ -81,4 +106,6 @@ abstract class MoxplatformApi {
String getPersistentDataPath();
String getCacheDataPath();
void eventStub(NotificationEvent event);
}