Update enableLocationService method (#19)

* enableLocationService return type changed to Future<bool>

* callback added to enableLocationService

* typos fixes #15

* fix #15 added to changelog and bug fixes
This commit is contained in:
Gourav Saini
2020-08-15 18:02:14 +05:30
committed by GitHub
parent 81519d7571
commit e7edb9865b
15 changed files with 295 additions and 115 deletions

View File

@@ -112,8 +112,14 @@ class _MyBodyState extends State<Body> {
),
RaisedButton(
child: Text("enableLocationServices"),
onPressed: () {
Nearby().enableLocationServices();
onPressed: () async {
if (await Nearby().enableLocationServices()) {
Scaffold.of(context).showSnackBar(
SnackBar(content: Text("Location Service Enabled :)")));
} else {
Scaffold.of(context).showSnackBar(
SnackBar(content: Text("Enabling Location Service Failed :(")));
}
},
),
],