dismiss_keyboard_on_tap 1.0.0 dismiss_keyboard_on_tap: ^1.0.0 copied to clipboard
Dismisses Keyboard by tapping outside text field on the screen.
import 'package:dismiss_keyboard_on_tap/dismiss_keyboard_on_tap.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DismissKeyboardOnTap(
child: MaterialApp(
home: Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Dismiss Keyboard Example'),
Padding(
padding: const EdgeInsets.all(20.0),
child: TextField(
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
),
),
),
),
],
),
),
),
);
}
}