Skip to content

Commit

Permalink
Update to version 0.7.0 including issue #11 and #12
Browse files Browse the repository at this point in the history
  • Loading branch information
fysoul17 committed Feb 25, 2020
1 parent c73f660 commit f51192d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 20 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [0.7.0] - 25/Feb/2020

- Bug Fixed. Fixed throwing rendering exception when [useCurrentLocation] is set to false. Issue #11.
- [initialPosition] has been set to Required paramater since Google Map needs at least one initial position of the camera. Issue #10.

## [0.6.4] - 22/Feb/2020

- Feature added. You can set resizeToAvoidBottomInset for the scaffold to avoid resizing screen when keyboard is shown.
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.6.4"
version: "0.7.0"
google_maps_webservice:
dependency: transitive
description:
Expand Down
46 changes: 28 additions & 18 deletions lib/src/place_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class PlacePicker extends StatefulWidget {
Key key,
@required this.apiKey,
this.onPlacePicked,
this.initialPosition,
@required this.initialPosition,
this.useCurrentLocation,
this.desiredLocationAccuracy = LocationAccuracy.high,
this.onMapCreated,
Expand Down Expand Up @@ -171,20 +171,19 @@ class _PlacePickerState extends State<PlacePicker> {
child: Builder(
builder: (context) {
return Scaffold(
resizeToAvoidBottomInset: widget.resizeToAvoidBottomInset,
extendBodyBehindAppBar: true,
appBar: AppBar(
key: appBarKey,
automaticallyImplyLeading: false,
iconTheme: Theme.of(context).iconTheme,
elevation: 0,
backgroundColor: Colors.transparent,
titleSpacing: 0.0,
title: _buildSearchBar(),
),
body: widget.useCurrentLocation
? _buildMapWithLocation()
: _buildMap(widget.initialPosition));
resizeToAvoidBottomInset: widget.resizeToAvoidBottomInset,
extendBodyBehindAppBar: true,
appBar: AppBar(
key: appBarKey,
automaticallyImplyLeading: false,
iconTheme: Theme.of(context).iconTheme,
elevation: 0,
backgroundColor: Colors.transparent,
titleSpacing: 0.0,
title: _buildSearchBar(),
),
body: _buildMapWithLocation(),
);
},
),
));
Expand Down Expand Up @@ -273,8 +272,10 @@ class _PlacePickerState extends State<PlacePicker> {
}

_moveToCurrentPosition() async {
await _moveTo(
provider.currentPosition.latitude, provider.currentPosition.longitude);
if (provider.currentPosition != null) {
await _moveTo(provider.currentPosition.latitude,
provider.currentPosition.longitude);
}
}

Widget _buildMapWithLocation() {
Expand All @@ -294,7 +295,16 @@ class _PlacePickerState extends State<PlacePicker> {
}
});
} else {
return _buildMap(widget.initialPosition);
return FutureBuilder(
future: Future.delayed(Duration(milliseconds: 1)),
builder: (context, snap) {
if (snap.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator());
} else {
return _buildMap(widget.initialPosition);
}
},
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: google_maps_place_picker
description: A Flutter plugin which provides 'Picking Place' using Google Maps widget.
version: 0.6.4
version: 0.7.0
homepage: https://github.com/fysoul17/google_maps_place_picker

environment:
Expand Down

0 comments on commit f51192d

Please sign in to comment.