BitControl<M, V, L> constructor

BitControl<M, V, L>(
  1. Bit<V, L> _bit, {
  2. M map(
    1. V value,
    2. M? previous
    )?,
  3. M? initial,
  4. bool lazy = true,
  5. bool history = true,
})

Implementation

BitControl(this._bit,
    {this.map, M? initial, bool lazy = true, bool history = true})
    : assert(M == V || map != null,
          "BitControl: Add a map function or make sure M = V"),
      _history = history ? [] : null,
      state = initial != null
          ? BitState.data(initial)
          : BitState<M, L>.loading(null) {
  if (!lazy) _init();
}