Knob<T> constructor

Knob<T>({
  1. required String label,
  2. String? description,
  3. @Deprecated('Use initialValue instead.') T? value,
  4. T? initialValue,
  5. bool isNullable = false,
  6. @Deprecated('This parameter is not used anymore. ' 'It defaults to [value == null] instead of [false]') bool isNull = false,
})

Implementation

Knob({
  required this.label,
  this.description,
  @Deprecated('Use initialValue instead.') T? value,
  T? initialValue,
  this.isNullable = false,
  @Deprecated(
    'This parameter is not used anymore. '
    'It defaults to [value == null] instead of [false]',
  )
  this.isNull = false,
}) : this.initialValue = (initialValue ?? value) as T {
  this.isNull = this.initialValue == null;
}