ywz_blue_plugin 0.0.2

ywz_blue_plugin #

A blue Flutter plugin.

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.

--------------------文档----------------------

##创建BlueManage BlueManage instance = BlueManage.instance;

##开始搜索 startScan(Function(int code) function);

##停止搜索 stopScan();

##连接 Future

##断开连接 disConnect(BluetoothDevice device);

##获取电量信息 [0]是电量,[1]是电量状态 Future<List

##版本信息 Future<List

##硬件配置信息 Future<List

##设置硬件监听 setOnAlarmChange(String deviceId, void onData(int event));

##设置电池电量监听 setOnElectricityChange(String deviceId, void onData(List

##呼叫报警器 Future

##解除预警 Future

##设置预警状态 Future

##报警器关机 Future

##设置硬件声音 open : true 开启 flase 关闭 Future

class BlueManage { ...

 //单击
  SINGLE ;

  //双击
  TWO;

  //长按
  LONG;

  //拔出拉环
  PULLOUT;

  //插入拉环
  PULLIN;

  //没充电
  BATTERY0;

  //充电中
  BATTERY1;

  //充满电
  BATTERY2;

  //低电量
  BATTERY3;

...

}

class Contans { ...

//搜索硬件成功
SUCCESS;

//搜索硬件失败
FAILURE;

//错误
ERROR;

//未知原因,请联系技术wechat: feifei254 email: sunyifei2016@gmail.com
UNKNOWN;

//不支持蓝牙
UNAVAILABLE;

//蓝牙关闭
BLUE_OFF;

...

}

-------------------API---------------------------

API Document Version :0.0.1

//Creat BlueManage BlueManage instance = BlueManage.instance;

//Start searching startScan(Function(int code) function);

//Stop searching stopScan();

//Connect Future connect(BlueDevice blueDevice);

//Disconnect disConnect(BluetoothDevice device);

//Get battery electricity information [0] Battery electricity,[1] Battery status Future

//Version information Future

//Hardware configuration Future

//Setting up hardware monitoring setOnAlarmChange(String deviceId, void onData(int event));

//Setting up battery electricity monitoring setOnElectricityChange(String deviceId, void onData(List event));

//Call alarm Future CallAlarm(String deviceId);

//Disarming the alarm Future disWarning(String deviceId);

//Setting up warning state Future setWarningSate(String deviceId, bool result);

//Power off Future powerOff(String deviceId);

//Setting up hardware voice open : true turn on flase turn off Future setAlarmVoice(String deviceId, bool open);

class BlueManage {

...

//Click   
SINGLE ;  

//Double-click   
TWO;  
  
//Long press   
LONG;  

//Pull out pull ring   
PULLOUT;

//Insert pull ring   
PULLIN; 

//No charge   
BATTERY0;    

//Charging   
BATTERY1;   

//Full charge   
BATTERY2;   

//Low power   
BATTERY3;  

... 

}

class Contans {

...

//Search hardware success 

SUCCESS; 

//Search hardware failed 

FAILURE;  

//Wrong 

ERROR;  

//For unknown reason

UNKNOWN;  

//No-support bluetooth 

UNAVAILABLE;  

//Bluetooth off 

BLUE_OFF;  

... 

}

0.0.2 #

  • TODO: Describe initial release.

example/README.md

ywz_blue_plugin_example #

Demonstrates how to use the ywz_blue_plugin plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  ywz_blue_plugin: ^0.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:ywz_blue_plugin/ywz_blue_plugin.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
9
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

We analyzed this package on Aug 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

73 out of 73 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/BlueManage.dart. (-0.50 points)

Analysis of lib/src/BlueManage.dart reported 1 hint:

line 170 col 16: Name non-constant identifiers using lowerCamelCase.

Format lib/src/BlueDevice.dart.

Run flutter format to format lib/src/BlueDevice.dart.

Format lib/src/Contans.dart.

Run flutter format to format lib/src/Contans.dart.

Format lib/src/HexUtils.dart.

Run flutter format to format lib/src/HexUtils.dart.

Format lib/ywz_blue_plugin.dart.

Run flutter format to format lib/ywz_blue_plugin.dart.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
flutter_blue ^0.6.0+2 0.6.0+3
Transitive dependencies
charcode 1.1.2
collection 1.14.11 1.14.12
convert 2.1.1
fixnum 0.10.9
meta 1.1.6 1.1.7
protobuf 0.13.15
rxdart 0.22.1+1
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test