supportPassword method

void supportPassword(
  1. UTerminalResponse i
)

Implementation

void supportPassword(UTerminalResponse i) {
  ULoading.show();
  UServices.terminal.readSupportPassword(
    p: UIdParams(id: i.id),
    onOk: (UResponse<UTerminalReadSupportPasswordResponse> r) {
      ULoading.dismiss();
      final String pass = r.result?.password ?? "-";
      UNavigator.dialog(
        AlertDialog(
          title: Text(U.s.supportPassword),
          content: SelectableText(pass, style: const TextStyle(fontSize: 22, fontWeight: FontWeight.bold)),
          actions: <Widget>[
            UButton(
              type: UButtonType.text,
              title: U.s.ok,
              onTap: () {
                UClipboard.set(pass);
                UNavigator.back();
              },
            ),
          ],
        ),
      );
    },
    onError: (UEmptyResponse r) {
      ULoading.dismiss();
      UToast.error(message: r.message);
    },
    onException: (String e) {
      ULoading.dismiss();
      UToast.error(message: e);
    },
  );
}