Search
 
SCRIPT & CODE EXAMPLE
 

DART

close keyboard on button click flutter

class _HomeState extends State<Home> {
 var currentFocus;
    
 unfocus() {
    currentFocus = FocusScope.of(context);

    if (!currentFocus.hasPrimaryFocus) {
      currentFocus.unfocus();
    }
  }
  
Widget build(BuildContext context) {
    return GestureDetector(
      onTap: unfocus,
      child: Scaffold(...)
      )
     }
Comment

PREVIOUS NEXT
Code Example
Dart :: dart create id 
Dart :: BoxShadow class - painting library - Flutter API 
Dart :: flutter cliprrect 
Dart :: setting backgroundColor for snack bar does not change background color 
Dart :: refresh indicator flutter 
Dart :: dart find element in list 
Dart :: hive regiter adapter enum 
Dart :: string to double dart 
Dart :: velocity x circle 
Dart :: get file type from file path flutter 
Dart :: flutter compare dates 
Dart :: clickable card flutter 
Dart :: how to replace commas in model array of strings in dart 
Dart :: dartpad missing browser localstorage 
Dart :: image from assets in flutter 
Dart :: dart list remove range 
Dart :: extend class flutter 
Dart :: flutter listview how to remove scroll bar 
Dart :: Send Form Data in HTTP POST request in Flutter 
Dart :: provider flutter pub 
Dart :: dart get type of list 
Dart :: dart deep copy list 
Dart :: flutter date input field 
Dart :: Flutter get each letter from string 
Dart :: flutter get available height 
Dart :: convert timeofday to string flutter 
Dart :: flutter overflow 
Dart :: map in dart 
Dart :: how to check system environment variables in dart 
Dart :: flutter periodic timer 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =