A new flutter plugin project.
For help getting started with Flutter, view our online documentation.
For help on editing plugin code, view the documentation.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bluetooth_classic/src/flutter_bluetooth_classic.dart';
void main() => runApp(new MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _platformVersion = 'Unknown';
@override
initState() {
super.initState();
initPlatformState();
}
// Platform messages are asynchronous, so we initialize in an async method.
initPlatformState() async {
String platformVersion;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
platformVersion = await FlutterBluetoothClassic.platformVersion;
} on PlatformException {
platformVersion = 'Failed to get platform version.';
}
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
if (!mounted)
return;
setState(() {
_platformVersion = platformVersion;
});
}
@override
Widget build(BuildContext context) {
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: new Text('Plugin example app'),
),
body: new Center(
child: new Text('Running on: $_platformVersion\n'),
),
),
);
}
}
Add this to your package's pubspec.yaml file:
dependencies:
flutter_bluetooth_classic: ^0.0.15
You can install packages from the command line:
with pub:
$ pub get
with Flutter:
$ flutter packages get
Alternatively, your editor might support pub get
or flutter packages get
.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:flutter_bluetooth_classic/flutter_bluetooth_classic.dart';
Version | Uploaded | Documentation | Archive |
---|---|---|---|
0.0.15 | May 16, 2018 |
|
|
0.0.14 | May 16, 2018 |
|
|
0.0.13 | May 16, 2018 |
|
|
0.0.12 | May 16, 2018 |
|
|
0.0.11 | May 16, 2018 |
|
|
0.0.1 | May 16, 2018 |
|
|
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
35
|
Health:
Code health derived from static analysis.
[more]
|
0
|
Maintenance:
Reflects how tidy and up-to-date the package is.
[more]
|
40
|
Overall:
Weighted score of the above.
[more]
|
26
|
We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms:
Error(s) prevent platform classification:
Fix dependencies in
pubspec.yaml
.
Fix dependencies in pubspec.yaml
.
Running flutter packages pub upgrade
failed with the following output:
ERR: The current Dart SDK version is 2.1.1-dev.3.2.flutter-f4afaee422.
Because flutter_bluetooth_classic depends on protobuf >=0.2.0 <=0.9.0 which requires SDK version >=0.7.5 <2.0.0-∞, version solving failed.
Format lib/flutter_bluetooth_classic.dart
.
Run flutter format
to format lib/flutter_bluetooth_classic.dart
.
Format lib/gen/flutterblue_pb.dart
.
Run flutter format
to format lib/gen/flutterblue_pb.dart
.
Format lib/gen/flutterblue_pbenum.dart
.
Run flutter format
to format lib/gen/flutterblue_pbenum.dart
.
Fix additional 9 files with analysis or formatting issues.
Additional issues in the following files:
lib/gen/flutterblue_pbjson.dart
(Run flutter format
to format lib/gen/flutterblue_pbjson.dart
.)lib/gen/flutterblue_pbserver.dart
(Run flutter format
to format lib/gen/flutterblue_pbserver.dart
.)lib/src/bluetooth_characteristic.dart
(Run flutter format
to format lib/src/bluetooth_characteristic.dart
.)lib/src/bluetooth_descriptor.dart
(Run flutter format
to format lib/src/bluetooth_descriptor.dart
.)lib/src/bluetooth_device.dart
(Run flutter format
to format lib/src/bluetooth_device.dart
.)lib/src/bluetooth_service.dart
(Run flutter format
to format lib/src/bluetooth_service.dart
.)lib/src/constants.dart
(Run flutter format
to format lib/src/constants.dart
.)lib/src/flutter_bluetooth_classic.dart
(Run flutter format
to format lib/src/flutter_bluetooth_classic.dart
.)lib/src/guid.dart
(Run flutter format
to format lib/src/guid.dart
.)Fix platform conflicts. (-20 points)
Error(s) prevent platform classification:
Fix dependencies in pubspec.yaml
.
Make sure dartdoc
successfully runs on your package's source files. (-10 points)
Dependencies were not resolved.
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.
Package | Constraint | Resolved | Available |
---|---|---|---|
Direct dependencies | |||
Dart SDK | >=2.0.0-dev.28.0 <3.0.0 |