updated nearby to version 17.0.0, added location enabling and checking utility method, version 1.1.0 published

This commit is contained in:
Prerak Mann
2020-04-14 21:39:10 +05:30
parent 0f2a651519
commit d89c8b3211
17 changed files with 237 additions and 54 deletions

17
example/android/.project Normal file
View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>android</name>
<comment>Project android_ created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/usr/lib/jvm/java-11-openjdk-amd64
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment>Project app created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,2 @@
connection.project.dir=..
eclipse.preferences.version=1

View File

@@ -1,3 +1,4 @@
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true

View File

@@ -68,8 +68,8 @@ class _MyBodyState extends State<Body> {
),
RaisedButton(
child: Text("askLocationPermission"),
onPressed: () async {
await Nearby().askLocationPermission();
onPressed: () {
Nearby().askLocationPermission();
},
),
RaisedButton(
@@ -88,8 +88,34 @@ class _MyBodyState extends State<Body> {
),
RaisedButton(
child: Text("askExternalStoragePermission"),
onPressed: () {
Nearby().askExternalStoragePermission();
},
),
],
),
Divider(),
Text("Location Enabled"),
Wrap(
children: <Widget>[
RaisedButton(
child: Text("checkLocationEnabled"),
onPressed: () async {
await Nearby().askExternalStoragePermission();
if (await Nearby().checkLocationEnabled()) {
Scaffold.of(context).showSnackBar(SnackBar(
content:
Text("Location is ON :)")));
} else {
Scaffold.of(context).showSnackBar(SnackBar(
content: Text(
"Location is OFF :(")));
}
},
),
RaisedButton(
child: Text("enableLocationServices"),
onPressed: () {
Nearby().enableLocationServices();
},
),
],
@@ -113,7 +139,7 @@ class _MyBodyState extends State<Body> {
showSnackbar("Disconnected: " + id);
},
);
showSnackbar("ADVERTISING: "+a.toString());
showSnackbar("ADVERTISING: " + a.toString());
} catch (exception) {
showSnackbar(exception);
}

View File

@@ -108,7 +108,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.3"
version: "1.1.0"
path:
dependency: transitive
description: