diff --git a/CHANGELOG.md b/CHANGELOG.md index 75af1ea6..f501dced 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.6.7 [beta-version]: +* add new method to get current location without close advanced picker +* create new example search picker example ## 0.6.6+1 [beta-version]: * fix error export ## 0.6.6 [beta-version]: diff --git a/README.md b/README.md index 8d9f41dc..8336bd7d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # flutter_osm_plugin -![pub](https://img.shields.io/badge/pub-v0.6.6%2B1-orange) +![pub](https://img.shields.io/badge/pub-v0.6.7-orange) osm plugin for flutter apps (only Android for now, iOS will be supported in future) @@ -16,13 +16,15 @@ osm plugin for flutter apps (only Android for now, iOS will be supported in futu ## Getting Started openStreetMap flutter examples
+
+openStreetMap flutter examples
## Installing Add the following to your `pubspec.yaml` file: dependencies: - flutter_osm_plugin: ^0.6.6+1 + flutter_osm_plugin: ^0.6.7 ## Simple Usage #### Creating a basic `OSMFlutter` : @@ -128,9 +130,11 @@ controller.changeLocation(GeoPoint(latitude: 47.35387, longitude: 8.43609)); 2) assisted selection (for more details see example) ```dart -/// To Start assisted Selection + /// To Start assisted Selection await controller.advancedPositionPicker(); -/// To get location desired + /// To get location desired + GeoPoint p = await controller.getCurrentPositionAdvancedPositionPicker(); + /// To get location desired and close picker GeoPoint p = await controller.selectAdvancedPositionPicker(); /// To cancel assisted Selection await controller.cancelAdvancedPositionPicker(); diff --git a/example/lib/main.dart b/example/lib/main.dart index de4a6af5..389f99c5 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -21,9 +21,8 @@ class MyApp extends StatelessWidget { ), ), ), - "/picker-result" :(ctx) => LocationAppExample(), - "/search" :(ctx) => SearchPage(), - + "/picker-result": (ctx) => LocationAppExample(), + "/search": (ctx) => SearchPage(), }, ); } diff --git a/example/lib/search_example.dart b/example/lib/search_example.dart index 25190709..a1db10fe 100644 --- a/example/lib/search_example.dart +++ b/example/lib/search_example.dart @@ -23,10 +23,18 @@ class _LocationAppExampleState extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text(""), + ValueListenableBuilder( + valueListenable: notifier, + builder: (ctx, p, child) { + return Text("${p?.toString() ?? ""}"); + }, + ), RaisedButton( onPressed: () async { - await Navigator.pushNamed(context, "/search"); + var p = await Navigator.pushNamed(context, "/search"); + if (p != null) { + notifier.value = p; + } }, child: Text("pick address"), ), diff --git a/pubspec.yaml b/pubspec.yaml index c021f7d3..d1363f12 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_osm_plugin description: openStreetMap plugin for flutter apps (only Android for now, iOS will be supported in future) -version: 0.6.6+1 +version: 0.6.7 homepage: https://github.com/liodali/osm_flutter environment: sdk: ">=2.3.0 <3.0.0" diff --git a/searchExample.gif b/searchExample.gif new file mode 100644 index 00000000..9437c2fb Binary files /dev/null and b/searchExample.gif differ