Answers for "hwo to close flutter app on click"

7

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(...)
      )
     }
Posted by: Guest on August-28-2020
0

flutter close app programmatically

SystemNavigator.pop()
Posted by: Guest on January-16-2021

Code answers related to "Dart"

Browse Popular Code Answers by Language