launchBot method
launchBot
Will launch bot with specified botKey and other paramaters
Returns object in when user taps on done button (if enabled)
Implementation
Future<Object?> launchBot(
BuildContext context,
String botKey,
String botName,
String brandingKey,
String userId,
int chatHistorySize,
bool showDone,
EnBotSdk_LanguageDirection languageDirection,
String headerTitleFont,
String headerDescriptionFont,
String sendMessageButtonIconPath) async {
Uint8List? listData;
if (sendMessageButtonIconPath != "") {
try {
final byteData = await rootBundle.load(sendMessageButtonIconPath);
listData = Uint8List.view(byteData.buffer);
} on Error catch (exception) {
print("Exception loading image");
}
}
Object? obj = await _channel.invokeMethod('launchBot', <String, dynamic>{
'botKey': botKey,
'botName': botName,
'brandingKey': brandingKey,
'userId': userId,
'chatHistorySize': chatHistorySize,
'showDone': showDone,
'languageDirection': languageDirection.index,
'headerTitleFont': headerTitleFont,
'headerDescriptionFont': headerDescriptionFont,
'sendMessageButtonIcon': listData ?? null
});
}