MultiGridLevelRow.fromDict constructor

MultiGridLevelRow.fromDict(
  1. Message label,
  2. Map<Message, void Function(int index)> commands, {
  3. List<MultiGridLevelRowAction>? actions,
})

Create an instance with a dictionary of commands:

Implementation

factory MultiGridLevelRow.fromDict(
  final Message label,
  final Map<Message, void Function(int index)> commands, {
  final List<MultiGridLevelRowAction>? actions,
}) =>
    MultiGridLevelRow(
      label: label,
      getNumberOfEntries: () => commands.length,
      getEntryLabel: (final value) => commands.keys.elementAt(value),
      onActivate: (final index) => commands.values.elementAt(index)(index),
      actions: actions ?? [],
    );