Implement hasPermissions API (#201)

* Implement hasPermissions api

* Bump minimum MacOS version to 10.15

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Rohit Sangwan
2025-12-13 02:40:21 +05:30
committed by GitHub
parent 89abb3bf03
commit 97936046e0
23 changed files with 175 additions and 36 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573
universal_ble: cf52a7b3fd2e7c14d6d7262e9fdadb72ab6b88a6
universal_ble: 65e1257dffc557cc7991a93d253beeddc7c1dc92
PODFILE CHECKSUM: 4f1c12611da7338d21589c0b2ecd6bd20b109694
+15 -1
View File
@@ -216,7 +216,20 @@ class _MyAppState extends State<MyApp> {
showSnackbar("BluetoothDisabled: $isDisabled");
},
),
if (BleCapabilities.requiresRuntimePermission)
if (BleCapabilities.requiresRuntimePermission) ...[
PlatformButton(
text: 'Has Permissions',
onPressed: () async {
try {
bool hasPermissions = await UniversalBle.hasPermissions(
withAndroidFineLocation: false,
);
showSnackbar("Has Permissions: $hasPermissions");
} catch (e) {
showSnackbar(e.toString());
}
},
),
PlatformButton(
text: 'Request Permissions',
onPressed: () async {
@@ -230,6 +243,7 @@ class _MyAppState extends State<MyApp> {
}
},
),
],
if (!isTrackingAvailabilityState)
PlatformButton(
text: 'Track Availability State',
+1 -1
View File
@@ -16,7 +16,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1
universal_ble: cf52a7b3fd2e7c14d6d7262e9fdadb72ab6b88a6
universal_ble: 65e1257dffc557cc7991a93d253beeddc7c1dc92
PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3
@@ -195,7 +195,6 @@
BF9EC7C1208428926C8C045E /* Pods-RunnerTests.release.xcconfig */,
C5F6162E162B944885A4C57E /* Pods-RunnerTests.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
@@ -575,6 +574,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
@@ -701,6 +701,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
@@ -721,6 +722,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
+4 -4
View File
@@ -214,10 +214,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
url: "https://pub.dev"
source: hosted
version: "1.16.0"
version: "1.17.0"
path:
dependency: transitive
description:
@@ -315,10 +315,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
url: "https://pub.dev"
source: hosted
version: "0.7.6"
version: "0.7.7"
typed_data:
dependency: transitive
description: