Skip to content

Commit

Permalink
add decoration (#12)
Browse files Browse the repository at this point in the history
* add decoration

* add decoration

* prepare for release 1.0.0-nullsafety.3 - Jul 29, 2021
  • Loading branch information
hoc081098 authored Jul 29, 2021
1 parent b8360ac commit 4b7173d
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 34 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# flutter_google_places_hoc081098 changelog

## 1.0.0-nullsafety.3 - Jul 29, 2021

- Update dependencies to latest release
- `rxdart: ^0.27.1`
- `google_api_headers: ^1.1.0`

- Add two params to `PlacesAutocomplete.show` and `PlacesAutocompleteWidget`:
- `InputDecoration? textDecoration`
- `TextStyle? textStyle`

## 1.0.0-nullsafety.2 - May 9, 2021

- Update dependencies to latest release
Expand Down
92 changes: 80 additions & 12 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0"
version: "2.6.1"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -50,6 +50,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
ffi:
dependency: transitive
description:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -61,19 +68,24 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.0-nullsafety.2"
version: "1.0.0-nullsafety.3"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
google_api_headers:
dependency: "direct main"
description:
name: google_api_headers
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.1.0"
google_maps_webservice:
dependency: transitive
description:
Expand All @@ -95,13 +107,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3"
json_annotation:
dependency: transitive
description:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
version: "4.0.1"
listenable_stream:
dependency: transitive
description:
Expand All @@ -123,13 +142,48 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
package_info:
package_info_plus:
dependency: transitive
description:
name: package_info_plus
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
package_info_plus_linux:
dependency: transitive
description:
name: package_info_plus_linux
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
package_info_plus_macos:
dependency: transitive
description:
name: package_info
name: package_info_plus_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "1.1.1"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
package_info_plus_web:
dependency: transitive
description:
name: package_info_plus_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
package_info_plus_windows:
dependency: transitive
description:
name: package_info_plus_windows
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
path:
dependency: transitive
description:
Expand All @@ -143,14 +197,21 @@ packages:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.11.0"
version: "1.11.1"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
rxdart:
dependency: transitive
description:
name: rxdart
url: "https://pub.dartlang.org"
source: hosted
version: "0.27.0"
version: "0.27.1"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -162,7 +223,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -197,7 +258,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19"
version: "0.3.0"
typed_data:
dependency: transitive
description:
Expand All @@ -212,6 +273,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
win32:
dependency: transitive
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.5"
sdks:
dart: ">=2.12.0 <3.0.0"
dart: ">=2.13.0 <3.0.0"
flutter: ">=1.20.0"
34 changes: 26 additions & 8 deletions lib/src/flutter_google_places.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ class PlacesAutocompleteWidget extends StatefulWidget {
final Duration? debounce;
final Map<String, String>? headers;

/// Decoration for search text field
final InputDecoration? textDecoration;

/// Text style for search text field
final TextStyle? textStyle;

/// optional - sets 'proxy' value in google_maps_webservice
///
/// In case of using a proxy the baseUrl can be set.
Expand Down Expand Up @@ -68,7 +74,9 @@ class PlacesAutocompleteWidget extends StatefulWidget {
this.httpClient,
this.startText,
this.debounce,
this.headers})
this.headers,
this.textDecoration,
this.textStyle})
: super(key: key) {
if (apiKey == null && proxyBaseUrl == null) {
throw ArgumentError(
Expand All @@ -92,8 +100,11 @@ class _PlacesAutocompleteScaffoldState extends PlacesAutocompleteState {
@override
Widget build(BuildContext context) {
final appBar = AppBar(
title: AppBarPlacesAutoCompleteTextField(
textDecoration: null, textStyle: null));
title: AppBarPlacesAutoCompleteTextField(
textDecoration: widget.textDecoration,
textStyle: widget.textStyle,
),
);
final body = PlacesAutocompleteResult(
onTap: Navigator.of(context).pop,
logo: widget.logo,
Expand Down Expand Up @@ -241,8 +252,11 @@ class _Loader extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
constraints: BoxConstraints(maxHeight: 2.0),
child: LinearProgressIndicator());
constraints: BoxConstraints(maxHeight: 2.0),
child: LinearProgressIndicator(
color: Theme.of(context).colorScheme.secondary,
),
);
}
}

Expand Down Expand Up @@ -302,7 +316,7 @@ class _AppBarPlacesAutoCompleteTextFieldState

return Container(
alignment: Alignment.topLeft,
margin: EdgeInsets.only(top: 4.0),
margin: EdgeInsets.only(top: 2.0),
child: TextField(
controller: state._queryTextController,
autofocus: true,
Expand Down Expand Up @@ -551,7 +565,7 @@ class _SearchState {
'_SearchState{text: $text, isSearching: $isSearching, response: $response}';
}

class PlacesAutocomplete {
abstract class PlacesAutocomplete {
static Future<Prediction?> show(
{required BuildContext context,
required String? apiKey,
Expand All @@ -574,7 +588,9 @@ class PlacesAutocomplete {
String? startText,
Duration? debounce,
Location? origin,
Map<String, String>? headers}) {
Map<String, String>? headers,
InputDecoration? textDecoration,
TextStyle? textStyle}) {
final builder = (BuildContext context) => PlacesAutocompleteWidget(
apiKey: apiKey,
mode: mode,
Expand All @@ -597,6 +613,8 @@ class PlacesAutocomplete {
debounce: debounce,
origin: origin,
headers: headers,
textDecoration: textDecoration,
textStyle: textStyle,
);

if (mode == Mode.overlay) {
Expand Down
Loading

0 comments on commit 4b7173d

Please sign in to comment.