getDigitDialog static method
DigitDialogOptions
getDigitDialog({
- Key? key,
- bool barrierDismissible = false,
- required DigitSyncDialogType type,
- required String label,
- DigitDialogActions? primaryAction,
- 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,
);
}