remove focus node that is not needed thanks to flutter being smart
This commit is contained in:
parent
14b7813243
commit
6f271ffc91
|
@ -31,7 +31,6 @@ class CreatePostPage extends HookWidget {
|
||||||
);
|
);
|
||||||
|
|
||||||
final titleFocusNode = useFocusNode();
|
final titleFocusNode = useFocusNode();
|
||||||
final bodyFocusNode = useFocusNode();
|
|
||||||
|
|
||||||
handleSubmit(Jwt token) async {
|
handleSubmit(Jwt token) async {
|
||||||
if (formKey.currentState!.validate()) {
|
if (formKey.currentState!.validate()) {
|
||||||
|
@ -47,7 +46,6 @@ class CreatePostPage extends HookWidget {
|
||||||
textCapitalization: TextCapitalization.sentences,
|
textCapitalization: TextCapitalization.sentences,
|
||||||
textInputAction: TextInputAction.next,
|
textInputAction: TextInputAction.next,
|
||||||
validator: Validators.required(L10n.of(context).required_field),
|
validator: Validators.required(L10n.of(context).required_field),
|
||||||
onFieldSubmitted: (_) => bodyFocusNode.requestFocus(),
|
|
||||||
onChanged: (title) => store.title = title,
|
onChanged: (title) => store.title = title,
|
||||||
minLines: 1,
|
minLines: 1,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
|
@ -61,7 +59,6 @@ class CreatePostPage extends HookWidget {
|
||||||
final body = ObserverBuilder<CreatePostStore>(
|
final body = ObserverBuilder<CreatePostStore>(
|
||||||
builder: (context, store) => Editor(
|
builder: (context, store) => Editor(
|
||||||
controller: bodyController,
|
controller: bodyController,
|
||||||
focusNode: bodyFocusNode,
|
|
||||||
onChanged: (body) => store.body = body,
|
onChanged: (body) => store.body = body,
|
||||||
labelText: L10n.of(context).body,
|
labelText: L10n.of(context).body,
|
||||||
instanceHost: store.instanceHost,
|
instanceHost: store.instanceHost,
|
||||||
|
|
Loading…
Reference in New Issue