TestSuperKeyboard constructor

TestSuperKeyboard({
  1. required String id,
  2. required TickerProvider vsync,
  3. KeyboardState initialKeyboardState = KeyboardState.closed,
  4. double fakeKeyboardHeight = 400.0,
  5. Duration keyboardAnimationTime = const Duration(milliseconds: 600),
})

Implementation

TestSuperKeyboard({
  required this.id,
  required TickerProvider vsync,
  KeyboardState initialKeyboardState = KeyboardState.closed,
  this.fakeKeyboardHeight = 400.0,
  Duration keyboardAnimationTime = const Duration(milliseconds: 600),
}) {
  _interceptPlatformChannel();

  _geometry.value = MobileWindowGeometry(
    keyboardState: initialKeyboardState,
    keyboardHeight: initialKeyboardState == KeyboardState.open ? fakeKeyboardHeight : null,
  );

  _keyboardHeightController = AnimationController(
    duration: keyboardAnimationTime,
    vsync: vsync,
  )
    ..addListener(() {
      _geometry.value = _geometry.value.updateWith(
        MobileWindowGeometry(
          keyboardHeight: _keyboardHeightController.value * fakeKeyboardHeight,
        ),
      );
    })
    ..addStatusListener(_onKeyboardAnimationStatusChange);
}