feat: Allow setting the self-avatar

This commit is contained in:
2023-07-28 21:46:47 +02:00
parent e975e749e4
commit daf40aed0b
10 changed files with 119 additions and 17 deletions

View File

@@ -306,6 +306,28 @@ class MoxplatformApi {
}
}
Future<void> setNotificationSelfAvatar(String arg_path) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.moxplatform_platform_interface.MoxplatformApi.setNotificationSelfAvatar', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_path]) as List<Object?>?;
if (replyList == null) {
throw PlatformException(
code: 'channel-error',
message: 'Unable to establish connection on channel.',
);
} else if (replyList.length > 1) {
throw PlatformException(
code: replyList[0]! as String,
message: replyList[1] as String?,
details: replyList[2],
);
} else {
return;
}
}
Future<String> getPersistentDataPath() async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.moxplatform_platform_interface.MoxplatformApi.getPersistentDataPath', codec,

View File

@@ -6,5 +6,7 @@ abstract class NotificationsImplementation {
Future<void> showMessagingNotification(MessagingNotification notification);
Future<void> setNotificationSelfAvatar(String path);
Stream<NotificationEvent> getEventStream();
}

View File

@@ -9,6 +9,9 @@ class StubNotificationsImplementation extends NotificationsImplementation {
@override
Future<void> showMessagingNotification(MessagingNotification notification) async {}
@override
Future<void> setNotificationSelfAvatar(String path) async {}
@override
Stream<NotificationEvent> getEventStream() {
return StreamController<NotificationEvent>().stream;