diff --git a/ios/Flutter/Generated.xcconfig b/ios/Flutter/Generated.xcconfig index 60867b1..c4092cc 100644 --- a/ios/Flutter/Generated.xcconfig +++ b/ios/Flutter/Generated.xcconfig @@ -1,11 +1,11 @@ // This is a generated file; do not edit or check into version control. FLUTTER_ROOT=/home/user/development/flutter -FLUTTER_APPLICATION_PATH=/home/user/dev/inv/gemi_invoice_backup2 +FLUTTER_APPLICATION_PATH=/home/user/dev/h-1.flutter.0 COCOAPODS_PARALLEL_CODE_SIGN=true FLUTTER_TARGET=lib/main.dart FLUTTER_BUILD_DIR=build -FLUTTER_BUILD_NAME=1.0.1 -FLUTTER_BUILD_NUMBER=1 +FLUTTER_BUILD_NAME=1.5.0 +FLUTTER_BUILD_NUMBER=150 EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 EXCLUDED_ARCHS[sdk=iphoneos*]=armv7 DART_OBFUSCATION=false diff --git a/ios/Flutter/flutter_export_environment.sh b/ios/Flutter/flutter_export_environment.sh index 3d687cb..3300aa3 100755 --- a/ios/Flutter/flutter_export_environment.sh +++ b/ios/Flutter/flutter_export_environment.sh @@ -1,12 +1,12 @@ #!/bin/sh # This is a generated file; do not edit or check into version control. export "FLUTTER_ROOT=/home/user/development/flutter" -export "FLUTTER_APPLICATION_PATH=/home/user/dev/inv/gemi_invoice_backup2" +export "FLUTTER_APPLICATION_PATH=/home/user/dev/h-1.flutter.0" export "COCOAPODS_PARALLEL_CODE_SIGN=true" export "FLUTTER_TARGET=lib/main.dart" export "FLUTTER_BUILD_DIR=build" -export "FLUTTER_BUILD_NAME=1.0.1" -export "FLUTTER_BUILD_NUMBER=1" +export "FLUTTER_BUILD_NAME=1.5.0" +export "FLUTTER_BUILD_NUMBER=150" export "DART_OBFUSCATION=false" export "TRACK_WIDGET_CREATION=true" export "TREE_SHAKE_ICONS=false" diff --git a/ios/Runner/GeneratedPluginRegistrant.m b/ios/Runner/GeneratedPluginRegistrant.m index 9242567..8c2ed7c 100644 --- a/ios/Runner/GeneratedPluginRegistrant.m +++ b/ios/Runner/GeneratedPluginRegistrant.m @@ -48,12 +48,6 @@ @import permission_handler_apple; #endif -#if __has_include() -#import -#else -@import print_bluetooth_thermal; -#endif - #if __has_include() #import #else @@ -88,7 +82,6 @@ [OpenFilePlugin registerWithRegistrar:[registry registrarForPlugin:@"OpenFilePlugin"]]; [FPPPackageInfoPlusPlugin registerWithRegistrar:[registry registrarForPlugin:@"FPPPackageInfoPlusPlugin"]]; [PermissionHandlerPlugin registerWithRegistrar:[registry registrarForPlugin:@"PermissionHandlerPlugin"]]; - [PrintBluetoothThermalPlugin registerWithRegistrar:[registry registrarForPlugin:@"PrintBluetoothThermalPlugin"]]; [PrintingPlugin registerWithRegistrar:[registry registrarForPlugin:@"PrintingPlugin"]]; [FPPSharePlusPlugin registerWithRegistrar:[registry registrarForPlugin:@"FPPSharePlusPlugin"]]; [SqflitePlugin registerWithRegistrar:[registry registrarForPlugin:@"SqflitePlugin"]]; diff --git a/lib/screens/invoice_detail_page.dart b/lib/screens/invoice_detail_page.dart index 1d1e1f1..1eed9ed 100644 --- a/lib/screens/invoice_detail_page.dart +++ b/lib/screens/invoice_detail_page.dart @@ -9,8 +9,6 @@ import '../services/invoice_repository.dart'; import '../services/customer_repository.dart'; import '../services/company_repository.dart'; import 'product_picker_modal.dart'; -import 'package:print_bluetooth_thermal/print_bluetooth_thermal.dart'; -import '../services/print_service.dart'; import '../models/company_model.dart'; class InvoiceDetailPage extends StatefulWidget { @@ -145,59 +143,6 @@ class _InvoiceDetailPageState extends State { Share.share(csvData, subject: '請求書データ_CSV'); } - Future _printReceipt() async { - final printService = PrintService(); - final isConnected = await printService.isConnected; - - if (!isConnected) { - final devices = await printService.getPairedDevices(); - if (devices.isEmpty) { - if (!mounted) return; - ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text("ペアリング済みのデバイスが見つかりません。OSの設定を確認してください。"))); - return; - } - - final selected = await showDialog( - context: context, - builder: (context) => AlertDialog( - title: const Text("プリンターを選択"), - content: SizedBox( - width: double.maxFinite, - child: ListView.builder( - shrinkWrap: true, - itemCount: devices.length, - itemBuilder: (context, idx) => ListTile( - leading: const Icon(Icons.print), - title: Text(devices[idx].name ?? "Unknown Device"), - subtitle: Text(devices[idx].macAdress ?? ""), - onTap: () => Navigator.pop(context, devices[idx]), - ), - ), - ), - ), - ); - - if (selected != null) { - final ok = await printService.connect(selected.macAdress!); - if (!ok) { - if (!mounted) return; - ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text("接続に失敗しました。"))); - return; - } - } else { - return; - } - } - - final success = await printService.printReceipt(_currentInvoice); - if (!mounted) return; - if (success) { - ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text("レシートを印刷しました。"))); - } else { - ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text("印刷エラーが発生しました。"))); - } - } - @override Widget build(BuildContext context) { final fmt = NumberFormat("#,###"); @@ -570,15 +515,6 @@ class _InvoiceDetailPageState extends State { style: ElevatedButton.styleFrom(backgroundColor: Colors.green, foregroundColor: Colors.white), ), ), - const SizedBox(width: 12), - Expanded( - child: ElevatedButton.icon( - onPressed: _printReceipt, - icon: const Icon(Icons.print), - label: const Text("レシート"), - style: ElevatedButton.styleFrom(backgroundColor: Colors.blueGrey.shade800, foregroundColor: Colors.white), - ), - ), ], ); } diff --git a/lib/services/print_service.dart b/lib/services/print_service.dart index 6fe0821..e69de29 100644 --- a/lib/services/print_service.dart +++ b/lib/services/print_service.dart @@ -1,86 +0,0 @@ -import 'package:print_bluetooth_thermal/print_bluetooth_thermal.dart'; -import 'package:esc_pos_utils_plus/esc_pos_utils_plus.dart'; -import '../models/invoice_models.dart'; -import 'package:intl/intl.dart'; -import 'company_repository.dart'; - -class PrintService { - /// ペアリング済みのBluetoothデバイス一覧を取得 - Future> getPairedDevices() async { - return await PrintBluetoothThermal.pairedBluetooths; - } - - /// 指定したデバイスに接続 - Future connect(String macAddress) async { - return await PrintBluetoothThermal.connect(macPrinterAddress: macAddress); - } - - /// 接続状態の確認 - Future get isConnected async => await PrintBluetoothThermal.connectionStatus; - - /// レシートを生成して印刷 - Future printReceipt(Invoice invoice) async { - if (!await isConnected) return false; - - // 日本語フォントサポート等のために、本来は画像生成が必要な場合が多いが - // ここでは標準的なESC/POSテキスト出力を実装 - final profile = await CapabilityProfile.load(); - final generator = Generator(PaperSize.mm58, profile); - List bytes = []; - - // 自社情報の取得(税表示設定のため) - final companyRepo = CompanyRepository(); - final companyInfo = await companyRepo.getCompanyInfo(); - - // ヘッダー - bytes += generator.text( - invoice.documentTypeName, - styles: const PosStyles(align: PosAlign.center, height: PosTextSize.size2, width: PosTextSize.size2, bold: true), - ); - bytes += generator.text("--------------------------------", styles: const PosStyles(align: PosAlign.center)); - bytes += generator.text("No: ${invoice.invoiceNumber}", styles: const PosStyles(align: PosAlign.center)); - bytes += generator.text("Date: ${DateFormat('yyyy/MM/dd HH:mm').format(invoice.date)}", styles: const PosStyles(align: PosAlign.center)); - bytes += generator.text("--------------------------------", styles: const PosStyles(align: PosAlign.center)); - - bytes += generator.text("Customer:", styles: const PosStyles(bold: true)); - bytes += generator.text(invoice.customerNameForDisplay); - bytes += generator.feed(1); - - bytes += generator.text("Items:", styles: const PosStyles(bold: true)); - for (var item in invoice.items) { - bytes += generator.text(item.description); - bytes += generator.row([ - PosColumn(text: " ${item.quantity} x ${item.unitPrice}", width: 8), - PosColumn(text: "¥${item.subtotal}", width: 4, styles: const PosStyles(align: PosAlign.right)), - ]); - } - - bytes += generator.text("--------------------------------"); - bytes += generator.row([ - PosColumn(text: "Subtotal", width: 8), - PosColumn(text: "¥${invoice.subtotal}", width: 4, styles: const PosStyles(align: PosAlign.right)), - ]); - - if (companyInfo.taxDisplayMode == 'normal') { - bytes += generator.row([ - PosColumn(text: "Tax", width: 8), - PosColumn(text: "¥${invoice.tax}", width: 4, styles: const PosStyles(align: PosAlign.right)), - ]); - } else if (companyInfo.taxDisplayMode == 'text_only') { - bytes += generator.row([ - PosColumn(text: "Tax", width: 8), - PosColumn(text: "(Tax Excl.)", width: 4, styles: const PosStyles(align: PosAlign.right)), - ]); - } - - bytes += generator.row([ - PosColumn(text: companyInfo.taxDisplayMode == 'hidden' ? "TOTAL" : "TOTAL(Incl)", width: 7, styles: const PosStyles(bold: true, height: PosTextSize.size1)), - PosColumn(text: "¥${invoice.totalAmount}", width: 5, styles: const PosStyles(align: PosAlign.right, bold: true, height: PosTextSize.size1)), - ]); - - bytes += generator.feed(3); - bytes += generator.cut(); - - return await PrintBluetoothThermal.writeBytes(bytes); - } -} diff --git a/linux/flutter/ephemeral/.plugin_symlinks/geolocator_linux b/linux/flutter/ephemeral/.plugin_symlinks/geolocator_linux new file mode 120000 index 0000000..cce7c49 --- /dev/null +++ b/linux/flutter/ephemeral/.plugin_symlinks/geolocator_linux @@ -0,0 +1 @@ +/home/user/.pub-cache/hosted/pub.dev/geolocator_linux-0.2.4/ \ No newline at end of file diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 57c0f95..d66747f 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -9,7 +9,6 @@ import file_selector_macos import geolocator_apple import mobile_scanner import package_info_plus -import print_bluetooth_thermal import printing import share_plus import sqflite_darwin @@ -20,7 +19,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) - PrintBluetoothThermalPlugin.register(with: registry.registrar(forPlugin: "PrintBluetoothThermalPlugin")) PrintingPlugin.register(with: registry.registrar(forPlugin: "PrintingPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) diff --git a/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/macos/Flutter/ephemeral/Flutter-Generated.xcconfig index 2e06f3d..727e853 100644 --- a/macos/Flutter/ephemeral/Flutter-Generated.xcconfig +++ b/macos/Flutter/ephemeral/Flutter-Generated.xcconfig @@ -1,10 +1,10 @@ // This is a generated file; do not edit or check into version control. FLUTTER_ROOT=/home/user/development/flutter -FLUTTER_APPLICATION_PATH=/home/user/dev/inv/gemi_invoice_backup2 +FLUTTER_APPLICATION_PATH=/home/user/dev/h-1.flutter.0 COCOAPODS_PARALLEL_CODE_SIGN=true FLUTTER_BUILD_DIR=build -FLUTTER_BUILD_NAME=1.0.1 -FLUTTER_BUILD_NUMBER=1 +FLUTTER_BUILD_NAME=1.5.0 +FLUTTER_BUILD_NUMBER=150 DART_OBFUSCATION=false TRACK_WIDGET_CREATION=true TREE_SHAKE_ICONS=false diff --git a/macos/Flutter/ephemeral/flutter_export_environment.sh b/macos/Flutter/ephemeral/flutter_export_environment.sh index ba7ad8c..5c7456c 100755 --- a/macos/Flutter/ephemeral/flutter_export_environment.sh +++ b/macos/Flutter/ephemeral/flutter_export_environment.sh @@ -1,11 +1,11 @@ #!/bin/sh # This is a generated file; do not edit or check into version control. export "FLUTTER_ROOT=/home/user/development/flutter" -export "FLUTTER_APPLICATION_PATH=/home/user/dev/inv/gemi_invoice_backup2" +export "FLUTTER_APPLICATION_PATH=/home/user/dev/h-1.flutter.0" export "COCOAPODS_PARALLEL_CODE_SIGN=true" export "FLUTTER_BUILD_DIR=build" -export "FLUTTER_BUILD_NAME=1.0.1" -export "FLUTTER_BUILD_NUMBER=1" +export "FLUTTER_BUILD_NAME=1.5.0" +export "FLUTTER_BUILD_NUMBER=150" export "DART_OBFUSCATION=false" export "TRACK_WIDGET_CREATION=true" export "TREE_SHAKE_ICONS=false" diff --git a/pubspec.lock b/pubspec.lock index 780f650..26bec18 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,18 @@ packages: dependency: transitive description: name: archive - sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd" + sha256: a96e8b390886ee8abb49b7bd3ac8df6f451c621619f52a26e815fdcf568959ff url: "https://pub.dev" source: hosted - version: "4.0.7" + version: "4.0.9" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" async: dependency: transitive description: @@ -89,14 +97,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.7" - csslib: - dependency: transitive - description: - name: csslib - sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" - url: "https://pub.dev" - source: hosted - version: "1.0.2" cupertino_icons: dependency: "direct main" description: @@ -105,14 +105,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.8" - esc_pos_utils_plus: - dependency: "direct main" + dbus: + dependency: transitive description: - name: esc_pos_utils_plus - sha256: "2a22d281cb6f04600ba3ebd607ad8df03a4b2446d814007d22525bab4d50c2ff" + name: dbus + sha256: d0c98dcd4f5169878b6cf8f6e0a52403a9dff371a3e2f019697accbf6f44a270 url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "0.7.12" fake_async: dependency: transitive description: @@ -216,22 +216,30 @@ packages: description: flutter source: sdk version: "0.0.0" + geoclue: + dependency: transitive + description: + name: geoclue + sha256: c2a998c77474fc57aa00c6baa2928e58f4b267649057a1c76738656e9dbd2a7f + url: "https://pub.dev" + source: hosted + version: "0.1.1" geolocator: dependency: "direct main" description: name: geolocator - sha256: f62bcd90459e63210bbf9c35deb6a51c521f992a78de19a1fe5c11704f9530e2 + sha256: "79939537046c9025be47ec645f35c8090ecadb6fe98eba146a0d25e8c1357516" url: "https://pub.dev" source: hosted - version: "13.0.4" + version: "14.0.2" geolocator_android: dependency: transitive description: name: geolocator_android - sha256: fcb1760a50d7500deca37c9a666785c047139b5f9ee15aa5469fae7dbbe3170d + sha256: "179c3cb66dfa674fc9ccbf2be872a02658724d1c067634e2c427cf6df7df901a" url: "https://pub.dev" source: hosted - version: "4.6.2" + version: "5.0.2" geolocator_apple: dependency: transitive description: @@ -240,6 +248,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.13" + geolocator_linux: + dependency: transitive + description: + name: geolocator_linux + sha256: d64112a205931926f4363bb6bd48f14cb38e7326833041d170615586cd143797 + url: "https://pub.dev" + source: hosted + version: "0.2.4" geolocator_platform_interface: dependency: transitive description: @@ -272,6 +288,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.3" + gsettings: + dependency: transitive + description: + name: gsettings + sha256: "1b0ce661f5436d2db1e51f3c4295a49849f03d304003a7ba177d01e3a858249c" + url: "https://pub.dev" + source: hosted + version: "0.2.8" hooks: dependency: transitive description: @@ -280,14 +304,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.1" - html: - dependency: transitive - description: - name: html - sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602" - url: "https://pub.dev" - source: hosted - version: "0.15.6" http: dependency: transitive description: @@ -324,10 +340,10 @@ packages: dependency: transitive description: name: image_picker_android - sha256: "518a16108529fc18657a3e6dde4a043dc465d16596d20ab2abd49a4cac2e703d" + sha256: eda9b91b7e266d9041084a42d605a74937d996b87083395c5e47835916a86156 url: "https://pub.dev" source: hosted - version: "0.8.13+13" + version: "0.8.13+14" image_picker_for_web: dependency: transitive description: @@ -460,10 +476,10 @@ packages: dependency: "direct main" description: name: mobile_scanner - sha256: c6184bf2913dd66be244108c9c27ca04b01caf726321c44b0e7a7a1e32d41044 + sha256: c92c26bf2231695b6d3477c8dcf435f51e28f87b1745966b1fe4c47a286171ce url: "https://pub.dev" source: hosted - version: "7.1.4" + version: "7.2.0" native_toolchain_c: dependency: transitive description: @@ -636,10 +652,10 @@ packages: dependency: transitive description: name: petitparser - sha256: "1a97266a94f7350d30ae522c0af07890c70b8e62c71e8e3920d1db4d23c057d1" + sha256: "91bd59303e9f769f108f8df05e371341b15d59e995e6806aefab827b58336675" url: "https://pub.dev" source: hosted - version: "7.0.1" + version: "7.0.2" platform: dependency: transitive description: @@ -660,18 +676,10 @@ packages: dependency: transitive description: name: posix - sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61" + sha256: "185ef7606574f789b40f289c233efa52e96dead518aed988e040a10737febb07" url: "https://pub.dev" source: hosted - version: "6.0.3" - print_bluetooth_thermal: - dependency: "direct main" - description: - name: print_bluetooth_thermal - sha256: "17b204a5340174c02acf5f6caf7279b5000344f1f1e1bcd01dbdbf912bce6e46" - url: "https://pub.dev" - source: hosted - version: "1.1.9" + version: "6.5.0" printing: dependency: "direct main" description: @@ -889,10 +897,10 @@ packages: dependency: "direct main" description: name: uuid - sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8 + sha256: "1fef9e8e11e2991bb773070d4656b7bd5d850967a2456cfc83cf47925ba79489" url: "https://pub.dev" source: hosted - version: "4.5.2" + version: "4.5.3" vector_math: dependency: transitive description: @@ -925,14 +933,6 @@ packages: url: "https://pub.dev" source: hosted version: "5.15.0" - win_ble: - dependency: transitive - description: - name: win_ble - sha256: "2a867e13c4b355b101fc2c6e2ac85eeebf965db34eca46856f8b478e93b41e96" - url: "https://pub.dev" - source: hosted - version: "1.1.1" xdg_directories: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 9492ed0..442b69f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -45,14 +45,12 @@ dependencies: open_filex: ^4.7.0 sqflite: ^2.3.0 path: ^1.8.3 - geolocator: ^13.0.1 + geolocator: ^14.0.2 uuid: ^4.5.1 image_picker: ^1.2.1 - mobile_scanner: ^7.1.4 + mobile_scanner: ^7.2.0 package_info_plus: ^9.0.0 printing: ^5.14.2 - print_bluetooth_thermal: ^1.1.9 - esc_pos_utils_plus: ^2.0.3 dev_dependencies: flutter_test: