updateMyProfile method
Future<void>
updateMyProfile(
- String name,
- String? email,
- String? mobile,
- String? status,
- String? image,
- dynamic callback(
- FlyResponse response
override
This method is used to update the current user profile.
Implementation
@override
Future<void> updateMyProfile(
String name,
String? email,
String? mobile,
String? status,
String? image,
Function(FlyResponse response)? callback) async {
//updateProfile
String? profileResponse;
try {
profileResponse = await mirrorFlyMethodChannel.invokeMethod(
'updateMyProfile', {
"name": name,
"email": email,
"mobile": mobile,
"status": status,
"image": image
});
var res = convertProfileUpdateJsonFromString(profileResponse);
callback?.call(FlyResponse(true, res, "user profile 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)));
}
}