textEditingController<S, A> static method
WithStore<void, A>
textEditingController<S, A>({
- required Store<
S, A> store, - required String toText(
- S state
- required A fromTextEditingAction(
- TextEditingAction action
- required TextEditingControllerWithStoreBuilder<
void, A> builder, - Key? key,
Creates a WithStore with a two-way bound TextEditingController.
The controller's text is synchronized with the store's state via
toText, and text changes dispatch actions via fromTextEditingAction.
WithStore.textEditingController(
store: store,
toText: (state) => state.query,
fromTextEditingAction: (a) => SearchAction.fromTextEditing(a),
builder: (state, send, context, controller, focusNode) =>
TextField(controller: controller, focusNode: focusNode),
);
Implementation
static WithStore<void, A> textEditingController<S, A>({
required Store<S, A> store,
required String Function(S state) toText,
required A Function(TextEditingAction action) fromTextEditingAction,
required TextEditingControllerWithStoreBuilder<void, A> builder,
Key? key,
}) =>
WithStore.textEditingControllerObserve<void, S, A>(
store: store,
observe: (observedState) {},
isEqual: (previous, current) => true,
toText: toText,
fromTextEditingAction: fromTextEditingAction,
builder: builder,
);