fix: disable overlay if search is not active

This commit is contained in:
Matyáš Caras 2024-01-30 22:03:03 +01:00
parent 5520655e32
commit ae07720854
Signed by untrusted user who does not match committer: hernik
GPG key ID: 2A3175F98820C5C6
2 changed files with 18 additions and 16 deletions

View file

@ -10,6 +10,7 @@
- Added titles above graphs
- Some extra optimization for iOS
- Fix starting balance not saving
- Fix overlay disabling tappig on edit/delete buttons on home view
# 1.0.0-alpha+5
- Add tests
- Add searching through entries to homepage

View file

@ -577,24 +577,25 @@ class _HomeViewState extends State<HomeView> {
],
),
),
OverlayEntry(
builder: (context) => SizedBox(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: GestureDetector(
onTap: () {
if (!_searchActive) return;
if (!searchFocus.hasFocus) {
_searchActive = false;
_filter = "";
setState(() {});
return;
}
searchFocus.unfocus();
},
if (_searchActive)
OverlayEntry(
builder: (context) => SizedBox(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: GestureDetector(
onTap: () {
if (!_searchActive) return;
if (!searchFocus.hasFocus) {
_searchActive = false;
_filter = "";
setState(() {});
return;
}
searchFocus.unfocus();
},
),
),
),
),
],
),
),