selectIndex method
Performs a index
based selection on an List of Logic.
Given a List of Logic say logicList
on which we apply selectIndex
and an element index
as argument , we can select any valid element
of type Logic within the logicList
using the index
of Logic type.
Alternatively we can approach this with index.selectFrom(logicList)
Example:
// ordering matches closer to array indexing with `0` index-based.
List<Logic> logicList = [/* Add your Logic elements here */];
selected <= logicList.selectIndex(index);
Implementation
Logic selectIndex(Logic index, {Logic? defaultValue}) =>
index.selectFrom(this, defaultValue: defaultValue);