Back button request
Hey! Super minor and hopefully trivial request, but a back or cancel button would be amazing!
I am here for the same request. if you edit the package you can get the back button, but when you update the package it is lost so I wish if this was provided as boolean option.
Below line will decide on back button
https://github.com/blackmann/locationpicker/blob/71cd5e6040e769a185b68b0ce1f13d5ba106ac25/lib/widgets/place_picker.dart#L149
I am here for the same request. Kindly have a look at it, users are stuck on the location_picker screen and there's no way to go back on iOS. Thanks.
I am here for the same request. if you edit the package you can get the back button, but when you update the package it is lost so I wish if this was provided as boolean option.
Below line will decide on back button
https://github.com/blackmann/locationpicker/blob/71cd5e6040e769a185b68b0ce1f13d5ba106ac25/lib/widgets/place_picker.dart#L149
Working, thanks!
Maybe some of you still wondering how to implement Back Button. Above answer is still not obvious how it should be implemented. Below are the path you should follow to get it.
- You need to get the package from github not pub.dev. I used pull request #85 to be my reference.
Note: one of the bad things is whenever the pull request get updated, will be immediately reflected in you application so you might create fork it and modify the changes and refer to your repo.
- Refer to github repo instead of pub.dev in your
pubspec.ymlfile
place_picker:
git:
url: https://github.com/Lzyct/locationpicker.git
# ref: branch_name # if branch not the master
# rev: commit_hash # if you want to get specific commit
- In your code
LocationResult? result = await Navigator.of(context).push(MaterialPageRoute(
builder: (context) => PlacePicker(
"API_KEY",
// important to be added
appBarOptions: AppBarOptions(showBackButton: true),
),
),
);