Skip to content

Commit 44da14e

Browse files
Merge pull request #215 from jnelle/master
update dependencies & add overlayBorderRadius parameter
2 parents 363b0a8 + 073f31c commit 44da14e

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

lib/src/flutter_google_places.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,12 @@ class _PlacesAutocompleteOverlayState extends PlacesAutocompleteState {
212212
Widget _textField(BuildContext context) => TextField(
213213
controller: _queryTextController,
214214
autofocus: true,
215-
style: TextStyle(
216-
color: Theme.of(context).brightness == Brightness.light
217-
? Colors.black87
218-
: null,
219-
fontSize: 16.0),
215+
style: widget.textStyle ??
216+
TextStyle(
217+
color: Theme.of(context).brightness == Brightness.light
218+
? Colors.black87
219+
: null,
220+
fontSize: 16.0),
220221
decoration: widget.decoration ??
221222
InputDecoration(
222223
hintText: widget.hint,

lib/src/places_autocomplete_field.dart

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ class PlacesAutocompleteField extends StatefulWidget {
5757
this.onSelected,
5858
this.onError,
5959
this.inputDecoration = const InputDecoration(),
60+
this.overlayBorderRadius,
61+
this.textStyle,
62+
this.textStyleFormField,
6063
}) : super(key: key);
6164

6265
/// Controls the text being edited.
@@ -134,6 +137,12 @@ class PlacesAutocompleteField extends StatefulWidget {
134137
/// Callback when autocomplete has error.
135138
final ValueChanged<PlacesAutocompleteResponse>? onError;
136139

140+
final BorderRadius? overlayBorderRadius;
141+
142+
final TextStyle? textStyle;
143+
144+
final TextStyle? textStyleFormField;
145+
137146
@override
138147
_LocationAutocompleteFieldState createState() =>
139148
_LocationAutocompleteFieldState();
@@ -178,6 +187,8 @@ class _LocationAutocompleteFieldState extends State<PlacesAutocompleteField> {
178187
radius: widget.radius,
179188
types: widget.types,
180189
strictbounds: widget.strictbounds,
190+
overlayBorderRadius: widget.overlayBorderRadius,
191+
textStyle: widget.textStyle,
181192
);
182193

183194
void _handleTap() async {
@@ -201,13 +212,14 @@ class _LocationAutocompleteFieldState extends State<PlacesAutocompleteField> {
201212
final TextEditingController controller = _effectiveController!;
202213

203214
var text = controller.text.isNotEmpty
204-
? Text(
205-
controller.text,
215+
? Text(controller.text,
206216
softWrap: true,
207-
)
217+
style: widget.textStyleFormField ??
218+
const TextStyle(color: Colors.black38))
208219
: Text(
209220
widget.hint,
210-
style: const TextStyle(color: Colors.black38),
221+
style: widget.textStyleFormField ??
222+
const TextStyle(color: Colors.black38),
211223
);
212224

213225
Widget child = Row(

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
google_api_headers: ^1.3.0
1414
google_maps_webservice: ^0.0.20-nullsafety.5
1515
http: ^0.13.4
16-
rxdart: ^0.27.3
16+
rxdart: ^0.27.5
1717

1818
dev_dependencies:
1919
flutter_lints: ^2.0.1

0 commit comments

Comments
 (0)