Skip to content
pubscout

dismiss_keyboard_on_tap

2.0.1, released a year ago by codingfries.com

Dismisses the soft keyboard when tapping outside of a text field.

WASM-ready
$ flutter pub add dismiss_keyboard_on_tap
Source repository

What it does

Provides a widget wrapper that listens for taps outside text fields and automatically dismisses the software keyboard. It can be wrapped around the entire MaterialApp or specific individual widgets for localized control.

AI-written summary of version 2.0.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want a global mechanism to close the keyboard on outside taps
  • You want a quick widget-based solution instead of managing FocusManagers manually

Skip it when

  • You need custom tap-handling behavior that conflicts with gesture detection on the root level

Strengths

  • Very simple integration by wrapping MaterialApp or specific widgets
  • Works across multiple platforms including Android, iOS, web, and desktop

Weaknesses

  • Limited configuration options documented beyond wrapping widgets

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:dismiss_keyboard_on_tap/dismiss_keyboard_on_tap.dart';

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return DismissKeyboardOnTap(
      child: MaterialApp(
        home: ...,
      ),
    );
  }
}

Alternatives

Packages that do the same job and could replace dismiss_keyboard_on_tap.