updateMyProfileImage method

  1. @override
Future<void> updateMyProfileImage(
  1. String image,
  2. dynamic callback(
    1. FlyResponse response
    )?
)
override

This method is used to update the profile image.

Implementation

@override
Future<void> updateMyProfileImage(
    String image, Function(FlyResponse response)? callback) async {
  //updateProfileImage
  String? profileResponse;
  try {
    profileResponse = await mirrorFlyMethodChannel
        .invokeMethod('updateMyProfileImage', {"image": image});
    var res = convertProfileUpdateJsonFromString(profileResponse);
    callback?.call(FlyResponse(true, res, "user profile image updated"));
  } 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)));
  }
}