PlayerDataRightsPanel constructor
PlayerDataRightsPanel({
- Key? key,
- required Future<
void> onExport(), - required Future<
void> onErase(), - bool busy = false,
- String title = 'Your data',
- String description = 'Export a copy of your data or erase it from this device.',
- String exportLabel = 'Export my data',
- String eraseLabel = 'Erase my data',
- String confirmEraseLabel = 'Confirm erase',
- String cancelLabel = 'Cancel',
- String erasureWarning = 'This permanently erases your data on this device and cannot be undone.',
- String exportSuccessLabel = 'Your data export is ready.',
- String eraseSuccessLabel = 'Your device data was erased.',
- String errorLabel = 'Something went wrong. Please try again.',
Implementation
PlayerDataRightsPanel({
super.key,
required this.onExport,
required this.onErase,
this.busy = false,
this.title = 'Your data',
this.description =
'Export a copy of your data or erase it from this device.',
this.exportLabel = 'Export my data',
this.eraseLabel = 'Erase my data',
this.confirmEraseLabel = 'Confirm erase',
this.cancelLabel = 'Cancel',
this.erasureWarning =
'This permanently erases your data on this device and cannot be undone.',
this.exportSuccessLabel = 'Your data export is ready.',
this.eraseSuccessLabel = 'Your device data was erased.',
this.errorLabel = 'Something went wrong. Please try again.',
}) {
for (final (name, value) in [
('title', title),
('description', description),
('exportLabel', exportLabel),
('eraseLabel', eraseLabel),
('confirmEraseLabel', confirmEraseLabel),
('cancelLabel', cancelLabel),
('erasureWarning', erasureWarning),
('exportSuccessLabel', exportSuccessLabel),
('eraseSuccessLabel', eraseSuccessLabel),
('errorLabel', errorLabel),
]) {
if (value.trim().isEmpty) {
throw ArgumentError.value(value, name, 'must not be blank');
}
}
}