bt_classic: A Flutter Plugin for Bluetooth Classic Communication

🔥 Introducing bt_classic — Seamless Bluetooth Classic Communication in Flutter
Today I’m excited to share a powerful new Flutter plugin for Android: bt_classic! This robust library enables easy Bluetooth Classic communication, including host/server support, text messaging, and file transfer capabilities—all with Dart 3 compatibility. Launched just 16 hours ago, it’s already primed for serious adoption (pub.dev).
🚀 Why Bluetooth Classic?
Many Bluetooth plugins focus on BLE (Bluetooth Low Energy), which excels in sensors and wearables but fails to support traditional devices like printers, Arduino HC‑05/06 modules, headphones, or gamepads. bt_classic fills that gap, offering full RGB/ACP functionality for classic devices via RFCOMM—just the right tool for these real‑world use cases (pub.dev).
📦 Installing bt_classic
Add the simple one-liner to your pubspec.yaml
:
dependencies:
bt_classic: ^1.0.2
That’s it! The package is compatible with Dart 3 and tailored for Android, requiring no complex setup. (pub.dev, api.flutter.dev)
💡 Core Features
Here’s what bt_classic brings to the table:
-
✅ Host/server functionality: Act as either a client or server—versatile for peer-to-peer or IoT setups.
-
✉️ Text messaging: Send and receive strings easily.
-
📁 File transfer: Handle file streams to and from the connected device.
-
⚙️ Device discovery: Scan, pair, connect, and transfer—end to end.
All within an intuitive Dart/Flutter-friendly API. (pub.dev, pub.dev, github.com)
📋 Quickstart Example
Here’s a basic sample to get you started:
import 'package:bt_classic/bt_classic.dart';
final bt = BtClassic(); // rename accordingly
await bt.initPermissions(); // Request Android permissions
// Discover nearby devices
final devices = await bt.getPairedDevices();
print('Paired: $devices');
// Connect to a device (passive/server or active/client)
await bt.connect(address: devices.first.address);
await bt.sendMessage('Hello!');
// Listen for incoming messages
bt.onMessageReceived().listen((msg) {
print('Received: $msg');
});
// Send a file
await bt.sendFile('/path/to/file.dat');
// Disconnect when done
await bt.disconnect();
You can also host a server that accepts connections—check the example in the repository or Pub.dev for full details. (stackoverflow.com, pub.dev)
📚 Resources & Documentation
-
✅ Pub.dev: Browse all versions, metadata, and API docs (pub.dev)
-
🔍 GitHub repo: Report issues, view source, and contribute
-
⚙️ Example app: Ready-to-run demos included in the package
🏅 Why Choose bt_classic?
Feature | bt_classic | Other Plugins |
---|---|---|
Bluetooth Classic Support | ✅ | ❌ (BLE only) |
Text & File Transfer | ✅ | ❓ |
Host/Client Role Support | ✅ | ❌ |
Dart 3 Compatible | ✅ | Mixed |
Actively Maintained | ✅ | Varies |
If your app needs traditional Bluetooth device communication—especially peer-to-peer messaging or sending files—bt_classic is an excellent choice.
🧠 Tips for Integration
-
Permissions: Make sure to request relevant Android permissions (e.g.,
BLUETOOTH_SCAN
,BLUETOOTH_CONNECT
, location). -
Error Handling: Monitor connection and messaging streams to manage disconnects and retries.
-
Multithreading: Manage multiple connections with isolates or dedicated services if needed.
-
Testing: Pair with sample devices (like HC‑05 modules) to test streaming, latency, and reliability.
🎯 What’s Next
For future releases, I plan to add:
-
🔒 Support for encryption or secure pairing
-
📦 MacOS/Windows support
-
🔄 Automatic reconnection features
-
📊 Performance improvements and lower latency
🌐 Get It Now
Start by adding bt_classic to your project:
dependencies:
bt_classic: ^1.0.2
Explore the example folder, read through the API docs, and let me know your feedback or questions. Your input helps shape future enhancements!
Let’s push the boundaries of Flutter by enabling Bluetooth Classic connectivity—happy coding! 🚀

As developers, we all want to write code that is easy to understand, maintain, and extend over time. Unfortunately, achieving…