readDetail method

Future<void> readDetail(
  1. UUserResponse u
)

Loads one detailUser with address and documents for the details part of the dialog.

Implementation

Future<void> readDetail(UUserResponse u) async {
  detailUser = u;
  detailState.loading();
  await UServices.user.readById(
    onProgress: detailProgress.call,
    p: UIdParams(
      id: detailUser.id,
      selectorArgs: const UUserSelectorArgs(address: UAddressSelectorArgs(), media: UMediaSelectorArgs()),
    ),
    onOk: (UResponse<UUserResponse> r) {
      detailUser = r.result!;
      detailState.loaded();
    },
    onError: (UEmptyResponse e) => detailState.error(),
    onException: (String e) => detailState.error(),
  );
}