getMessages method
Implementation
@override
Future<List<InboxMessage>> getMessages({String? topic}) async {
final result = await methodChannel.invokeMethod<List<dynamic>>(
NativeMethods.getInboxMessages,
topic != null ? {NativeMethodParams.topic: topic} : null,
);
if (result == null) {
return [];
}
return result
.map((item) => InboxMessage.fromMap(
(item as Map<Object?, Object?>).cast<String, dynamic>()))
.toList();
}