updateUser method
Future<IAMPASSUser?>
updateUser(
- String userID,
- IAMPASSUser userData,
- String notificationToken
override
Implementation
@override
Future<IAMPASSUser?> updateUser(
String userID, IAMPASSUser userData, String notificationToken) async {
// Conver the user to a string and send it to the
String encodedUser = jsonEncode(userData.toJson());
Map<String, String> args = {
"user": encodedUser,
"userID": userID,
"notificationToken": notificationToken
};
final String? updatedUser =
await methodChannel.invokeMethod<String>('UpdateUser', args);
if (updatedUser != null) {
Map<String, dynamic> map = jsonDecode(updatedUser);
final IAMPASSUser result = IAMPASSUser.fromJson(map);
return result;
} else {
return null;
}
}