feat: Allow setting the self-avatar
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -6,5 +6,7 @@ abstract class NotificationsImplementation {
|
||||
|
||||
Future<void> showMessagingNotification(MessagingNotification notification);
|
||||
|
||||
Future<void> setNotificationSelfAvatar(String path);
|
||||
|
||||
Stream<NotificationEvent> getEventStream();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user