INNER CODE UNIT · Dart

KeyboardController

Im-Kevin/cool_ui · lib/keyboards/keyboard_controller.dart:3

class KeyboardController extends ValueNotifier<TextEditingValue>{
  final InputClient client;

  KeyboardController({TextEditingValue? value,required this.client})
      : super(value == null ? TextEditingValue.empty : value);


  /// The current string the user is editing.
  String get text => value.text;
  /// Setting this will notify all the listeners of this [TextEditingController]
  /// that they need to update (it calls [notifyListeners]). For this reason,
  /// this value should only be set between frames, e.g. in response to user
  /// actions, not during the build, layout, or paint phases.
  set text(String newText) {
    value = value.copyWith(text: newText,
        selection: const TextSelection.collapsed(offset: -1),
        composing: TextRange.empty);
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…