showSelectionScreen static method
Presents a centred M3EDialog with selectable options.
Uses M3ERadio for single selection and M3ECheckbox when
multiSelect is true. Both section dividers are enabled. Confirm stays
disabled until at least one option is selected; on confirm, returns the
selected values (or null if dismissed).
Implementation
static Future<List<String>?> showSelectionScreen(
BuildContext context, {
required String title,
required List<String> options,
bool multiSelect = false,
List<String> initialSelection = const <String>[],
String cancelLabel = _cancelLabel,
String confirmLabel = _confirmLabel,
Widget? icon,
bool barrierDismissible = true,
}) {
assert(options.isNotEmpty, 'options must not be empty.');
return show<List<String>>(
context,
barrierDismissible: barrierDismissible,
dialog: _M3ESelectionDialog(
title: title,
options: options,
multiSelect: multiSelect,
initialSelection: initialSelection,
cancelLabel: cancelLabel,
confirmLabel: confirmLabel,
icon: icon,
),
);
}