trainUser method

  1. @override
Future<IAMPASSUser?> trainUser(
  1. IAMPASSUser registeredUser
)
override

Implementation

@override
Future<IAMPASSUser?> trainUser(IAMPASSUser registeredUser) async {
  String encodedUser = json.encode(registeredUser.toJson());

  Map<String, String> args = {"registered_user": encodedUser};

  final result = await methodChannel.invokeMethod<String>('TrainUser', args);

  if (result != null) {
    Map<String, dynamic> map = jsonDecode(result);

    final IAMPASSUser trainedUser = IAMPASSUser.fromJson(map);
    return trainedUser;
  }

  return null;
}