ir_sensor_plugin
此外掛程式允許 Flutter 應用程式使用紅外線傳感器。
- 星標
- 18
- 分支
- 10
- 最近推送(UTC)
- 2024年12月14日
- 專案狀態
- 未封存
原始 README
以下為英文專案原文快照,最新內容請造訪 GitHub。
ir_sensor_plugin
This plugin allows Flutter applications to make use of the Infrared Sensor.
Usage
Support only for Android. If the plugin is invoked on iOS, it will crash your app. Added permission in the Manifests:
<uses-permission android:name="android.permission.TRANSMIT_IR" />
How to use the methods
Check whether the device has an infrared emitter.
Returns "true" if the device has an infrared emitter, else "false" .
final bool hasIrEmitter = await IrSensorPlugin.hasIrEmitter;
Query the infrared transmitter's supported carrier frequencies in Hertz.
final String getCarrierFrequencies = await IrSensorPlugin.getCarrierFrequencies;
Change the frequency with which it is transmitted. Default is 38020 Hz
final String result = await IrSensorPlugin.setFrequencies(40000);
Transmit an infrared pattern, return a String "Emitting" if there was no problem in the process.
The value pattern has to be a string that contains the behavior in HEX, example:
static const TV_POWER_HEX = "0000 006d 0022 0003 00a9 00a8 0015 003f 0015
003f 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 003f
0015 003f 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015
0015 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015
0015 0040 0015 0015 0015 003f 0015 003f 0015 003f 0015 003f 0015 003f 0015
003f 0015 0702 00a9 00a8 0015 0015 0015 0e6e";
final String result = await IrSensorPlugin.transmitString(pattern: TV_POWER_HEX);
The value list has to be a list of Int, for example:
var power = [169,168,21,63,21,63,21,63,21,63,21,63,21,63,21,63,21,1794,169,168,21,21,21,3694];
final String result = await IrSensorPlugin.transmitListInt(list: power);
Getting Started
This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
使用的依賴
依賴清單 2 項
- flutter
{"sdk":"flutter"} - flutter_test開發依賴
{"sdk":"flutter"}
如何選擇適合專案的儲存庫?
先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
- 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
- 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
- 使用前在 GitHub 確認 README、授權條款與 Issues。
來源與維護
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗