flutter_bluetooth_classic 0.0.15

flutter_bluetooth_classic #

A new flutter plugin project.

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

[0.0.1] - TODO: Add release date.

  • TODO: Describe initial release.


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 {
  _MyAppState createState() => new _MyAppState();

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

  initState() {

  // 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)

    setState(() {
      _platformVersion = platformVersion;

  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'),

Use this package as a library

1. Depend on it

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

  flutter_bluetooth_classic: ^0.0.15

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or 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:flutter_bluetooth_classic/flutter_bluetooth_classic.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.5.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.2


Detected platforms:

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running flutter pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.5.0.
 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.

Health suggestions

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.)

Maintenance issues and suggestions

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.

Package is getting outdated. (-34.79 points)

The package was last published 70 weeks ago.

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