getDigitDialog static method

DigitDialogOptions getDigitDialog({
  1. Key? key,
  2. bool barrierDismissible = false,
  3. required DigitSyncDialogType type,
  4. required String label,
  5. DigitDialogActions? primaryAction,
  6. DigitDialogActions? secondaryAction,
})

Implementation

static DigitDialogOptions getDigitDialog({
  Key? key,
  bool barrierDismissible = false,
  required DigitSyncDialogType type,
  required String label,
  DigitDialogActions? primaryAction,
  DigitDialogActions? secondaryAction,
}) {
  final content = DigitSyncDialogContent(
    label: label,
    type: type,
    key: key,
  );

  switch (type) {
    case DigitSyncDialogType.inProgress:
      break;
    case DigitSyncDialogType.complete:
      assert(
        primaryAction != null,
        'Primary Action cannot be null for sync complete dialog',
      );

      break;
    case DigitSyncDialogType.failed:
      assert(
        primaryAction != null,
        'Primary Action cannot be null for sync failed dialog',
      );
      assert(
        secondaryAction != null,
        'Secondary Action cannot be null for sync failed dialog',
      );

      break;
  }

  return DigitDialogOptions(
    content: content,
    primaryAction: primaryAction,
    secondaryAction: secondaryAction,
    barrierDismissible: barrierDismissible,
    key: key,
  );
}