From 5deaf4ba7763fbd563fa30f4b6b550862a1a8091 Mon Sep 17 00:00:00 2001 From: Odinachi David Date: Mon, 6 Feb 2023 20:29:21 +0100 Subject: [PATCH] added focusNode --- lib/src/flutter_google_places.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/src/flutter_google_places.dart b/lib/src/flutter_google_places.dart index a451c36..dab9466 100644 --- a/lib/src/flutter_google_places.dart +++ b/lib/src/flutter_google_places.dart @@ -296,11 +296,15 @@ class PlacesAutocompleteResultState extends State { class AppBarPlacesAutoCompleteTextField extends StatefulWidget { final InputDecoration? textDecoration; final TextStyle? textStyle; + final FocusNode? focusNode; + final bool autofocus; const AppBarPlacesAutoCompleteTextField({ Key? key, this.textDecoration, this.textStyle, + this.focusNode, + this.autofocus = true, }) : super(key: key); @override @@ -319,7 +323,8 @@ class AppBarPlacesAutoCompleteTextFieldState margin: const EdgeInsets.only(top: 4.0), child: TextField( controller: state._queryTextController, - autofocus: true, + autofocus: widget.autofocus, + focusNode: widget.focusNode, style: widget.textStyle ?? _defaultStyle(), decoration: widget.textDecoration ?? _defaultDecoration(state.widget.hint),