Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: change flutter_blue with flutter_blue_plus #53

Merged
merged 1 commit into from
Mar 29, 2022
Merged
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
10 changes: 5 additions & 5 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_blue:
flutter_blue_plus:
dependency: transitive
description:
name: flutter_blue
name: flutter_blue_plus
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.0"
version: "1.1.2"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -206,7 +206,7 @@ packages:
name: rxdart
url: "https://pub.dartlang.org"
source: hosted
version: "0.26.0"
version: "0.27.3"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -277,4 +277,4 @@ packages:
version: "5.1.1"
sdks:
dart: ">=2.16.0 <3.0.0"
flutter: ">=1.20.0"
flutter: ">=2.5.0"
8 changes: 4 additions & 4 deletions lib/blue_print_pos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import 'package:blue_print_pos/scanner/blue_scanner.dart';
import 'package:blue_thermal_printer/blue_thermal_printer.dart' as blue_thermal;
import 'package:esc_pos_utils_plus/esc_pos_utils.dart';
import 'package:flutter/services.dart';
import 'package:flutter_blue/flutter_blue.dart' as flutter_blue;
import 'package:flutter_blue/gen/flutterblue.pb.dart' as proto;
import 'package:flutter_blue_plus/flutter_blue_plus.dart' as flutter_blue;
import 'package:flutter_blue_plus/gen/flutterblueplus.pb.dart' as proto;
import 'package:image/image.dart' as img;
import 'package:qr_flutter/qr_flutter.dart';

class BluePrintPos {
BluePrintPos._() {
_bluetoothAndroid = blue_thermal.BlueThermalPrinter.instance;
_bluetoothIOS = flutter_blue.FlutterBlue.instance;
_bluetoothIOS = flutter_blue.FlutterBluePlus.instance;
}

static BluePrintPos get instance => BluePrintPos._();
Expand All @@ -28,7 +28,7 @@ class BluePrintPos {
blue_thermal.BlueThermalPrinter? _bluetoothAndroid;

/// This field is library to handle in iOS Platform
flutter_blue.FlutterBlue? _bluetoothIOS;
flutter_blue.FlutterBluePlus? _bluetoothIOS;

/// Bluetooth Device model for iOS
flutter_blue.BluetoothDevice? _bluetoothDeviceIOS;
Expand Down
6 changes: 3 additions & 3 deletions lib/scanner/blue_scanner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:io';

import 'package:blue_print_pos/models/blue_device.dart';
import 'package:blue_thermal_printer/blue_thermal_printer.dart' as blue_thermal;
import 'package:flutter_blue/flutter_blue.dart' as flutter_blue;
import 'package:flutter_blue_plus/flutter_blue_plus.dart' as flutter_blue;

/// This class with static method to handler scanning in Android and iOS
class BlueScanner {
Expand All @@ -26,8 +26,8 @@ class BlueScanner {
)
.toList();
} else if (Platform.isIOS) {
final flutter_blue.FlutterBlue bluetoothIOS =
flutter_blue.FlutterBlue.instance;
final flutter_blue.FlutterBluePlus bluetoothIOS =
flutter_blue.FlutterBluePlus.instance;
final List<flutter_blue.BluetoothDevice> resultDevices =
<flutter_blue.BluetoothDevice>[];

Expand Down
10 changes: 5 additions & 5 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_blue:
flutter_blue_plus:
dependency: "direct main"
description:
name: flutter_blue
name: flutter_blue_plus
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.0"
version: "1.1.2"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -199,7 +199,7 @@ packages:
name: rxdart
url: "https://pub.dartlang.org"
source: hosted
version: "0.26.0"
version: "0.27.3"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -270,4 +270,4 @@ packages:
version: "5.1.1"
sdks:
dart: ">=2.16.0 <3.0.0"
flutter: ">=1.20.0"
flutter: ">=2.5.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
flutter:
sdk: flutter
# Handler bluetooth for iOS
flutter_blue: ^0.8.0
flutter_blue_plus: ^1.1.2
# Image utilities
image: ^3.1.3
# Generate qr image painter
Expand Down