From 8b051a69ac33dee95f3b1e45cf33b863f12db19d Mon Sep 17 00:00:00 2001 From: mateusz-bak <32651935+mateusz-bak@users.noreply.github.com> Date: Tue, 2 Apr 2024 11:13:50 +1100 Subject: [PATCH] fix: Clear button will be shown from the start if needed --- lib/ui/add_book_screen/widgets/book_text_field.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ui/add_book_screen/widgets/book_text_field.dart b/lib/ui/add_book_screen/widgets/book_text_field.dart index 12f66579..3a5accee 100644 --- a/lib/ui/add_book_screen/widgets/book_text_field.dart +++ b/lib/ui/add_book_screen/widgets/book_text_field.dart @@ -49,6 +49,10 @@ class _BookTextFieldState extends State { void initState() { super.initState(); + if (widget.controller.text.isNotEmpty) { + showClearButton = true; + } + widget.controller.addListener(() { setState(() { if (widget.controller.text.isNotEmpty) {