Skip to content

Commit

Permalink
Merge pull request #215 from jnelle/master
Browse files Browse the repository at this point in the history
update dependencies & add overlayBorderRadius parameter
  • Loading branch information
juliansteenbakker authored Nov 22, 2022
2 parents 363b0a8 + 073f31c commit 44da14e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
11 changes: 6 additions & 5 deletions lib/src/flutter_google_places.dart
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,12 @@ class _PlacesAutocompleteOverlayState extends PlacesAutocompleteState {
Widget _textField(BuildContext context) => TextField(
controller: _queryTextController,
autofocus: true,
style: TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black87
: null,
fontSize: 16.0),
style: widget.textStyle ??
TextStyle(
color: Theme.of(context).brightness == Brightness.light
? Colors.black87
: null,
fontSize: 16.0),
decoration: widget.decoration ??
InputDecoration(
hintText: widget.hint,
Expand Down
20 changes: 16 additions & 4 deletions lib/src/places_autocomplete_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class PlacesAutocompleteField extends StatefulWidget {
this.onSelected,
this.onError,
this.inputDecoration = const InputDecoration(),
this.overlayBorderRadius,
this.textStyle,
this.textStyleFormField,
}) : super(key: key);

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

final BorderRadius? overlayBorderRadius;

final TextStyle? textStyle;

final TextStyle? textStyleFormField;

@override
_LocationAutocompleteFieldState createState() =>
_LocationAutocompleteFieldState();
Expand Down Expand Up @@ -178,6 +187,8 @@ class _LocationAutocompleteFieldState extends State<PlacesAutocompleteField> {
radius: widget.radius,
types: widget.types,
strictbounds: widget.strictbounds,
overlayBorderRadius: widget.overlayBorderRadius,
textStyle: widget.textStyle,
);

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

var text = controller.text.isNotEmpty
? Text(
controller.text,
? Text(controller.text,
softWrap: true,
)
style: widget.textStyleFormField ??
const TextStyle(color: Colors.black38))
: Text(
widget.hint,
style: const TextStyle(color: Colors.black38),
style: widget.textStyleFormField ??
const TextStyle(color: Colors.black38),
);

Widget child = Row(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
google_api_headers: ^1.3.0
google_maps_webservice: ^0.0.20-nullsafety.5
http: ^0.13.4
rxdart: ^0.27.3
rxdart: ^0.27.5

dev_dependencies:
flutter_lints: ^2.0.1
Expand Down

0 comments on commit 44da14e

Please sign in to comment.