Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import FlutterMacOS
import Foundation

import flutter_blue_plus
import flutter_blue_plus_darwin
import path_provider_foundation

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
Expand Down
22 changes: 15 additions & 7 deletions example/macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
PODS:
- flutter_blue_plus (0.0.1):
- flutter_blue_plus_darwin (0.0.2):
- Flutter
- FlutterMacOS
- FlutterMacOS (1.0.0)
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS

DEPENDENCIES:
- flutter_blue_plus (from `Flutter/ephemeral/.symlinks/plugins/flutter_blue_plus/macos`)
- flutter_blue_plus_darwin (from `Flutter/ephemeral/.symlinks/plugins/flutter_blue_plus_darwin/darwin`)
- FlutterMacOS (from `Flutter/ephemeral`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)

EXTERNAL SOURCES:
flutter_blue_plus:
:path: Flutter/ephemeral/.symlinks/plugins/flutter_blue_plus/macos
flutter_blue_plus_darwin:
:path: Flutter/ephemeral/.symlinks/plugins/flutter_blue_plus_darwin/darwin
FlutterMacOS:
:path: Flutter/ephemeral
path_provider_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin

SPEC CHECKSUMS:
flutter_blue_plus: e2868679021f19d12a8c0c58a33f1df66ec7fa6a
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
flutter_blue_plus_darwin: 20a08bfeaa0f7804d524858d3d8744bcc1b6dbc3
FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880

PODFILE CHECKSUM: b5ff078e9cf81bae88fdc8e0ce3668e57b68e9b6

COCOAPODS: 1.14.3
COCOAPODS: 1.16.2
8 changes: 4 additions & 4 deletions example/macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
331C80D4294CF70F00263BE5 = {
Expand Down Expand Up @@ -552,7 +552,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down Expand Up @@ -632,7 +632,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
Expand Down Expand Up @@ -679,7 +679,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -59,6 +59,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
6 changes: 5 additions & 1 deletion example/macos/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import Cocoa
import FlutterMacOS

@NSApplicationMain
@main
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}

override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
return true
}
}
4 changes: 3 additions & 1 deletion lib/src/extension/bluetooth_characteristic_extension.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter_blue_plus_platform_interface/flutter_blue_plus_platform_interface.dart';
import 'package:flutter_blue_plus_windows/flutter_blue_plus_windows.dart';

extension BluetoothCharacteristicExtension on BluetoothCharacteristic {
Expand All @@ -8,7 +9,8 @@ extension BluetoothCharacteristicExtension on BluetoothCharacteristic {
characteristicUuid: characteristicUuid,
descriptors: [for (final d in descriptors) d.toProto()],
properties: properties.toProto(),
primaryServiceUuid: null, // TODO: API changes
primaryServiceUuid: null,
instanceId: 0, // TODO: API changes
);
}
}
4 changes: 3 additions & 1 deletion lib/src/extension/bluetooth_descriptor_extension.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:flutter_blue_plus_platform_interface/flutter_blue_plus_platform_interface.dart';

extension BluetoothDescriptorExtension on BluetoothDescriptor {
BmBluetoothDescriptor toProto() {
Expand All @@ -7,7 +8,8 @@ extension BluetoothDescriptorExtension on BluetoothDescriptor {
serviceUuid: serviceUuid,
characteristicUuid: characteristicUuid,
descriptorUuid: descriptorUuid,
primaryServiceUuid: null, // TODO: API changes
primaryServiceUuid: null,
instanceId: 0, // TODO: API changes
);
}
}
1 change: 1 addition & 0 deletions lib/src/extension/bluetooth_service_extension.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter_blue_plus_platform_interface/flutter_blue_plus_platform_interface.dart';
import 'package:flutter_blue_plus_windows/flutter_blue_plus_windows.dart';

extension BluetoothServiceExtension on BluetoothService {
Expand Down
1 change: 1 addition & 0 deletions lib/src/extension/characteristic_properties_extension.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:flutter_blue_plus_platform_interface/flutter_blue_plus_platform_interface.dart';

extension CharacteristicPropertiesExtension on CharacteristicProperties {
BmCharacteristicProperties toProto() {
Expand Down
6 changes: 4 additions & 2 deletions lib/src/windows/bluetooth_characteristic_windows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class BluetoothCharacteristicWindows extends BluetoothCharacteristic {
serviceUuid: descriptor.serviceUuid,
characteristicUuid: descriptor.characteristicUuid,
descriptorUuid: descriptor.uuid,
primaryServiceUuid: null, // TODO: API changes
primaryServiceUuid: null,
instanceId: 0, // TODO: API changes
),
],
properties: BmCharacteristicProperties(
Expand All @@ -46,7 +47,8 @@ class BluetoothCharacteristicWindows extends BluetoothCharacteristic {
// TODO: implementation missing
indicateEncryptionRequired: false,
),
primaryServiceUuid: null, // TODO: API changes
primaryServiceUuid: null,
instanceId: 0, // TODO: API changes
),
);

Expand Down
1 change: 1 addition & 0 deletions lib/src/windows/bluetooth_device_windows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ class BluetoothDeviceWindows extends FBP.BluetoothDevice {

Future<void> createBond({
int timeout = 90, // TODO: implementation missing
Uint8List? pin,
}) async {
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pin parameter is added to match the API signature but is not used in the implementation. If WinBle.pair() doesn't support PIN-based pairing, this should be documented with a TODO comment or the parameter should be used if the underlying API supports it.

Suggested change
}) async {
}) async {
// TODO: The 'pin' parameter is currently unused because WinBle.pair() does not support PIN-based pairing.
// If WinBle adds support for PIN-based pairing in the future, update this method to use the 'pin' parameter.

Copilot uses AI. Check for mistakes.
try {
await WinBle.pair(_address);
Expand Down
9 changes: 9 additions & 0 deletions lib/src/windows/flutter_blue_plus_windows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ class FlutterBluePlusWindows {
// TODO: compare with original lib
static Stream<List<ScanResult>> get scanResults => _scanResultsList.stream;

static Stream<List<ScanResult>> get onScanResults {
if (isScanningNow) {
return _scanResultsList.stream;
} else {
// skip previous results & push empty list
return _scanResultsList.stream.skip(1).newStreamWithInitialValue([]);
}
}

static Stream<BluetoothAdapterState> get adapterState async* {
await _initialize();
yield _state;
Expand Down
1 change: 1 addition & 0 deletions lib/src/windows/windows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:developer';
import 'dart:io';
import 'dart:typed_data';

import 'package:flutter_blue_plus_platform_interface/flutter_blue_plus_platform_interface.dart';
import 'package:flutter_blue_plus_windows/flutter_blue_plus_windows.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart' as FBP;

Expand Down
5 changes: 5 additions & 0 deletions lib/src/wrapper/flutter_blue_plus_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ class FlutterBluePlus {
return FBP.FlutterBluePlus.scanResults;
}

static Stream<List<ScanResult>> get onScanResults {
if (Platform.isWindows) return FlutterBluePlusWindows.onScanResults;
return FBP.FlutterBluePlus.onScanResults;
}

static bool get isScanningNow {
if (Platform.isWindows) return FlutterBluePlusWindows.isScanningNow;
return FBP.FlutterBluePlus.isScanningNow;
Expand Down
15 changes: 12 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@ name: flutter_blue_plus_windows
description: Flutter blue plus for Windows
version: 1.26.1
repository: https://github.com/chan150/flutter_blue_plus_windows
#publish_to: none
publish_to: none

environment:
sdk: ">=3.0.0 <4.0.0"

dependencies:
flutter_blue_plus: ">=1.32.4 <1.35.0"
win_ble: ">=1.1.1"
# https://pub.dev/packages/flutter_blue_plus
flutter_blue_plus: ^1.36.8
# https://pub.dev/packages/flutter_blue_plus_platform_interface
flutter_blue_plus_platform_interface: 7.0.0
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version constraint for flutter_blue_plus_platform_interface should use a caret (^) prefix or range constraint for consistency with other dependencies and to allow compatible updates. Using an exact version (7.0.0) may cause dependency resolution issues when other packages require different patch versions of the same major version.

Suggestion: Change to ^7.0.0 or ">=7.0.0 <8.0.0"

Suggested change
flutter_blue_plus_platform_interface: 7.0.0
flutter_blue_plus_platform_interface: ^7.0.0

Copilot uses AI. Check for mistakes.
# https://pub.dev/packages/stream_with_value
stream_with_value: ">=0.5.0"
# https://pub.dev/packages/win_ble
#win_ble: ">=1.1.1"
win_ble: #^1.26.1
git:
url: git@github.com:FlutterStudioIst/win_ble.git
ref: 1.1.1-fix1