initialize static method

Future<PushStream> initialize({
  1. required String account,
  2. required List<STREAM> listen,
  3. Signer? signer,
  4. String? decryptedPgpPvtKey,
  5. PushStreamInitializeOptions? options,
  6. void progressHook(
    1. ProgressHookType
    )?,
})

Implementation

static Future<PushStream> initialize(
    {required String account,
    required List<STREAM> listen,
    Signer? signer,
    String? decryptedPgpPvtKey,
    PushStreamInitializeOptions? options,
    void Function(ProgressHookType)? progressHook}) async {
  final defaultOptions = PushStreamInitializeOptions.default_();

  if (listen.isEmpty) {
    throw Exception(
        'The listen property must have at least one STREAM type.');
  }

  final settings = options ?? defaultOptions;
  final accountToUse = settings.overrideAccount ?? account;

  return PushStream(
      account: accountToUse,
      listen: listen,
      options: settings,
      decryptedPgpPvtKey: decryptedPgpPvtKey,
      signer: signer,
      progressHook: progressHook);
}