diff --git a/README.md b/README.md index d5ef4b7..df11e33 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# esc_pos_bluetooth +# esc_pos_bluetooth_plus [![Pub Version](https://img.shields.io/pub/v/esc_pos_bluetooth)](https://pub.dev/packages/esc_pos_bluetooth) diff --git a/example/blue/.metadata b/example/blue/.metadata index 1b5cec0..a679e72 100644 --- a/example/blue/.metadata +++ b/example/blue/.metadata @@ -4,7 +4,27 @@ # This file should be version controlled and should not be manually edited. version: - revision: 27321ebbad34b0a3fafe99fac037102196d655ff - channel: stable + revision: "c519ee916eaeb88923e67befb89c0f1dabfa83e6" + channel: "stable" project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: c519ee916eaeb88923e67befb89c0f1dabfa83e6 + base_revision: c519ee916eaeb88923e67befb89c0f1dabfa83e6 + - platform: android + create_revision: c519ee916eaeb88923e67befb89c0f1dabfa83e6 + base_revision: c519ee916eaeb88923e67befb89c0f1dabfa83e6 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/example/blue/analysis_options.yaml b/example/blue/analysis_options.yaml new file mode 100644 index 0000000..fa6a066 --- /dev/null +++ b/example/blue/analysis_options.yaml @@ -0,0 +1,26 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/example/blue/android/.gitignore b/example/blue/android/.gitignore index bc2100d..55afd91 100644 --- a/example/blue/android/.gitignore +++ b/example/blue/android/.gitignore @@ -5,3 +5,9 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/example/blue/android/app/build.gradle b/example/blue/android/app/build.gradle index 9be8e53..24384d0 100644 --- a/example/blue/android/app/build.gradle +++ b/example/blue/android/app/build.gradle @@ -8,7 +8,7 @@ if (localPropertiesFile.exists()) { def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") + throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') diff --git a/example/blue/android/app/src/main/AndroidManifest.xml b/example/blue/android/app/src/main/AndroidManifest.xml index ebf0490..50f7809 100644 --- a/example/blue/android/app/src/main/AndroidManifest.xml +++ b/example/blue/android/app/src/main/AndroidManifest.xml @@ -1,10 +1,10 @@ - + + + + + CFBundleVersion 1.0 MinimumOSVersion - 8.0 + 12.0 diff --git a/example/blue/ios/Podfile b/example/blue/ios/Podfile index 3aee41e..414ba51 100644 --- a/example/blue/ios/Podfile +++ b/example/blue/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '9.0' +# platform :ios, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -10,82 +10,29 @@ project 'Runner', { 'Release' => :release, } -def parse_KV_file(file, separator='=') - file_abs_path = File.expand_path(file) - if !File.exists? file_abs_path - return []; +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end - generated_key_values = {} - skip_line_start_symbols = ["#", "/"] - File.foreach(file_abs_path) do |line| - next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } - plugin = line.split(pattern=separator) - if plugin.length == 2 - podname = plugin[0].strip() - path = plugin[1].strip() - podpath = File.expand_path("#{path}", file_abs_path) - generated_key_values[podname] = podpath - else - puts "Invalid plugin specification: #{line}" - end - end - generated_key_values -end - -target 'Runner' do - use_frameworks! - use_modular_headers! - - # Flutter Pod - - copied_flutter_dir = File.join(__dir__, 'Flutter') - copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework') - copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec') - unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) - # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. - # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. - # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. - generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') - unless File.exist?(generated_xcode_build_settings_path) - raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) - cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; - - unless File.exist?(copied_framework_path) - FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) - end - unless File.exist?(copied_podspec_path) - FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) - end + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end - # Keep pod path relative so it can be checked into Podfile.lock. - pod 'Flutter', :path => 'Flutter' +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - # Plugin Pods +flutter_ios_podfile_setup - # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock - # referring to absolute paths on developers' machines. - system('rm -rf .symlinks') - system('mkdir -p .symlinks/plugins') - plugin_pods = parse_KV_file('../.flutter-plugins') - plugin_pods.each do |name, path| - symlink = File.join('.symlinks', 'plugins', name) - File.symlink(path, symlink) - pod name, :path => File.join(symlink, 'ios') - end +target 'Runner' do + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end -# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. -install! 'cocoapods', :disable_input_output_paths => true - post_install do |installer| installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['ENABLE_BITCODE'] = 'NO' - config.build_settings['SWIFT_VERSION'] = '4.2' # <--- add this - end + flutter_additional_ios_build_settings(target) end end diff --git a/example/blue/ios/Podfile.lock b/example/blue/ios/Podfile.lock index 3b21092..5638c84 100644 --- a/example/blue/ios/Podfile.lock +++ b/example/blue/ios/Podfile.lock @@ -4,17 +4,15 @@ PODS: - Flutter (1.0.0) - flutter_bluetooth_basic (0.0.1): - Flutter - - path_provider (0.0.1): - - Flutter - - path_provider_macos (0.0.1): + - path_provider_foundation (0.0.1): - Flutter + - FlutterMacOS DEPENDENCIES: - charset_converter (from `.symlinks/plugins/charset_converter/ios`) - Flutter (from `Flutter`) - flutter_bluetooth_basic (from `.symlinks/plugins/flutter_bluetooth_basic/ios`) - - path_provider (from `.symlinks/plugins/path_provider/ios`) - - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) EXTERNAL SOURCES: charset_converter: @@ -23,18 +21,15 @@ EXTERNAL SOURCES: :path: Flutter flutter_bluetooth_basic: :path: ".symlinks/plugins/flutter_bluetooth_basic/ios" - path_provider: - :path: ".symlinks/plugins/path_provider/ios" - path_provider_macos: - :path: ".symlinks/plugins/path_provider_macos/ios" + path_provider_foundation: + :path: ".symlinks/plugins/path_provider_foundation/darwin" SPEC CHECKSUMS: - charset_converter: 215c7b04932ec2b9ba43be96a9bc34afed3e5322 - Flutter: 0e3d915762c693b495b44d77113d4970485de6ec - flutter_bluetooth_basic: 0e4e27e22b50b3a25cc1d1e131953feb4af414f4 - path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d - path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0 + charset_converter: 82bc1d2e3c70dcb51bf769e9772e3ae5b2571695 + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + flutter_bluetooth_basic: 0b5a7ff38766503fc8d2cb4380c1ceda051c7b79 + path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564 -PODFILE CHECKSUM: ae34db30f861e93537b77c454f870f0f18e8deef +PODFILE CHECKSUM: 1a782344d33c12ced0182eeab11e8668d253eb48 -COCOAPODS: 1.8.4 +COCOAPODS: 1.16.2 diff --git a/example/blue/ios/Runner.xcodeproj/project.pbxproj b/example/blue/ios/Runner.xcodeproj/project.pbxproj index 6063b8c..edaa50a 100644 --- a/example/blue/ios/Runner.xcodeproj/project.pbxproj +++ b/example/blue/ios/Runner.xcodeproj/project.pbxproj @@ -3,18 +3,18 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 5A587BDB522F8B4D2DFB35F2 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0CDB5799CDE7EA91C95CF7E2 /* libPods-Runner.a */; }; 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - 9BF580C952D09CCF033A2F91 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28A617744456BDAEBB0A61C4 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -31,9 +31,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0CDB5799CDE7EA91C95CF7E2 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 28A617744456BDAEBB0A61C4 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 31A8528493424BB47F417B49 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 4DBC88598EB83611427B342E /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; @@ -56,7 +56,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9BF580C952D09CCF033A2F91 /* Pods_Runner.framework in Frameworks */, + 5A587BDB522F8B4D2DFB35F2 /* libPods-Runner.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -130,7 +130,7 @@ A12430A4DEE0E50A7AF77B73 /* Frameworks */ = { isa = PBXGroup; children = ( - 28A617744456BDAEBB0A61C4 /* Pods_Runner.framework */, + 0CDB5799CDE7EA91C95CF7E2 /* libPods-Runner.a */, ); name = Frameworks; sourceTree = ""; @@ -149,7 +149,7 @@ 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - DE9090B956159A2A305EA0E1 /* [CP] Embed Pods Frameworks */, + C507C1459FEBA09BBFEEDE01 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -166,7 +166,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = "The Chromium Authors"; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -232,10 +232,12 @@ }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -246,6 +248,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -258,19 +261,22 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - DE9090B956159A2A305EA0E1 /* [CP] Embed Pods Frameworks */ = { + C507C1459FEBA09BBFEEDE01 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh", + "${PODS_CONFIGURATION_BUILD_DIR}/path_provider_foundation/path_provider_foundation_privacy.bundle", ); - name = "[CP] Embed Pods Frameworks"; + name = "[CP] Copy Pods Resources"; outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/path_provider_foundation_privacy.bundle", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -310,7 +316,6 @@ /* Begin XCBuildConfiguration section */ 249021D3217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -350,7 +355,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -372,7 +377,10 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -385,7 +393,6 @@ }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -431,7 +438,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -441,7 +448,6 @@ }; 97C147041CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -481,7 +487,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -503,7 +509,10 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -527,7 +536,10 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", diff --git a/example/blue/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/example/blue/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 1d526a1..919434a 100644 --- a/example/blue/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/example/blue/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/example/blue/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/blue/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index ad6250a..5e31d3d 100644 --- a/example/blue/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/blue/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ bluetooth-central bluetooth-peripheral + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + diff --git a/example/blue/lib/main.dart b/example/blue/lib/main.dart index 108d463..d9191f9 100644 --- a/example/blue/lib/main.dart +++ b/example/blue/lib/main.dart @@ -1,12 +1,8 @@ -import 'dart:io'; -import 'dart:typed_data'; import 'package:intl/intl.dart'; -import 'package:qr_flutter/qr_flutter.dart'; -import 'package:path_provider/path_provider.dart'; import 'package:flutter/services.dart'; import 'package:image/image.dart'; -import 'package:esc_pos_utils/esc_pos_utils.dart'; -import 'package:esc_pos_bluetooth/esc_pos_bluetooth.dart'; +import 'package:esc_pos_utils_plus/esc_pos_utils_plus.dart'; +import 'package:esc_pos_bluetooth_plus/esc_pos_bluetooth_plus.dart'; import 'package:flutter/material.dart' hide Image; import 'package:oktoast/oktoast.dart'; diff --git a/example/blue/pubspec.yaml b/example/blue/pubspec.yaml index f7e11c7..7c0e598 100644 --- a/example/blue/pubspec.yaml +++ b/example/blue/pubspec.yaml @@ -1,23 +1,22 @@ name: blue description: A new Flutter project. version: 1.0.0+1 +publish_to: none environment: - sdk: ">=2.12.0 <3.0.0" + sdk: '>=2.17.0 <4.0.0' dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.3 oktoast: ^3.0.0 - image: ^3.0.2 - esc_pos_bluetooth: + image: ^4.5.3 + esc_pos_bluetooth_plus: path: ../../ - esc_pos_utils: ^1.1.0 - # esc_pos_utils: - # path: ../../../esc_pos_utils + esc_pos_utils_plus: ^2.0.1+6 charset_converter: ^2.0.0 - intl: ^0.17.0 + intl: ^0.20.2 qr_flutter: ^4.0.0 path_provider: ^2.0.2 diff --git a/lib/esc_pos_bluetooth.dart b/lib/esc_pos_bluetooth_plus.dart similarity index 62% rename from lib/esc_pos_bluetooth.dart rename to lib/esc_pos_bluetooth_plus.dart index e995cf9..d70781e 100644 --- a/lib/esc_pos_bluetooth.dart +++ b/lib/esc_pos_bluetooth_plus.dart @@ -1,10 +1,13 @@ /* - * esc_pos_bluetooth + * esc_pos_bluetooth_plus * Created by Andrey Ushakov + * Further modified by Emmanuel Tarimo for Dart 3.6.1 compatibility, 2025 * * Copyright (c) 2020. All rights reserved. + * Copyright (c) 2025. All rights reserved * See LICENSE for distribution and usage details. */ + library esc_pos_bluetooth; export './src/enums.dart'; diff --git a/lib/src/enums.dart b/lib/src/enums.dart index d8211ab..8269ef2 100644 --- a/lib/src/enums.dart +++ b/lib/src/enums.dart @@ -1,8 +1,10 @@ /* - * esc_pos_bluetooth + * esc_pos_bluetooth_plus * Created by Andrey Ushakov + * Further modified by Emmanuel Tarimo for Dart 3.6.1 compatibility, 2025 * * Copyright (c) 2020. All rights reserved. + * Copyright (c) 2025. All rights reserved * See LICENSE for distribution and usage details. */ diff --git a/lib/src/printer_bluetooth_manager.dart b/lib/src/printer_bluetooth_manager.dart index b4ebc07..34a6bb0 100644 --- a/lib/src/printer_bluetooth_manager.dart +++ b/lib/src/printer_bluetooth_manager.dart @@ -1,18 +1,20 @@ /* - * esc_pos_bluetooth + * esc_pos_bluetooth_plus * Created by Andrey Ushakov + * Further modified by Emmanuel Tarimo for Dart 3.6.1 compatibility, 2025 * - * Copyright (c) 2019-2020. All rights reserved. + * Copyright (c) 2020. All rights reserved. + * Copyright (c) 2025. All rights reserved * See LICENSE for distribution and usage details. */ import 'dart:async'; import 'dart:io'; -import 'package:esc_pos_utils/esc_pos_utils.dart'; import 'package:rxdart/rxdart.dart'; -import 'package:flutter_bluetooth_basic/flutter_bluetooth_basic.dart'; import './enums.dart'; +import 'package:flutter_bluetooth_basic_updated/flutter_bluetooth_basic.dart'; + /// Bluetooth printer class PrinterBluetooth { PrinterBluetooth(this._device); @@ -55,7 +57,7 @@ class PrinterBluetoothManager { _isScanningSubscription = _bluetoothManager.isScanning.listen((isScanningCurrent) async { // If isScanning value changed (scan just stopped) - if (_isScanning.value! && !isScanningCurrent) { + if (_isScanning.value && !isScanningCurrent) { _scanResultsSubscription!.cancel(); _isScanningSubscription!.cancel(); } @@ -81,7 +83,7 @@ class PrinterBluetoothManager { const int timeout = 5; if (_selectedPrinter == null) { return Future.value(PosPrintResult.printerNotSelected); - } else if (_isScanning.value!) { + } else if (_isScanning.value) { return Future.value(PosPrintResult.scanInProgress); } else if (_isPrinting) { return Future.value(PosPrintResult.printInProgress); diff --git a/pubspec.yaml b/pubspec.yaml index a50c402..bc18c19 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,22 +1,21 @@ -name: esc_pos_bluetooth +name: esc_pos_bluetooth_plus description: The library allows to print receipts using an ESC/POS thermal Bluetooth printer. version: 0.4.1 -homepage: https://github.com/andrey-ushakov/esc_pos_bluetooth +homepage: https://github.com/e-ManueI/esc_pos_bluetooth_plus +publish_to: none environment: - sdk: ">=2.12.0 <3.0.0" + sdk: '>=2.17.0 <4.0.0' dependencies: flutter: sdk: flutter - rxdart: ^0.26.0 - esc_pos_utils: ^1.1.0 - # esc_pos_utils: - # path: ../esc_pos_utils - flutter_bluetooth_basic: ^0.1.7 + rxdart: ^0.27.0 + esc_pos_utils_plus: ^2.0.1+6 + flutter_bluetooth_basic_updated: + git: + url: https://github.com/CidQu/flutter_bluetooth_basic/ dev_dependencies: flutter_test: sdk: flutter - -flutter: diff --git a/test/esc_pos_bluetooth_test.dart b/test/esc_pos_bluetooth_test.dart index 349f625..2f6b825 100644 --- a/test/esc_pos_bluetooth_test.dart +++ b/test/esc_pos_bluetooth_test.dart @@ -1,7 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:esc_pos_bluetooth/esc_pos_bluetooth.dart'; - void main() { test('Tests not implemented', () { expect(1, 1);