noq 1.0.3 copy "noq: ^1.0.3" to clipboard
noq: ^1.0.3 copied to clipboard

NoQ SDK for Flutter application.

NoQ Flutter SDK #

Usage #

initialize noq object #

final noq = NoQ(
  clientID: "<your client ID>",
)

enquene #

final result = await noq.enqueue();
switch (result) {
  case EnqueueResultWait():
    if (!context.mounted) return;
    final token = await Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) => WaitingRoomScreen(
          waitingRoomURL: result.url,
          canBack: false, // configure the back behavior
        ),
      ),
    );
    if (token != null) {
      // queuing complete
    } else {
      // queuing cancelled (e.g. user swiped back)
    }
    break;
  default:
    break;
}

check expiry time #

final time = await noq.getExpiryTime();
print(time);

extends session #

The duration of the ticket can be extended by utilizing extendSession method on noq object. The parameter is in minutes

final result = await noq.extendSession(60);
print(result);

delete session #

The duration of the ticket can be extended by utilizing extendSession method on noq object. The parameter is in minutes

await noq.deleteSession();

Change language #

The language of the waiting room can be changed.

noq.language = Language.zhHant;
enum Language {
  en,
  zhHant,
  zhHans,
  fr,
  de,
  it,
  ja,
  es,
  ko,
  pt,
}

Error #

  • NoTokenException - if token is not exist, method may throw this error. In order to obtain a token, use enqueue
  • TokenExpiredException - when calling extends session, the token maybe expired already, then this exception will be thrown.
0
likes
0
points
66
downloads

Publisher

verified publishernoq.hk

Weekly Downloads

NoQ SDK for Flutter application.

License

unknown (license)

Dependencies

dio, flutter, shared_preferences, webview_flutter

More

Packages that depend on noq