v1.1.3
bluetoothadapter
一個 Flutter 外掛,用於為 **僅 Android** 暴露藍牙適配器的功能。
22喜歡 63近 30 天下載40Pub 分數
平台暫無資料
GeekyAnts/flutter-bluetooth-adapter open-source repository details.
以下為英文專案原文快照,最新內容請造訪 GitHub。
A Flutter plugin to expose the features of Bluetooth Adapter for Android only.
The primary purpose of this project was to communicate between flutter and Rasburry Pie using Bluetooth.
For a full example please check /example folder. Here are only the most important parts of the code to illustrate how to use the library.
//Initiatinng the bluetooth adapter
Bluetoothadapter flutterbluetoothadapter = Bluetoothadapter();
//Listening to the connection status listener
String _connectionStatus = "NONE";
StreamSubscription _btConnectionStatusListener =flutterbluetoothadapter.connectionStatus().listen((dynamic status) {
setState(() {
_connectionStatus = status.toString();
});
});
//Listening to the recieved messages
String _recievedMessage;
StreamSubscription _btReceivedMessageListener = flutterbluetoothadapter.receiveMessages().listen((dynamic newMessage) {
setState(() {
_recievedMessage = newMessage.toString();
});
});
List<BtDevice> devices = await flutterbluetoothadapter.getDevices();
await flutterbluetoothadapter.getDevice(deviceAddress);
await flutterbluetoothadapter.startServer();
flutterbluetoothadapter.startClient(devices.indexOf(element), true);
flutterbluetoothadapter.sendMessage(messageString);
await flutterbluetoothadapter.checkBluetooth(); //returns bool
flutterbluetoothadapter.initBlutoothConnection(uuid);
依賴清單 2 項
{"sdk":"flutter"}{"sdk":"flutter"}先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗