Add keyboard dismisser
This commit is contained in:
parent
0889246956
commit
9fa198c3bb
|
@ -3,6 +3,7 @@ import 'dart:async';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:keyboard_dismisser/keyboard_dismisser.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'hooks/stores.dart';
|
||||
|
@ -41,7 +42,8 @@ class MyApp extends HookWidget {
|
|||
Widget build(BuildContext context) {
|
||||
final configStore = useConfigStore();
|
||||
|
||||
return MaterialApp(
|
||||
return KeyboardDismisser(
|
||||
child: MaterialApp(
|
||||
title: 'lemmur',
|
||||
supportedLocales: L10n.supportedLocales,
|
||||
localizationsDelegates: L10n.localizationsDelegates,
|
||||
|
@ -50,6 +52,7 @@ class MyApp extends HookWidget {
|
|||
locale: configStore.locale,
|
||||
theme: lightTheme,
|
||||
home: const MyHomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,9 +33,7 @@ class SearchTab extends HookWidget {
|
|||
|
||||
return Scaffold(
|
||||
appBar: AppBar(),
|
||||
body: GestureDetector(
|
||||
onTapDown: (_) => primaryFocus?.unfocus(),
|
||||
child: ListView(
|
||||
body: ListView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
children: [
|
||||
TextField(
|
||||
|
@ -72,7 +70,6 @@ class SearchTab extends HookWidget {
|
|||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -392,6 +392,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
keyboard_dismisser:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: keyboard_dismisser
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
latinize:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -47,6 +47,7 @@ dependencies:
|
|||
intl: ^0.17.0
|
||||
matrix4_transform: ^2.0.0
|
||||
json_annotation: ^4.0.1
|
||||
keyboard_dismisser: ^2.0.0
|
||||
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
|
Loading…
Reference in New Issue