Answers for "flutter iunfocus textfield on button click"

3

flutter unfocus textfield when click outside

return GestureDetector(
      onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
      child: Scaffold(
        appBar: AppBar(
          title: Text('Login'),
        ),
        body: Body(),
      ),
    );
Posted by: Guest on June-18-2021
2

flutter unfocus textfield

FocusScope.of(context).unfocus();
Posted by: Guest on October-12-2020
0

flutter unfocus textfield

FocusScopeNode currentFocus = FocusScope.of(context);

if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Posted by: Guest on March-21-2021

Code answers related to "flutter iunfocus textfield on button click"

Browse Popular Code Answers by Language