| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import 'package:pigeon/pigeon.dart';
- class Orientation{
- double? x;
- double? y;
- double? z;
- }
- class Position{
- double? latitude;
- double? longitude;
- double? altitude;
- double? bearing;
- double? accuracy;
- /// the speed at the time of this location in meters per second.
- double? speed;
- int? timeMs;
- }
- class SportWear{
- String? address;
- String? name;
- int? rssi;
- int? batteryLevel;
- }
- class HeartRateMeasurement{
- String? deviceMac;
- int? heartRate;
- bool? contactDetected;
- List<int?>? rrIntervals;
- int? timestampMill;
- }
- @HostApi()
- abstract class SensorApi {
- /// 获取当前位置,[force]为 false 时,
- /// 优先使用 lastPosition,为 true 强制重新获取当前位置。
- @async
- Position getCurrentPosition(bool force);
- void locationStart(int minTimeMs, double minDistanceM);
- void locationStop();
- void sportWearScanStart();
- void sportWearScanStop();
- @async
- bool askEnableBluetooth();
- @async
- void sportWearConnect(SportWear wear);
- @async
- void sportWearDisconnect(SportWear wear);
- /// 是否开启位置服务
- bool isLocationServiceOpen();
- double getYDPI();
- double getXDPI();
- /// 只需要空实现即可,class必须有函数引用才会生成代码
- void toGenAllClass(
- Orientation orientation,
- HeartRateMeasurement hrm,
- Position position,
- );
- }
|