mirror of
https://github.com/hackku21/nearby_connections.git
synced 2026-03-02 03:49:22 +00:00
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:
@@ -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 :(")));
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user