WidgetEventController.reg constructor

WidgetEventController.reg(
  1. Map<WidgetEvent, bool> registry, {
  2. ValueSetter<Set<WidgetEvent>>? onChanged,
})

Creates a new instance of WidgetEventController based on a map of events.

The map keys represent the WidgetEvents and the map values represent the desired active state for each event (true for active, false for inactive). Events with a value of false in the map will be removed from the set.

Implementation

WidgetEventController.reg(
  Map<WidgetEvent, bool> registry, {
  this.onChanged,
}) : value = (registry..removeWhere((key, value) => !value)).keys.toSet();