diff --git a/CHANGELOG.md b/CHANGELOG.md index f4fb6f1..9972afd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/example/pubspec.lock b/example/pubspec.lock index 477f02c..883fe19 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -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: @@ -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 @@ -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: @@ -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: @@ -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: @@ -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 @@ -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: @@ -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: @@ -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" diff --git a/lib/src/flutter_google_places.dart b/lib/src/flutter_google_places.dart index cd7d138..1fdcdf4 100644 --- a/lib/src/flutter_google_places.dart +++ b/lib/src/flutter_google_places.dart @@ -33,6 +33,12 @@ class PlacesAutocompleteWidget extends StatefulWidget { final Duration? debounce; final Map? 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. @@ -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( @@ -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, @@ -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, + ), + ); } } @@ -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, @@ -551,7 +565,7 @@ class _SearchState { '_SearchState{text: $text, isSearching: $isSearching, response: $response}'; } -class PlacesAutocomplete { +abstract class PlacesAutocomplete { static Future show( {required BuildContext context, required String? apiKey, @@ -574,7 +588,9 @@ class PlacesAutocomplete { String? startText, Duration? debounce, Location? origin, - Map? headers}) { + Map? headers, + InputDecoration? textDecoration, + TextStyle? textStyle}) { final builder = (BuildContext context) => PlacesAutocompleteWidget( apiKey: apiKey, mode: mode, @@ -597,6 +613,8 @@ class PlacesAutocomplete { debounce: debounce, origin: origin, headers: headers, + textDecoration: textDecoration, + textStyle: textStyle, ); if (mode == Mode.overlay) { diff --git a/pubspec.lock b/pubspec.lock index a85a362..b4db696 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: @@ -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 @@ -60,13 +67,18 @@ packages: 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: "direct main" description: @@ -88,13 +100,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: "direct main" description: @@ -116,13 +135,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: @@ -136,14 +190,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: "direct main" description: name: rxdart url: "https://pub.dartlang.org" source: hosted - version: "0.27.0" + version: "0.27.1" sky_engine: dependency: transitive description: flutter @@ -155,7 +216,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: @@ -190,7 +251,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: @@ -205,6 +266,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" diff --git a/pubspec.yaml b/pubspec.yaml index c81030f..b54150a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_google_places_hoc081098 description: Google places autocomplete widgets for flutter. No wrapper, use https://pub.dartlang.org/packages/google_maps_webservice. Better flutter_google_places, updated by @hoc081098 -version: 1.0.0-nullsafety.2 +version: 1.0.0-nullsafety.3 homepage: https://github.com/hoc081098/flutter_google_places repository: https://github.com/hoc081098/flutter_google_places @@ -10,10 +10,10 @@ environment: dependencies: flutter: sdk: flutter - google_api_headers: ^1.0.0 + google_api_headers: ^1.1.0 google_maps_webservice: ^0.0.20-nullsafety.5 http: ^0.13.3 - rxdart: ^0.27.0 + rxdart: ^0.27.1 listenable_stream: ^1.1.0 collection: ^1.15.0