editTextMessage method
Future<void>
editTextMessage({
- required EditMessageParams editMessageParams,
- required dynamic callback(
- FlyResponse response
override
This method is used to edit the text message sent previously.
Implementation
@override
Future<void> editTextMessage(
{required EditMessageParams editMessageParams,
required Function(FlyResponse response) callback}) async {
LogMessage.d("editMessageParams", editMessageParams.toMap());
String? editMessageResponse;
try {
editMessageResponse = await mirrorFlyMethodChannel.invokeMethod(
'editTextMessage', editMessageParams.toMap());
var res = convertChatMessageJsonFromString(editMessageResponse);
callback.call(FlyResponse(true, res, "Message edited successfully"));
} on PlatformException catch (e) {
LogMessage.d("Platform Exception =", " $e");
callback.call(FlyResponse(false, FlyConstants.empty, FlyConstants.empty,
FlyException(e.code, e.message, e.details)));
} on Exception catch (e) {
LogMessage.d("Exception ", " $e");
callback.call(FlyResponse(false, FlyConstants.empty, FlyConstants.empty,
FlyException(FlyErrorCode.unHandle, FlyErrorMessage.unHandle, e)));
}
}