writeValue method

  1. @override
void writeValue(
  1. T? newValue
)
override

Write a new value to the element.

Implementation

@override
void writeValue(T? newValue) {
  // Treat null as special as an invalid input will also parse as null.
  if (newValue == null) {
    super.writeValue(null);
  }
  if (parseNumber(input.inputText) != newValue) {
    // If the numeric value of the current input text doesn't equal to the
    // new numeric value, update the input text accordingly.
    super.writeValue(newValue);
  }
}