BtcPlatformCapabilities class Models
Reports the Bluetooth Classic capabilities of the current platform.
Use FlutterClassicBluetooth.getPlatformCapabilities to obtain this. Check capabilities before calling platform-specific features to avoid BtcUnsupportedException.
final caps = await bluetooth.getPlatformCapabilities();
if (caps.canDiscoverDevices) {
await bluetooth.startDiscovery();
}
Constructors
- BtcPlatformCapabilities({bool canEnableBluetooth = false, bool canDisableBluetooth = false, bool canDiscoverDevices = false, bool canGetPairedDevices = false, bool canBondDevices = false, bool canUnbondDevices = false, bool canCreateServer = false, bool canSetDiscoverable = false, bool supportsMultipleConnections = false, bool supportsSecureConnection = false, bool supportsInsecureConnection = false, bool requiresMfiCertification = false, String? platformNote})
-
const
- BtcPlatformCapabilities.fromMap(Map map)
-
Creates BtcPlatformCapabilities from a platform channel map.
factory
Properties
- canBondDevices → bool
-
Whether the platform can programmatically initiate pairing.
final
- canCreateServer → bool
-
Whether the platform can create an RFCOMM server socket.
final
- canDisableBluetooth → bool
-
Whether the platform can programmatically disable Bluetooth.
final
- canDiscoverDevices → bool
-
Whether the platform supports discovering nearby devices.
final
- canEnableBluetooth → bool
-
Whether the platform can programmatically enable Bluetooth.
final
- canGetPairedDevices → bool
-
Whether the platform can retrieve previously paired devices.
final
- canSetDiscoverable → bool
-
Whether the platform can make the device discoverable to others.
final
- canUnbondDevices → bool
-
Whether the platform can programmatically remove a bond.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- platformNote → String?
-
Optional note describing platform-specific limitations.
final
- requiresMfiCertification → bool
-
Whether the platform requires MFi certification for accessories.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- supportsInsecureConnection → bool
-
Whether the platform supports unauthenticated RFCOMM connections.
final
- supportsMultipleConnections → bool
-
Whether the platform supports multiple simultaneous connections.
final
- supportsSecureConnection → bool
-
Whether the platform supports authenticated/encrypted RFCOMM connections.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> - Converts to a map for platform channel communication.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited