createTopic method
Future<String?>
createTopic({
- required String topicName,
- List<
TopicMetaData> metaData = const [],
override
Implementation
@override
Future<String?> createTopic({required String topicName, List<TopicMetaData> metaData = const []}) async {
String? val = "";
List<Map<String, dynamic>>? topic = metaData.map((topic) => topic.toMap()).toList();
LogMessage.d("createTopic", topic);
//if (metaData.length <= 3) {
try {
val = await mirrorFlyMethodChannel.invokeMethod('createTopic', {'topicName': topicName, 'metaData': topic});
LogMessage.d('createTopic', ' $val');
return val;
} on PlatformException catch (e) {
LogMessage.d("Platform Exception =", " $e");
rethrow;
} on Exception catch (error) {
LogMessage.d("Exception ", " $error");
rethrow;
}
// } else {
// throw Exception("topicData Maximum Size is 3");
// }
}