read method

Future<void> read()

Implementation

Future<void> read() async {
  state.loading();
  await UServices.user.readById(
    onProgress: loadingProgress.call,
    p: UIdParams(
      id: user.id,
      selectorArgs: const UserSelectorArgs(
        address: AddressSelectorArgs(),
        nationalCardFront: true,
        nationalCardBack: true,
        birthCertificateFirst: true,
        eSignature: true,
        visualAuthentication: true,
      ),
    ),
    onOk: (UResponse<UUserResponse> response) {
      user = response.result!;
      state.loaded();
    },
    onError: (UEmptyResponse response) {
      state.error();
      UToast.error(message: response.message);
    },
    onException: (String response) {
      state.error();
      UToast.error(message: response);
    },
  );
}