Skip to content

Instantly share code, notes, and snippets.

@saliouseck2009
Created February 1, 2022 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saliouseck2009/2c39328a1f9b00cf22f24ebc492a719f to your computer and use it in GitHub Desktop.
Save saliouseck2009/2c39328a1f9b00cf22f24ebc492a719f to your computer and use it in GitHub Desktop.
Dismiss keyboard in flutter App
FocusManager.instance.primaryFocus?.unfocus()
#use cases
return GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold(
appBar: AppBar(
title: Text('Login'),
),
body: Body(),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment