useTextEditingController method

TextEditingController useTextEditingController({
  1. required String key,
  2. String? text,
})

Retrieves or creates a TextEditingController

key: A unique string key to identify the periodic Timer. TEXT: A string to set as initialize value for TextEditingController.

Returns a TextEditingController and auto dispose.

Implementation

TextEditingController useTextEditingController({
  required String key,
  String? text,
}) {
  return _getOrCreate(
      key: key,
      create: () => TextEditingController(text: text),
      disposeHandler: (controller) async => controller.dispose());
}