apply method

bool apply({
  1. KeyboardMode? mode,
  2. double? deviceHeight,
  3. double? deviceKeypadHeight,
  4. bool clearKeypad = false,
})

Applies what the host asked for. Returns whether anything moved.

Implementation

bool apply({
  KeyboardMode? mode,
  double? deviceHeight,
  double? deviceKeypadHeight,
  bool clearKeypad = false,
}) {
  var before = state;
  _mode = mode ?? _mode;
  _deviceHeight = deviceHeight ?? _deviceHeight;
  if (clearKeypad) {
    _deviceKeypadHeight = null;
  } else if (deviceKeypadHeight != null) {
    _deviceKeypadHeight = deviceKeypadHeight;
  }
  var moved = state != before;
  if (moved) {
    _bump();
    _announce();
  }
  return moved;
}