79398176

Date: 2025-01-29 21:04:30
Score: 0.5
Natty:
Report link

If the solution I mentioned earlier did not work, you can try disabling the keyboard focus when the page first opens as another method.

Write a initState right above build widget like this:

@override
void initState() {
  super.initState();
  WidgetsBinding.instance.addPostFrameCallback((_) {
    FocusScope.of(context).requestFocus(FocusNode());
  });
}

or like this:

 final FocusNode _textFieldFocusNode = FocusNode();

  @override
  void initState() {
    super.initState();
    _textFieldFocusNode.unfocus();
  }

 ...

TextField(
          focusNode: _textFieldFocusNode,
          autofocus: false,
        ),
Reasons:
  • Blacklisted phrase (1): did not work
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Yusuf