forceValue method

void forceValue({
  1. double? initDoubleValue,
  2. int? initIntValue,
})

Force a value to the text controller.

Implementation

void forceValue({double? initDoubleValue, int? initIntValue}) {
  assert(!(initDoubleValue != null && initIntValue != null),
      "You must set either 'initDoubleValue' or 'initIntValue' parameter.");
  if (initDoubleValue != null) {
    _value = initDoubleValue;
    _updateValue();
  } else if (initIntValue != null) {
    _value = initIntValue / pow(10, _numberOfDecimals);
    _updateValue();
  }
}