Skip to content

Commit

Permalink
fix: Clear button will be shown from the start if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-bak committed Apr 2, 2024
1 parent dc22bdc commit 8b051a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ui/add_book_screen/widgets/book_text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ class _BookTextFieldState extends State<BookTextField> {
void initState() {
super.initState();

if (widget.controller.text.isNotEmpty) {
showClearButton = true;
}

widget.controller.addListener(() {
setState(() {
if (widget.controller.text.isNotEmpty) {
Expand Down

0 comments on commit 8b051a6

Please sign in to comment.