Skip to content

RKMultiSelect

Bitmask multi-select group for RadioKit — displays a grid or wrap of buttons where multiple items can be active simultaneously, represented by a bitmask.

RKMultiSelect({
required List<RKToggleItem> items,
required int bitmask,
required ValueChanged<int> onChanged,
double buttonSize = 64.0,
double spacing = 8.0,
double padding = 12.0,
bool enableHapticFeedback = true,
RKAxis orientation = RKAxis.horizontal,
ValueChanged<bool>? onActiveChanged,
double rotation = 0.0,
String? label,
})
ParameterDescription
itemsList of RKToggleItem (labels and icons) to display.
bitmaskAn integer where the i-th bit represents the state of items[i].
onChangedCalled with the updated bitmask when an item is toggled.
buttonSizeSize (width and height) of each individual button.
spacingDistance between buttons in the group.
paddingInner padding of the group container.
enableHapticFeedbackWhether to trigger haptic feedback on interaction.
orientationHorizontal or vertical layout (RKAxis).
onActiveChangedCallback when the user starts/stops touching the group.
rotationVisual rotation of the widget in radians.
labelOptional text label displayed above the widget.
const RKToggleItem({
String? onLabel,
String? offLabel,
IconData? onIcon,
IconData? offIcon,
});
int _bitmask = 0;
RKMultiSelect(
items: const [
RKToggleItem(onLabel: 'Radar', onIcon: Icons.radar),
RKToggleItem(onLabel: 'GPS', onIcon: Icons.gps_fixed),
RKToggleItem(onLabel: 'Comms', onIcon: Icons.settings_input_antenna),
],
bitmask: _bitmask,
orientation: RKAxis.horizontal,
onChanged: (int newBitmask) => setState(() => _bitmask = newBitmask),
);