├── example ├── discover_printers │ ├── ios │ │ ├── Flutter │ │ │ ├── .last_build_id │ │ │ ├── Debug.xcconfig │ │ │ ├── Release.xcconfig │ │ │ └── AppFrameworkInfo.plist │ │ ├── Runner │ │ │ ├── Runner-Bridging-Header.h │ │ │ ├── Assets.xcassets │ │ │ │ ├── LaunchImage.imageset │ │ │ │ │ ├── LaunchImage.png │ │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ │ ├── README.md │ │ │ │ │ └── Contents.json │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ │ │ └── Contents.json │ │ │ ├── AppDelegate.swift │ │ │ ├── Base.lproj │ │ │ │ ├── Main.storyboard │ │ │ │ └── LaunchScreen.storyboard │ │ │ └── Info.plist │ │ ├── Runner.xcodeproj │ │ │ ├── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ │ ├── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ │ └── Runner.xcscheme │ │ │ └── project.pbxproj │ │ ├── Runner.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── .gitignore │ │ ├── Podfile.lock │ │ └── Podfile │ ├── assets │ │ ├── logo.png │ │ └── rabbit_black.jpg │ ├── android │ │ ├── gradle.properties │ │ ├── .gitignore │ │ ├── app │ │ │ ├── src │ │ │ │ ├── main │ │ │ │ │ ├── res │ │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ └── styles.xml │ │ │ │ │ │ └── drawable │ │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── kotlin │ │ │ │ │ │ └── com │ │ │ │ │ │ │ └── example │ │ │ │ │ │ │ └── discover_printers │ │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ ├── debug │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ └── profile │ │ │ │ │ └── AndroidManifest.xml │ │ │ └── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ └── gradle-wrapper.properties │ │ ├── settings.gradle │ │ └── build.gradle │ ├── .metadata │ ├── README.md │ ├── pubspec.yaml │ ├── .gitignore │ ├── test │ │ └── widget_test.dart │ ├── pubspec.lock │ └── lib │ │ └── main.dart ├── logo.png ├── receipt.jpg └── receipt2.jpg ├── test └── esc_pos_printer_test.dart ├── lib ├── esc_pos_printer.dart └── src │ ├── enums.dart │ └── network_printer.dart ├── .metadata ├── pubspec.yaml ├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── printers.md ├── README.md ├── CHANGELOG.md ├── pubspec.lock └── analysis_options.yaml /example/discover_printers/ios/Flutter/.last_build_id: -------------------------------------------------------------------------------- 1 | 50d596c07db937a14e616078f41e1aa4 -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /example/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/logo.png -------------------------------------------------------------------------------- /example/receipt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/receipt.jpg -------------------------------------------------------------------------------- /example/receipt2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/receipt2.jpg -------------------------------------------------------------------------------- /example/discover_printers/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/assets/logo.png -------------------------------------------------------------------------------- /example/discover_printers/assets/rabbit_black.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/assets/rabbit_black.jpg -------------------------------------------------------------------------------- /example/discover_printers/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/discover_printers/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/discover_printers/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /example/discover_printers/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/discover_printers/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/discover_printers/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/discover_printers/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/discover_printers/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /test/esc_pos_printer_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:esc_pos_printer/esc_pos_printer.dart'; 3 | 4 | void main() { 5 | test('Tests not implemented', () { 6 | expect(1, 1); 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rivafarabi/esc_pos_printer/master/example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/esc_pos_printer.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * esc_pos_printer 3 | * Created by Andrey Ushakov 4 | * 5 | * Copyright (c) 2019-2020. All rights reserved. 6 | * See LICENSE for distribution and usage details. 7 | */ 8 | library esc_pos_printer; 9 | 10 | export 'src/enums.dart'; 11 | export 'src/network_printer.dart'; 12 | -------------------------------------------------------------------------------- /example/discover_printers/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 7a4c33425ddd78c54aba07d86f3f9a4a0051769b 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /example/discover_printers/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 0b8abb4724aa590dd0f429683339b1e045a1594d 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/discover_printers/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/discover_printers/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/discover_printers/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: esc_pos_printer 2 | description: The library allows to print receipts using an ESC/POS thermal WiFi printer. 3 | version: 4.1.0 4 | homepage: https://github.com/andrey-ushakov/esc_pos_printer 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | 9 | dependencies: 10 | charset_converter: ^2.0.0 11 | esc_pos_utils: 12 | git: https://github.com/rizaldi-wiratama/esc_pos_utils 13 | flutter: 14 | sdk: flutter 15 | image: ^3.0.2 16 | 17 | dev_dependencies: 18 | flutter_test: 19 | sdk: flutter 20 | 21 | flutter: 22 | -------------------------------------------------------------------------------- /example/discover_printers/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/discover_printers/android/app/src/main/kotlin/com/example/discover_printers/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.discover_printers 2 | 3 | import androidx.annotation.NonNull; 4 | import io.flutter.embedding.android.FlutterActivity 5 | import io.flutter.embedding.engine.FlutterEngine 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { 10 | GeneratedPluginRegistrant.registerWith(flutterEngine); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/discover_printers/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/discover_printers/README.md: -------------------------------------------------------------------------------- 1 | # discover_printers 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/discover_printers/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: andreydev 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /example/discover_printers/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/discover_printers/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: discover_printers 2 | description: A new Flutter project. 3 | 4 | version: 1.0.0+1 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | 9 | dependencies: 10 | charset_converter: ^1.0.3 11 | cupertino_icons: ^0.1.2 12 | esc_pos_printer: 13 | path: ../../ 14 | esc_pos_utils: ^1.0.0 15 | flutter: 16 | sdk: flutter 17 | image: ^2.1.4 18 | intl: ^0.16.1 19 | path_provider: ^1.6.5 20 | ping_discover_network: ^0.2.0+1 21 | qr_flutter: ^3.2.0 22 | wifi: ^0.1.5 23 | # esc_pos_utils: 24 | # path: ../../../esc_pos_utils 25 | 26 | dev_dependencies: 27 | flutter_test: 28 | sdk: flutter 29 | 30 | flutter: 31 | uses-material-design: true 32 | assets: 33 | - assets/logo.png 34 | - assets/rabbit_black.jpg 35 | -------------------------------------------------------------------------------- /example/discover_printers/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Exceptions to above rules. 37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 38 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - charset_converter (0.0.1): 3 | - Flutter 4 | - Flutter (1.0.0) 5 | - path_provider (0.0.1): 6 | - Flutter 7 | - wifi (0.0.1): 8 | - Flutter 9 | 10 | DEPENDENCIES: 11 | - charset_converter (from `.symlinks/plugins/charset_converter/ios`) 12 | - Flutter (from `Flutter`) 13 | - path_provider (from `.symlinks/plugins/path_provider/ios`) 14 | - wifi (from `.symlinks/plugins/wifi/ios`) 15 | 16 | EXTERNAL SOURCES: 17 | charset_converter: 18 | :path: ".symlinks/plugins/charset_converter/ios" 19 | Flutter: 20 | :path: Flutter 21 | path_provider: 22 | :path: ".symlinks/plugins/path_provider/ios" 23 | wifi: 24 | :path: ".symlinks/plugins/wifi/ios" 25 | 26 | SPEC CHECKSUMS: 27 | charset_converter: 215c7b04932ec2b9ba43be96a9bc34afed3e5322 28 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec 29 | path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c 30 | wifi: d7d77c94109e36c4175d845f0a5964eadba71060 31 | 32 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c 33 | 34 | COCOAPODS: 1.9.3 35 | -------------------------------------------------------------------------------- /example/discover_printers/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:discover_printers/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/enums.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * esc_pos_printer 3 | * Created by Andrey Ushakov 4 | * 5 | * Copyright (c) 2019-2020. All rights reserved. 6 | * See LICENSE for distribution and usage details. 7 | */ 8 | 9 | class PosPrintResult { 10 | const PosPrintResult._internal(this.value); 11 | final int value; 12 | static const success = PosPrintResult._internal(1); 13 | static const timeout = PosPrintResult._internal(2); 14 | static const printerNotSelected = PosPrintResult._internal(3); 15 | static const ticketEmpty = PosPrintResult._internal(4); 16 | static const printInProgress = PosPrintResult._internal(5); 17 | static const scanInProgress = PosPrintResult._internal(6); 18 | 19 | String get msg { 20 | if (value == PosPrintResult.success.value) { 21 | return 'Success'; 22 | } else if (value == PosPrintResult.timeout.value) { 23 | return 'Error. Printer connection timeout'; 24 | } else if (value == PosPrintResult.printerNotSelected.value) { 25 | return 'Error. Printer not selected'; 26 | } else if (value == PosPrintResult.ticketEmpty.value) { 27 | return 'Error. Ticket is empty'; 28 | } else if (value == PosPrintResult.printInProgress.value) { 29 | return 'Error. Another print in progress'; 30 | } else if (value == PosPrintResult.scanInProgress.value) { 31 | return 'Error. Printer scanning in progress'; 32 | } else { 33 | return 'Unknown error'; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | build/ 29 | 30 | # Android related 31 | **/android/**/gradle-wrapper.jar 32 | **/android/.gradle 33 | **/android/captures/ 34 | **/android/gradlew 35 | **/android/gradlew.bat 36 | **/android/local.properties 37 | **/android/**/GeneratedPluginRegistrant.java 38 | 39 | # iOS/XCode related 40 | **/ios/**/*.mode1v3 41 | **/ios/**/*.mode2v3 42 | **/ios/**/*.moved-aside 43 | **/ios/**/*.pbxuser 44 | **/ios/**/*.perspectivev3 45 | **/ios/**/*sync/ 46 | **/ios/**/.sconsign.dblite 47 | **/ios/**/.tags* 48 | **/ios/**/.vagrant/ 49 | **/ios/**/DerivedData/ 50 | **/ios/**/Icon? 51 | **/ios/**/Pods/ 52 | **/ios/**/.symlinks/ 53 | **/ios/**/profile 54 | **/ios/**/xcuserdata 55 | **/ios/.generated/ 56 | **/ios/Flutter/App.framework 57 | **/ios/Flutter/Flutter.framework 58 | **/ios/Flutter/Generated.xcconfig 59 | **/ios/Flutter/app.flx 60 | **/ios/Flutter/app.zip 61 | **/ios/Flutter/flutter_assets/ 62 | **/ios/ServiceDefinitions.json 63 | **/ios/Runner/GeneratedPluginRegistrant.* 64 | 65 | # Exceptions to above rules. 66 | !**/ios/**/default.mode1v3 67 | !**/ios/**/default.mode2v3 68 | !**/ios/**/default.pbxuser 69 | !**/ios/**/default.perspectivev3 70 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 71 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Andrey Ushakov. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following 11 | disclaimer in the documentation and/or other materials provided 12 | with the distribution. 13 | * Neither the name of the copyright holder nor the names of its 14 | contributors may be used to endorse or promote products derived 15 | from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /example/discover_printers/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | discover_printers 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /printers.md: -------------------------------------------------------------------------------- 1 | # Tested Printers 2 | Please add here printer models you have used with this library and any comments (works / something goes wrong). 3 | 4 | This will help to maintain and improve this library and to choose the right printer. 5 | 6 | Thank you for your contribution! 7 | 8 | 9 | ## WiFi/Ethernet Printers List 10 | | Model | Paper | Library Ver. | Comments | 11 | |---|---|---|---| 12 | | [Xprinter XP-N160I](http://www.xprinter.net/index.php/Product/product_detail/id/4/cid2/21/cid/1) | 80mm | 3.1.2 | `PosImageFn.graphics` doesn't work ;
everything else works (tested on Desktop with pure Dart / Android / iOS): | 13 | |[MUNBYN MU-ITPP047USEW-BK WiFi/Ethernet](https://www.amazon.de/gp/product/B07QWSDP2K/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1)|53/80mm|2.1.2|No issues (graphics & barcode not tested)| 14 | |[Star Micronics SP700 / SP742 - Ethernet](https://star-emea.com/products/sp700/)|3"|3.1.1| - DIP switch 4 must be off to enable ESC/POS mode.
- Column spacing needs some tweaking
- font sizes unavailable
- Barcode not supported
- Graphics not tested, and most likely will not work| 15 | |[Epson TM-m30 - Ethernet](https://epson.com/For-Work/Printers/POS/TM-m30-POS-3%22-Receipt-Printer/p/C31CE95012)|3"|3.1.1| No Issues found! | 16 | |[Issyzonepos 80mm Wifi Thermal Receipt](https://www.aliexpress.com/item/32985398184.html)|80mm|3.1.4|No issues graphics & barcode tested also tested)| 17 | |[HOIN HOP-H58 Bluetooth Thermal Cash Receipt Printer](https://www.aliexpress.com/item/32859843705.html)|58mm|3.1.4|No issues| 18 | |[Elgin i9 - Ethernet](https://www.americanas.com.br/produto/28943574/impressora-nao-fiscal-elgin-i9-guilhotina-usb?WT.srch=1&acc=e789ea56094489dffd798f86ff51c7a9&epar=bp_pl_00_go_inf-aces_acessorios_geral_gmv&gclid=CjwKCAjwnef6BRAgEiwAgv8mQRRqkLzg7F0l3j3rzFpYXrmi-57_YWX0OiKD5VcE7q1BG2v-qsWfyBoCF8wQAvD_BwE&i=5bac49bbeec3dfb1f8d856ec&o=5a067550eec3dfb1f8def31e&opn=YSMESP&sellerid=8829865000339)|80mm|3.2.5|No issues| 19 | |[MUNBYN MU-ITPP047-IT WiFi/Ethernet](https://www.amazon.it/Aggiorna-Stampante-Auto-Cut-Supporto-MUNBYN/dp/B079L3JLGT/ref=sr_1_3?__mk_it_IT=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=esc+pos+printer&qid=1630150820&sr=8-3)|80mm|4.0.4 (antoninobajeli pull req)|No issues - graphics & barcode tested| 20 | -------------------------------------------------------------------------------- /example/discover_printers/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.discover_printers" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'androidx.test:runner:1.1.1' 66 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 67 | } 68 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # esc_pos_printer 2 | 3 | [![Pub Version](https://img.shields.io/pub/v/esc_pos_printer)](https://pub.dev/packages/esc_pos_printer) 4 | 5 | The library allows to print receipts using an ESC/POS thermal WiFi/Ethernet printer. For Bluetooth printers, use [esc_pos_bluetooth](https://github.com/andrey-ushakov/esc_pos_bluetooth) library. 6 | 7 | It can be used in [Flutter](https://flutter.dev/) or pure [Dart](https://dart.dev/) projects. For Flutter projects, both Android and iOS are supported. 8 | 9 | To scan for printers in your network, consider using [ping_discover_network](https://pub.dev/packages/ping_discover_network) package. Note that most of the ESC/POS printers by default listen on port 9100. 10 | 11 | ## TODO (PRs are welcomed!) 12 | 13 | - Print QR Codes using the `GS ( k` command (printing QR code from an image already supported) 14 | - PDF-417 Barcodes using the `GS ( k` command 15 | - Line spacing using the `ESC 3 ` command 16 | 17 | ## How to Help 18 | 19 | - Test your printer and add it in the table: [Wifi/Network printer](https://github.com/andrey-ushakov/esc_pos_printer/blob/master/printers.md) or [Bluetooth printer](https://github.com/andrey-ushakov/esc_pos_bluetooth/blob/master/printers.md) 20 | - Test and report bugs 21 | - Share your ideas about what could be improved (code optimization, new features...) 22 | - PRs are welcomed! 23 | 24 | ## Tested Printers 25 | 26 | Here are some [printers tested with this library](printers.md). Please add the models you have tested to maintain and improve this library and help others to choose the right printer. 27 | 28 | ## Generate a Receipt 29 | 30 | ### Simple Receipt with Styles: 31 | 32 | ```dart 33 | void testReceipt(NetworkPrinter printer) { 34 | printer.text( 35 | 'Regular: aA bB cC dD eE fF gG hH iI jJ kK lL mM nN oO pP qQ rR sS tT uU vV wW xX yY zZ'); 36 | printer.text('Special 1: àÀ èÈ éÉ ûÛ üÜ çÇ ôÔ', 37 | styles: PosStyles(codeTable: 'CP1252')); 38 | printer.text('Special 2: blåbærgrød', 39 | styles: PosStyles(codeTable: 'CP1252')); 40 | 41 | printer.text('Bold text', styles: PosStyles(bold: true)); 42 | printer.text('Reverse text', styles: PosStyles(reverse: true)); 43 | printer.text('Underlined text', 44 | styles: PosStyles(underline: true), linesAfter: 1); 45 | printer.text('Align left', styles: PosStyles(align: PosAlign.left)); 46 | printer.text('Align center', styles: PosStyles(align: PosAlign.center)); 47 | printer.text('Align right', 48 | styles: PosStyles(align: PosAlign.right), linesAfter: 1); 49 | 50 | printer.text('Text size 200%', 51 | styles: PosStyles( 52 | height: PosTextSize.size2, 53 | width: PosTextSize.size2, 54 | )); 55 | 56 | printer.feed(2); 57 | printer.cut(); 58 | } 59 | ``` 60 | 61 | You can find more examples here: [esc_pos_utils](https://github.com/andrey-ushakov/esc_pos_utils). 62 | 63 | ## Print a Receipt 64 | 65 | ```dart 66 | import 'package:esc_pos_printer/esc_pos_printer.dart'; 67 | 68 | const PaperSize paper = PaperSize.mm80; 69 | final profile = await CapabilityProfile.load(); 70 | final printer = NetworkPrinter(paper, profile); 71 | 72 | final PosPrintResult res = await printer.connect('192.168.0.123', port: 9100); 73 | 74 | if (res == PosPrintResult.success) { 75 | testReceipt(printer); 76 | printer.disconnect(); 77 | } 78 | 79 | print('Print result: ${res.msg}'); 80 | ``` 81 | 82 | For a complete example, check `example/example.dart` and `example/discover_printers`. 83 | 84 | ## Test Print 85 | 86 | test receipt 87 | 88 | test receipt 89 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [4.1.0] 2 | 3 | -Null-Safety 4 | 5 | ## [4.0.3] 6 | 7 | - Added optional delay param to `disconnect` method 8 | 9 | ## [4.0.2] 10 | 11 | - Fixed IP bug 12 | 13 | ## [4.0.1] 14 | 15 | - `NetworkPrinter`: added `paperSize`, `profile`, `host`, `port` getters 16 | 17 | ## [4.0.0] 18 | 19 | - New code generation concept: instead of generating the whole ticket, commands sent separately for each command 20 | - `PrinterNetworkManager` replaced by `NetworkPrinter` 21 | - Bump esc_pos_utils 22 | 23 | ## [3.2.9] 24 | 25 | - Bump esc_pos_utils 26 | 27 | ## [3.2.8] 28 | 29 | - Bump esc_pos_utils 30 | 31 | ## [3.2.7] 32 | 33 | - Bump esc_pos_utils 34 | 35 | ## [3.2.6] 36 | 37 | - Bump esc_pos_utils 38 | 39 | ## [3.2.5] 40 | 41 | - Updated example and README (using CapabilityProfiles) 42 | - Bump esc_pos_utils 43 | 44 | ## [3.2.4] 45 | 46 | - Bump esc_pos_utils 47 | 48 | ## [3.2.3] 49 | 50 | - Bump esc_pos_utils 51 | 52 | ## [3.2.2] 53 | 54 | - Bump esc_pos_utils 55 | 56 | ## [3.2.1] 57 | 58 | - Bump esc_pos_utils 59 | 60 | ## [3.2.0] 61 | 62 | - Bump esc_pos_utils 63 | 64 | ## [3.1.6] 65 | 66 | - Bump esc_pos_utils 67 | 68 | ## [3.1.5] 69 | 70 | - Updated `esc_pos_utils` package version to `0.3.5`. 71 | 72 | ## [3.1.4] 73 | 74 | - Updated `esc_pos_utils` package version to `0.3.4`. 75 | 76 | ## [3.1.3] 77 | 78 | - Updated `esc_pos_utils` package version to `0.3.3`. 79 | 80 | ## [3.1.2] 81 | 82 | - Updated `esc_pos_utils` package version to `0.3.2`. 83 | 84 | ## [3.1.1] 85 | 86 | - Updated `esc_pos_utils` package version to `0.3.1` (Open Cash Drawer). 87 | 88 | ## [3.1.0] 89 | 90 | - Updated `esc_pos_utils` package version to `0.3.0` (Image and Barcode alignment). 91 | 92 | ## [3.0.2] 93 | 94 | - Updated `esc_pos_utils` package version 95 | 96 | ## [3.0.1] 97 | 98 | - Removed rxdart dependency 99 | 100 | ## [3.0.0] 101 | 102 | - Basic ESC/POS classes moved to [esc_pos_utils](https://github.com/andrey-ushakov/esc_pos_utils) library 103 | - Bluetooth printing moved to [esc_pos_bluetooth](https://github.com/andrey-ushakov/esc_pos_bluetooth) library 104 | - This library is used to print using a WiFi/Ethernet printer 105 | 106 | ## [2.1.2] 107 | 108 | - Bluetooth printing support for Android 109 | 110 | ## [2.1.0] 111 | 112 | - Printer class replaced by PrinterNetworkManager 113 | - Generate tickets using Ticket class 114 | - Unified interfaces for WiFi/Bluetooth printings 115 | - Better error handling using PosPrintResult class 116 | - Examples updated 117 | 118 | ## [2.0.0] 119 | 120 | - Bluetooth printers support (beta version, iOS-only) 121 | 122 | ## [1.5.0] 123 | 124 | - printlnMixedKanji merged to println 125 | - Can print rows/cols with mixed chinese/non-chinese texts 126 | 127 | ## [1.4.1] 128 | 129 | - Print mixed (chinese + latin) text. Only for printers supporting Kanji mode 130 | 131 | ## [1.4.0] 132 | 133 | - Print barcodes 134 | 135 | ## [1.3.2] 136 | 137 | - Added alternative printImageRaster method using (GS v 0) obsolete command 138 | - Code refactoring 139 | 140 | ## [1.3.1] 141 | 142 | - Removed raw lib 143 | - Code refactoring 144 | 145 | ## [1.3.0] 146 | 147 | - Image printing method has been improved 148 | - Using ESC \* command to print images instead of outdated GS v 0 149 | - Added print image Flutter example 150 | 151 | ## [1.2.0] 152 | 153 | - Printing images (beta) 154 | 155 | ## [1.1.3] 156 | 157 | - printCodeTable bug fixed 158 | - Updated test print example 159 | 160 | ## [1.1.2] 161 | 162 | - Better alignment 163 | 164 | ## [1.1.1] 165 | 166 | - Fixed columns alignment bug 167 | 168 | ## [1.1.0] 169 | 170 | - Added code page support 171 | 172 | ## [1.0.2] 173 | 174 | - Send raw command(s) 175 | - Turn 90° clockwise rotation mode on/off 176 | - Flutter example: discover active Wi-Fi printers 177 | - Select character code table 178 | 179 | ## [1.0.1] 180 | 181 | - exported PosColumn 182 | 183 | ## [1.0.0] 184 | 185 | - Removed PosString class 186 | - Added PosStyles and PosColumn classes 187 | - Updated examples and readme 188 | 189 | ## [0.9.0] - [0.9.1] 190 | 191 | - Initial release 192 | - Added basic functions (cut paper, write line, ...) 193 | - Text styling (bold, underline, reverted, ...) 194 | - Text align 195 | - Table row printing (up to 12 columns of different width) 196 | -------------------------------------------------------------------------------- /lib/src/network_printer.dart: -------------------------------------------------------------------------------- 1 | /* 2 | * esc_pos_printer 3 | * Created by Andrey Ushakov 4 | * 5 | * Copyright (c) 2019-2020. All rights reserved. 6 | * See LICENSE for distribution and usage details. 7 | */ 8 | 9 | import 'dart:io'; 10 | import 'dart:typed_data' show Uint8List; 11 | import 'package:esc_pos_utils/esc_pos_utils.dart'; 12 | import 'package:image/image.dart'; 13 | import './enums.dart'; 14 | 15 | /// Network Printer 16 | class NetworkPrinter { 17 | NetworkPrinter(this._paperSize, this._profile, {int spaceBetweenRows = 5}) { 18 | _generator = 19 | Generator(paperSize, profile, spaceBetweenRows: spaceBetweenRows); 20 | } 21 | 22 | final PaperSize _paperSize; 23 | final CapabilityProfile _profile; 24 | String? _host; 25 | int? _port; 26 | late Generator _generator; 27 | late Socket _socket; 28 | 29 | int? get port => _port; 30 | String? get host => _host; 31 | PaperSize get paperSize => _paperSize; 32 | CapabilityProfile get profile => _profile; 33 | 34 | Future connect(String host, 35 | {int port = 91000, Duration timeout = const Duration(seconds: 5)}) async { 36 | _host = host; 37 | _port = port; 38 | try { 39 | _socket = await Socket.connect(host, port, timeout: timeout); 40 | _socket.add(_generator.reset()); 41 | return Future.value(PosPrintResult.success); 42 | } catch (e) { 43 | return Future.value(PosPrintResult.timeout); 44 | } 45 | } 46 | 47 | /// [delayMs]: milliseconds to wait after destroying the socket 48 | void disconnect({int? delayMs}) async { 49 | _socket.destroy(); 50 | if (delayMs != null) { 51 | await Future.delayed(Duration(milliseconds: delayMs), () => null); 52 | } 53 | } 54 | 55 | // ************************ Printer Commands ************************ 56 | void reset() { 57 | _socket.add(_generator.reset()); 58 | } 59 | 60 | void text( 61 | String text, { 62 | PosStyles styles = const PosStyles(), 63 | int linesAfter = 0, 64 | bool containsChinese = false, 65 | int? maxCharsPerLine, 66 | }) { 67 | _socket.add(_generator.text(text, 68 | styles: styles, 69 | linesAfter: linesAfter, 70 | containsChinese: containsChinese, 71 | maxCharsPerLine: maxCharsPerLine)); 72 | } 73 | 74 | void setGlobalCodeTable(String codeTable) { 75 | _socket.add(_generator.setGlobalCodeTable(codeTable)); 76 | } 77 | 78 | void setGlobalFont(PosFontType font, {int? maxCharsPerLine}) { 79 | _socket 80 | .add(_generator.setGlobalFont(font, maxCharsPerLine: maxCharsPerLine)); 81 | } 82 | 83 | void setStyles(PosStyles styles, {bool isKanji = false}) { 84 | _socket.add(_generator.setStyles(styles, isKanji: isKanji)); 85 | } 86 | 87 | void rawBytes(List cmd, {bool isKanji = false}) { 88 | _socket.add(_generator.rawBytes(cmd, isKanji: isKanji)); 89 | } 90 | 91 | void emptyLines(int n) { 92 | _socket.add(_generator.emptyLines(n)); 93 | } 94 | 95 | void feed(int n) { 96 | _socket.add(_generator.feed(n)); 97 | } 98 | 99 | void cut({PosCutMode mode = PosCutMode.full}) { 100 | _socket.add(_generator.cut(mode: mode)); 101 | } 102 | 103 | void printCodeTable({String? codeTable}) { 104 | _socket.add(_generator.printCodeTable(codeTable: codeTable)); 105 | } 106 | 107 | void beep({int n = 3, PosBeepDuration duration = PosBeepDuration.beep450ms}) { 108 | _socket.add(_generator.beep(n: n, duration: duration)); 109 | } 110 | 111 | void reverseFeed(int n) { 112 | _socket.add(_generator.reverseFeed(n)); 113 | } 114 | 115 | void row(List cols) { 116 | _socket.add(_generator.row(cols)); 117 | } 118 | 119 | void image(Image imgSrc, {PosAlign align = PosAlign.center}) { 120 | _socket.add(_generator.image(imgSrc, align: align)); 121 | } 122 | 123 | void imageRaster( 124 | Image image, { 125 | PosAlign align = PosAlign.center, 126 | bool highDensityHorizontal = true, 127 | bool highDensityVertical = true, 128 | PosImageFn imageFn = PosImageFn.bitImageRaster, 129 | }) { 130 | _socket.add(_generator.imageRaster( 131 | image, 132 | align: align, 133 | highDensityHorizontal: highDensityHorizontal, 134 | highDensityVertical: highDensityVertical, 135 | imageFn: imageFn, 136 | )); 137 | } 138 | 139 | void barcode( 140 | Barcode barcode, { 141 | int? width, 142 | int? height, 143 | BarcodeFont? font, 144 | BarcodeText textPos = BarcodeText.below, 145 | PosAlign align = PosAlign.center, 146 | }) { 147 | _socket.add(_generator.barcode( 148 | barcode, 149 | width: width, 150 | height: height, 151 | font: font, 152 | textPos: textPos, 153 | align: align, 154 | )); 155 | } 156 | 157 | void qrcode( 158 | String text, { 159 | PosAlign align = PosAlign.center, 160 | QRSize size = QRSize.Size4, 161 | QRCorrection cor = QRCorrection.L, 162 | }) { 163 | _socket.add(_generator.qrcode(text, align: align, size: size, cor: cor)); 164 | } 165 | 166 | void drawer({PosDrawer pin = PosDrawer.pin2}) { 167 | _socket.add(_generator.drawer(pin: pin)); 168 | } 169 | 170 | void hr({String ch = '-', int? len, int linesAfter = 0}) { 171 | _socket.add(_generator.hr(ch: ch, linesAfter: linesAfter)); 172 | } 173 | 174 | void textEncoded( 175 | Uint8List textBytes, { 176 | PosStyles styles = const PosStyles(), 177 | int linesAfter = 0, 178 | int? maxCharsPerLine, 179 | }) { 180 | _socket.add(_generator.textEncoded( 181 | textBytes, 182 | styles: styles, 183 | linesAfter: linesAfter, 184 | maxCharsPerLine: maxCharsPerLine, 185 | )); 186 | } 187 | // ************************ (end) Printer Commands ************************ 188 | } 189 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "3.1.2" 11 | async: 12 | dependency: transitive 13 | description: 14 | name: async 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.8.2" 18 | boolean_selector: 19 | dependency: transitive 20 | description: 21 | name: boolean_selector 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.1.0" 25 | characters: 26 | dependency: transitive 27 | description: 28 | name: characters 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.2.0" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.3.1" 39 | charset_converter: 40 | dependency: "direct main" 41 | description: 42 | name: charset_converter 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.0.3" 46 | clock: 47 | dependency: transitive 48 | description: 49 | name: clock 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.1.0" 53 | collection: 54 | dependency: transitive 55 | description: 56 | name: collection 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.15.0" 60 | crypto: 61 | dependency: transitive 62 | description: 63 | name: crypto 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "3.0.1" 67 | csslib: 68 | dependency: transitive 69 | description: 70 | name: csslib 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "0.17.0" 74 | esc_pos_utils: 75 | dependency: "direct main" 76 | description: 77 | name: esc_pos_utils 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "1.1.0" 81 | fake_async: 82 | dependency: transitive 83 | description: 84 | name: fake_async 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "1.2.0" 88 | flutter: 89 | dependency: "direct main" 90 | description: flutter 91 | source: sdk 92 | version: "0.0.0" 93 | flutter_test: 94 | dependency: "direct dev" 95 | description: flutter 96 | source: sdk 97 | version: "0.0.0" 98 | gbk_codec: 99 | dependency: transitive 100 | description: 101 | name: gbk_codec 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "0.4.0" 105 | hex: 106 | dependency: transitive 107 | description: 108 | name: hex 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "0.2.0" 112 | html: 113 | dependency: transitive 114 | description: 115 | name: html 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "0.15.0" 119 | image: 120 | dependency: "direct main" 121 | description: 122 | name: image 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "3.0.5" 126 | matcher: 127 | dependency: transitive 128 | description: 129 | name: matcher 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "0.12.11" 133 | meta: 134 | dependency: transitive 135 | description: 136 | name: meta 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "1.7.0" 140 | path: 141 | dependency: transitive 142 | description: 143 | name: path 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "1.8.0" 147 | petitparser: 148 | dependency: transitive 149 | description: 150 | name: petitparser 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "4.3.0" 154 | sky_engine: 155 | dependency: transitive 156 | description: flutter 157 | source: sdk 158 | version: "0.0.99" 159 | source_span: 160 | dependency: transitive 161 | description: 162 | name: source_span 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.8.1" 166 | stack_trace: 167 | dependency: transitive 168 | description: 169 | name: stack_trace 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "1.10.0" 173 | stream_channel: 174 | dependency: transitive 175 | description: 176 | name: stream_channel 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "2.1.0" 180 | string_scanner: 181 | dependency: transitive 182 | description: 183 | name: string_scanner 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "1.1.0" 187 | term_glyph: 188 | dependency: transitive 189 | description: 190 | name: term_glyph 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "1.2.0" 194 | test_api: 195 | dependency: transitive 196 | description: 197 | name: test_api 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "0.4.3" 201 | typed_data: 202 | dependency: transitive 203 | description: 204 | name: typed_data 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "1.3.0" 208 | vector_math: 209 | dependency: transitive 210 | description: 211 | name: vector_math 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "2.1.0" 215 | xml: 216 | dependency: transitive 217 | description: 218 | name: xml 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "5.3.0" 222 | sdks: 223 | dart: ">=2.14.0 <3.0.0" 224 | flutter: ">=1.10.0" 225 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Specify analysis options. 2 | # 3 | # Until there are meta linter rules, each desired lint must be explicitly enabled. 4 | # See: https://github.com/dart-lang/linter/issues/288 5 | # 6 | # For a list of lints, see: http://dart-lang.github.io/linter/lints/ 7 | # See the configuration guide for more 8 | # https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer 9 | # 10 | # There are other similar analysis options files in the flutter repos, 11 | # which should be kept in sync with this file: 12 | # 13 | # - analysis_options.yaml (this file) 14 | # - packages/flutter/lib/analysis_options_user.yaml 15 | # - https://github.com/flutter/plugins/blob/master/analysis_options.yaml 16 | # - https://github.com/flutter/engine/blob/master/analysis_options.yaml 17 | # 18 | # This file contains the analysis options used by Flutter tools, such as IntelliJ, 19 | # Android Studio, and the `flutter analyze` command. 20 | 21 | analyzer: 22 | strong-mode: 23 | implicit-dynamic: false 24 | errors: 25 | # treat missing required parameters as a warning (not a hint) 26 | missing_required_param: warning 27 | # treat missing returns as a warning (not a hint) 28 | missing_return: warning 29 | # allow having TODOs in the code 30 | todo: ignore 31 | # Ignore analyzer hints for updating pubspecs when using Future or 32 | # Stream and not importing dart:async 33 | # Please see https://github.com/flutter/flutter/pull/24528 for details. 34 | sdk_version_async_exported_from_core: ignore 35 | exclude: 36 | - 'bin/cache/**' 37 | # the following two are relative to the stocks example and the flutter package respectively 38 | # see https://github.com/dart-lang/sdk/issues/28463 39 | - 'lib/i18n/stock_messages_*.dart' 40 | - 'lib/src/http/**' 41 | 42 | linter: 43 | rules: 44 | # these rules are documented on and in the same order as 45 | # the Dart Lint rules page to make maintenance easier 46 | # https://github.com/dart-lang/linter/blob/master/example/all.yaml 47 | - always_declare_return_types 48 | - always_put_control_body_on_new_line 49 | # - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219 50 | - always_require_non_null_named_parameters 51 | # - always_specify_types 52 | - annotate_overrides 53 | # - avoid_annotating_with_dynamic # conflicts with always_specify_types 54 | - avoid_as 55 | # - avoid_bool_literals_in_conditional_expressions # not yet tested 56 | # - avoid_catches_without_on_clauses # we do this commonly 57 | # - avoid_catching_errors # we do this commonly 58 | - avoid_classes_with_only_static_members 59 | # - avoid_double_and_int_checks # only useful when targeting JS runtime 60 | - avoid_empty_else 61 | - avoid_field_initializers_in_const_classes 62 | - avoid_function_literals_in_foreach_calls 63 | # - avoid_implementing_value_types # not yet tested 64 | - avoid_init_to_null 65 | # - avoid_js_rounded_ints # only useful when targeting JS runtime 66 | - avoid_null_checks_in_equality_operators 67 | # - avoid_positional_boolean_parameters # not yet tested 68 | # - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356) 69 | - avoid_relative_lib_imports 70 | - avoid_renaming_method_parameters 71 | - avoid_return_types_on_setters 72 | # - avoid_returning_null # there are plenty of valid reasons to return null 73 | # - avoid_returning_null_for_future # not yet tested 74 | - avoid_returning_null_for_void 75 | # - avoid_returning_this # there are plenty of valid reasons to return this 76 | # - avoid_setters_without_getters # not yet tested 77 | # - avoid_shadowing_type_parameters # not yet tested 78 | # - avoid_single_cascade_in_expression_statements # not yet tested 79 | - avoid_slow_async_io 80 | - avoid_types_as_parameter_names 81 | # - avoid_types_on_closure_parameters # conflicts with always_specify_types 82 | - avoid_unused_constructor_parameters 83 | # - avoid_void_async 84 | - await_only_futures 85 | - camel_case_types 86 | - cancel_subscriptions 87 | # - cascade_invocations # not yet tested 88 | # - close_sinks # not reliable enough 89 | # - comment_references # blocked on https://github.com/flutter/flutter/issues/20765 90 | # - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204 91 | - control_flow_in_finally 92 | # - curly_braces_in_flow_control_structures # not yet tested 93 | - directives_ordering 94 | - empty_catches 95 | - empty_constructor_bodies 96 | - empty_statements 97 | # - file_names # not yet tested 98 | - flutter_style_todos 99 | - hash_and_equals 100 | - implementation_imports 101 | # - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811 102 | - iterable_contains_unrelated_type 103 | # - join_return_with_assignment # not yet tested 104 | - library_names 105 | - library_prefixes 106 | # - lines_longer_than_80_chars # not yet tested 107 | - list_remove_unrelated_type 108 | # - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181 109 | - no_adjacent_strings_in_list 110 | - no_duplicate_case_values 111 | - non_constant_identifier_names 112 | # - null_closures # not yet tested 113 | # - omit_local_variable_types # opposite of always_specify_types 114 | # - one_member_abstracts # too many false positives 115 | # - only_throw_errors # https://github.com/flutter/flutter/issues/5792 116 | - overridden_fields 117 | - package_api_docs 118 | - package_names 119 | - package_prefixed_library_names 120 | # - parameter_assignments # we do this commonly 121 | - prefer_adjacent_string_concatenation 122 | - prefer_asserts_in_initializer_lists 123 | - prefer_collection_literals 124 | - prefer_conditional_assignment 125 | # - prefer_const_constructors 126 | - prefer_const_constructors_in_immutables 127 | - prefer_const_declarations 128 | - prefer_const_literals_to_create_immutables 129 | # - prefer_constructors_over_static_methods # not yet tested 130 | - prefer_contains 131 | - prefer_equal_for_default_values 132 | # - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods 133 | - prefer_final_fields 134 | - prefer_final_locals 135 | - prefer_foreach 136 | # - prefer_function_declarations_over_variables # not yet tested 137 | - prefer_generic_function_type_aliases 138 | - prefer_initializing_formals 139 | # - prefer_int_literals # not yet tested 140 | # - prefer_interpolation_to_compose_strings # not yet tested 141 | - prefer_is_empty 142 | - prefer_is_not_empty 143 | - prefer_iterable_whereType 144 | # - prefer_mixin # https://github.com/dart-lang/language/issues/32 145 | - prefer_single_quotes 146 | - prefer_typing_uninitialized_variables 147 | - prefer_void_to_null 148 | # - public_member_api_docs # enabled on a case-by-case basis; see e.g. packages/analysis_options.yaml 149 | - recursive_getters 150 | - slash_for_doc_comments 151 | - sort_constructors_first 152 | - sort_pub_dependencies 153 | - sort_unnamed_constructors_first 154 | # - super_goes_last # no longer needed w/ Dart 2 155 | - test_types_in_equals 156 | - throw_in_finally 157 | # - type_annotate_public_apis # subset of always_specify_types 158 | - type_init_formals 159 | # - unawaited_futures # too many false positives 160 | # - unnecessary_await_in_return # not yet tested 161 | - unnecessary_brace_in_string_interps 162 | - unnecessary_const 163 | - unnecessary_getters_setters 164 | # - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498 165 | - unnecessary_new 166 | - unnecessary_null_aware_assignments 167 | - unnecessary_null_in_if_null_operators 168 | - unnecessary_overrides 169 | - unnecessary_parenthesis 170 | - unnecessary_statements 171 | - unnecessary_this 172 | - unrelated_type_equality_checks 173 | # - use_function_type_syntax_for_parameters # not yet tested 174 | - use_rethrow_when_possible 175 | # - use_setters_to_change_properties # not yet tested 176 | # - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182 177 | # - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review 178 | - valid_regexps 179 | # - void_checks # not yet tested -------------------------------------------------------------------------------- /example/discover_printers/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.13" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.6.0" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.8.2" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.1.0" 32 | characters: 33 | dependency: transitive 34 | description: 35 | name: characters 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.2.0" 39 | charcode: 40 | dependency: transitive 41 | description: 42 | name: charcode 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.3.1" 46 | charset_converter: 47 | dependency: "direct main" 48 | description: 49 | name: charset_converter 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.0.3" 53 | clock: 54 | dependency: transitive 55 | description: 56 | name: clock 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.1.0" 60 | collection: 61 | dependency: transitive 62 | description: 63 | name: collection 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.15.0" 67 | convert: 68 | dependency: transitive 69 | description: 70 | name: convert 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "2.1.1" 74 | crypto: 75 | dependency: transitive 76 | description: 77 | name: crypto 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "2.1.5" 81 | csslib: 82 | dependency: transitive 83 | description: 84 | name: csslib 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "0.16.2" 88 | cupertino_icons: 89 | dependency: "direct main" 90 | description: 91 | name: cupertino_icons 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "0.1.3" 95 | esc_pos_printer: 96 | dependency: "direct main" 97 | description: 98 | path: "../.." 99 | relative: true 100 | source: path 101 | version: "4.0.3" 102 | esc_pos_utils: 103 | dependency: "direct main" 104 | description: 105 | name: esc_pos_utils 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "1.0.0" 109 | fake_async: 110 | dependency: transitive 111 | description: 112 | name: fake_async 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "1.2.0" 116 | ffi: 117 | dependency: transitive 118 | description: 119 | name: ffi 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "1.1.2" 123 | file: 124 | dependency: transitive 125 | description: 126 | name: file 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "6.1.2" 130 | flutter: 131 | dependency: "direct main" 132 | description: flutter 133 | source: sdk 134 | version: "0.0.0" 135 | flutter_test: 136 | dependency: "direct dev" 137 | description: flutter 138 | source: sdk 139 | version: "0.0.0" 140 | gbk_codec: 141 | dependency: transitive 142 | description: 143 | name: gbk_codec 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "0.3.2" 147 | hex: 148 | dependency: transitive 149 | description: 150 | name: hex 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "0.1.2" 154 | html: 155 | dependency: transitive 156 | description: 157 | name: html 158 | url: "https://pub.dartlang.org" 159 | source: hosted 160 | version: "0.14.0+4" 161 | image: 162 | dependency: "direct main" 163 | description: 164 | name: image 165 | url: "https://pub.dartlang.org" 166 | source: hosted 167 | version: "2.1.19" 168 | intl: 169 | dependency: "direct main" 170 | description: 171 | name: intl 172 | url: "https://pub.dartlang.org" 173 | source: hosted 174 | version: "0.16.1" 175 | matcher: 176 | dependency: transitive 177 | description: 178 | name: matcher 179 | url: "https://pub.dartlang.org" 180 | source: hosted 181 | version: "0.12.11" 182 | meta: 183 | dependency: transitive 184 | description: 185 | name: meta 186 | url: "https://pub.dartlang.org" 187 | source: hosted 188 | version: "1.7.0" 189 | path: 190 | dependency: transitive 191 | description: 192 | name: path 193 | url: "https://pub.dartlang.org" 194 | source: hosted 195 | version: "1.8.0" 196 | path_provider: 197 | dependency: "direct main" 198 | description: 199 | name: path_provider 200 | url: "https://pub.dartlang.org" 201 | source: hosted 202 | version: "1.6.28" 203 | path_provider_linux: 204 | dependency: transitive 205 | description: 206 | name: path_provider_linux 207 | url: "https://pub.dartlang.org" 208 | source: hosted 209 | version: "0.0.1+2" 210 | path_provider_macos: 211 | dependency: transitive 212 | description: 213 | name: path_provider_macos 214 | url: "https://pub.dartlang.org" 215 | source: hosted 216 | version: "0.0.4+8" 217 | path_provider_platform_interface: 218 | dependency: transitive 219 | description: 220 | name: path_provider_platform_interface 221 | url: "https://pub.dartlang.org" 222 | source: hosted 223 | version: "1.0.4" 224 | path_provider_windows: 225 | dependency: transitive 226 | description: 227 | name: path_provider_windows 228 | url: "https://pub.dartlang.org" 229 | source: hosted 230 | version: "0.0.5" 231 | petitparser: 232 | dependency: transitive 233 | description: 234 | name: petitparser 235 | url: "https://pub.dartlang.org" 236 | source: hosted 237 | version: "3.1.0" 238 | ping_discover_network: 239 | dependency: "direct main" 240 | description: 241 | name: ping_discover_network 242 | url: "https://pub.dartlang.org" 243 | source: hosted 244 | version: "0.2.0+1" 245 | platform: 246 | dependency: transitive 247 | description: 248 | name: platform 249 | url: "https://pub.dartlang.org" 250 | source: hosted 251 | version: "3.0.2" 252 | plugin_platform_interface: 253 | dependency: transitive 254 | description: 255 | name: plugin_platform_interface 256 | url: "https://pub.dartlang.org" 257 | source: hosted 258 | version: "1.0.3" 259 | process: 260 | dependency: transitive 261 | description: 262 | name: process 263 | url: "https://pub.dartlang.org" 264 | source: hosted 265 | version: "4.2.3" 266 | qr: 267 | dependency: transitive 268 | description: 269 | name: qr 270 | url: "https://pub.dartlang.org" 271 | source: hosted 272 | version: "1.3.0" 273 | qr_flutter: 274 | dependency: "direct main" 275 | description: 276 | name: qr_flutter 277 | url: "https://pub.dartlang.org" 278 | source: hosted 279 | version: "3.2.0" 280 | sky_engine: 281 | dependency: transitive 282 | description: flutter 283 | source: sdk 284 | version: "0.0.99" 285 | source_span: 286 | dependency: transitive 287 | description: 288 | name: source_span 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "1.8.1" 292 | stack_trace: 293 | dependency: transitive 294 | description: 295 | name: stack_trace 296 | url: "https://pub.dartlang.org" 297 | source: hosted 298 | version: "1.10.0" 299 | stream_channel: 300 | dependency: transitive 301 | description: 302 | name: stream_channel 303 | url: "https://pub.dartlang.org" 304 | source: hosted 305 | version: "2.1.0" 306 | string_scanner: 307 | dependency: transitive 308 | description: 309 | name: string_scanner 310 | url: "https://pub.dartlang.org" 311 | source: hosted 312 | version: "1.1.0" 313 | term_glyph: 314 | dependency: transitive 315 | description: 316 | name: term_glyph 317 | url: "https://pub.dartlang.org" 318 | source: hosted 319 | version: "1.2.0" 320 | test_api: 321 | dependency: transitive 322 | description: 323 | name: test_api 324 | url: "https://pub.dartlang.org" 325 | source: hosted 326 | version: "0.4.3" 327 | typed_data: 328 | dependency: transitive 329 | description: 330 | name: typed_data 331 | url: "https://pub.dartlang.org" 332 | source: hosted 333 | version: "1.3.0" 334 | vector_math: 335 | dependency: transitive 336 | description: 337 | name: vector_math 338 | url: "https://pub.dartlang.org" 339 | source: hosted 340 | version: "2.1.0" 341 | wifi: 342 | dependency: "direct main" 343 | description: 344 | name: wifi 345 | url: "https://pub.dartlang.org" 346 | source: hosted 347 | version: "0.1.5" 348 | win32: 349 | dependency: transitive 350 | description: 351 | name: win32 352 | url: "https://pub.dartlang.org" 353 | source: hosted 354 | version: "2.2.9" 355 | xdg_directories: 356 | dependency: transitive 357 | description: 358 | name: xdg_directories 359 | url: "https://pub.dartlang.org" 360 | source: hosted 361 | version: "0.1.2" 362 | xml: 363 | dependency: transitive 364 | description: 365 | name: xml 366 | url: "https://pub.dartlang.org" 367 | source: hosted 368 | version: "4.5.1" 369 | sdks: 370 | dart: ">=2.13.0 <3.0.0" 371 | flutter: ">=1.20.0" 372 | -------------------------------------------------------------------------------- /example/discover_printers/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'dart:typed_data'; 3 | import 'package:intl/intl.dart'; 4 | import 'package:qr_flutter/qr_flutter.dart'; 5 | import 'package:path_provider/path_provider.dart'; 6 | import 'package:flutter/material.dart' hide Image; 7 | import 'package:esc_pos_printer/esc_pos_printer.dart'; 8 | import 'package:flutter/services.dart'; 9 | import 'package:ping_discover_network/ping_discover_network.dart'; 10 | import 'package:esc_pos_utils/esc_pos_utils.dart'; 11 | import 'package:image/image.dart'; 12 | import 'package:wifi/wifi.dart'; 13 | 14 | void main() => runApp(MyApp()); 15 | 16 | class MyApp extends StatelessWidget { 17 | @override 18 | Widget build(BuildContext context) { 19 | return MaterialApp( 20 | title: 'Discover Printers', 21 | theme: ThemeData( 22 | primarySwatch: Colors.blue, 23 | ), 24 | home: MyHomePage(), 25 | ); 26 | } 27 | } 28 | 29 | class MyHomePage extends StatefulWidget { 30 | @override 31 | _MyHomePageState createState() => _MyHomePageState(); 32 | } 33 | 34 | class _MyHomePageState extends State { 35 | String localIp = ''; 36 | List devices = []; 37 | bool isDiscovering = false; 38 | int found = -1; 39 | TextEditingController portController = TextEditingController(text: '9100'); 40 | 41 | void discover(BuildContext ctx) async { 42 | setState(() { 43 | isDiscovering = true; 44 | devices.clear(); 45 | found = -1; 46 | }); 47 | 48 | String ip; 49 | try { 50 | ip = await Wifi.ip; 51 | print('local ip:\t$ip'); 52 | } catch (e) { 53 | final snackBar = SnackBar( 54 | content: Text('WiFi is not connected', textAlign: TextAlign.center)); 55 | Scaffold.of(ctx).showSnackBar(snackBar); 56 | return; 57 | } 58 | setState(() { 59 | localIp = ip; 60 | }); 61 | 62 | final String subnet = ip.substring(0, ip.lastIndexOf('.')); 63 | int port = 9100; 64 | try { 65 | port = int.parse(portController.text); 66 | } catch (e) { 67 | portController.text = port.toString(); 68 | } 69 | print('subnet:\t$subnet, port:\t$port'); 70 | 71 | final stream = NetworkAnalyzer.discover2(subnet, port); 72 | 73 | stream.listen((NetworkAddress addr) { 74 | if (addr.exists) { 75 | print('Found device: ${addr.ip}'); 76 | setState(() { 77 | devices.add(addr.ip); 78 | found = devices.length; 79 | }); 80 | } 81 | }) 82 | ..onDone(() { 83 | setState(() { 84 | isDiscovering = false; 85 | found = devices.length; 86 | }); 87 | }) 88 | ..onError((dynamic e) { 89 | final snackBar = SnackBar( 90 | content: Text('Unexpected exception', textAlign: TextAlign.center)); 91 | Scaffold.of(ctx).showSnackBar(snackBar); 92 | }); 93 | } 94 | 95 | Future testReceipt(NetworkPrinter printer) async { 96 | printer.text( 97 | 'Regular: aA bB cC dD eE fF gG hH iI jJ kK lL mM nN oO pP qQ rR sS tT uU vV wW xX yY zZ'); 98 | printer.text('Special 1: àÀ èÈ éÉ ûÛ üÜ çÇ ôÔ', 99 | styles: PosStyles(codeTable: 'CP1252')); 100 | printer.text('Special 2: blåbærgrød', 101 | styles: PosStyles(codeTable: 'CP1252')); 102 | 103 | printer.text('Bold text', styles: PosStyles(bold: true)); 104 | printer.text('Reverse text', styles: PosStyles(reverse: true)); 105 | printer.text('Underlined text', 106 | styles: PosStyles(underline: true), linesAfter: 1); 107 | printer.text('Align left', styles: PosStyles(align: PosAlign.left)); 108 | printer.text('Align center', styles: PosStyles(align: PosAlign.center)); 109 | printer.text('Align right', 110 | styles: PosStyles(align: PosAlign.right), linesAfter: 1); 111 | 112 | printer.row([ 113 | PosColumn( 114 | text: 'col3', 115 | width: 3, 116 | styles: PosStyles(align: PosAlign.center, underline: true), 117 | ), 118 | PosColumn( 119 | text: 'col6', 120 | width: 6, 121 | styles: PosStyles(align: PosAlign.center, underline: true), 122 | ), 123 | PosColumn( 124 | text: 'col3', 125 | width: 3, 126 | styles: PosStyles(align: PosAlign.center, underline: true), 127 | ), 128 | ]); 129 | 130 | printer.text('Text size 200%', 131 | styles: PosStyles( 132 | height: PosTextSize.size2, 133 | width: PosTextSize.size2, 134 | )); 135 | 136 | // Print image 137 | final ByteData data = await rootBundle.load('assets/logo.png'); 138 | final Uint8List bytes = data.buffer.asUint8List(); 139 | final Image image = decodeImage(bytes); 140 | printer.image(image); 141 | // Print image using alternative commands 142 | // printer.imageRaster(image); 143 | // printer.imageRaster(image, imageFn: PosImageFn.graphics); 144 | 145 | // Print barcode 146 | final List barData = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 4]; 147 | printer.barcode(Barcode.upcA(barData)); 148 | 149 | // Print mixed (chinese + latin) text. Only for printers supporting Kanji mode 150 | // printer.text( 151 | // 'hello ! 中文字 # world @ éphémère &', 152 | // styles: PosStyles(codeTable: PosCodeTable.westEur), 153 | // containsChinese: true, 154 | // ); 155 | 156 | printer.feed(2); 157 | printer.cut(); 158 | } 159 | 160 | Future printDemoReceipt(NetworkPrinter printer) async { 161 | // Print image 162 | final ByteData data = await rootBundle.load('assets/rabbit_black.jpg'); 163 | final Uint8List bytes = data.buffer.asUint8List(); 164 | final Image image = decodeImage(bytes); 165 | printer.image(image); 166 | 167 | printer.text('GROCERYLY', 168 | styles: PosStyles( 169 | align: PosAlign.center, 170 | height: PosTextSize.size2, 171 | width: PosTextSize.size2, 172 | ), 173 | linesAfter: 1); 174 | 175 | printer.text('889 Watson Lane', styles: PosStyles(align: PosAlign.center)); 176 | printer.text('New Braunfels, TX', 177 | styles: PosStyles(align: PosAlign.center)); 178 | printer.text('Tel: 830-221-1234', 179 | styles: PosStyles(align: PosAlign.center)); 180 | printer.text('Web: www.example.com', 181 | styles: PosStyles(align: PosAlign.center), linesAfter: 1); 182 | 183 | printer.hr(); 184 | printer.row([ 185 | PosColumn(text: 'Qty', width: 1), 186 | PosColumn(text: 'Item', width: 7), 187 | PosColumn( 188 | text: 'Price', width: 2, styles: PosStyles(align: PosAlign.right)), 189 | PosColumn( 190 | text: 'Total', width: 2, styles: PosStyles(align: PosAlign.right)), 191 | ]); 192 | 193 | printer.row([ 194 | PosColumn(text: '2', width: 1), 195 | PosColumn(text: 'ONION RINGS', width: 7), 196 | PosColumn( 197 | text: '0.99', width: 2, styles: PosStyles(align: PosAlign.right)), 198 | PosColumn( 199 | text: '1.98', width: 2, styles: PosStyles(align: PosAlign.right)), 200 | ]); 201 | printer.row([ 202 | PosColumn(text: '1', width: 1), 203 | PosColumn(text: 'PIZZA', width: 7), 204 | PosColumn( 205 | text: '3.45', width: 2, styles: PosStyles(align: PosAlign.right)), 206 | PosColumn( 207 | text: '3.45', width: 2, styles: PosStyles(align: PosAlign.right)), 208 | ]); 209 | printer.row([ 210 | PosColumn(text: '1', width: 1), 211 | PosColumn(text: 'SPRING ROLLS', width: 7), 212 | PosColumn( 213 | text: '2.99', width: 2, styles: PosStyles(align: PosAlign.right)), 214 | PosColumn( 215 | text: '2.99', width: 2, styles: PosStyles(align: PosAlign.right)), 216 | ]); 217 | printer.row([ 218 | PosColumn(text: '3', width: 1), 219 | PosColumn(text: 'CRUNCHY STICKS', width: 7), 220 | PosColumn( 221 | text: '0.85', width: 2, styles: PosStyles(align: PosAlign.right)), 222 | PosColumn( 223 | text: '2.55', width: 2, styles: PosStyles(align: PosAlign.right)), 224 | ]); 225 | printer.hr(); 226 | 227 | printer.row([ 228 | PosColumn( 229 | text: 'TOTAL', 230 | width: 6, 231 | styles: PosStyles( 232 | height: PosTextSize.size2, 233 | width: PosTextSize.size2, 234 | )), 235 | PosColumn( 236 | text: '\$10.97', 237 | width: 6, 238 | styles: PosStyles( 239 | align: PosAlign.right, 240 | height: PosTextSize.size2, 241 | width: PosTextSize.size2, 242 | )), 243 | ]); 244 | 245 | printer.hr(ch: '=', linesAfter: 1); 246 | 247 | printer.row([ 248 | PosColumn( 249 | text: 'Cash', 250 | width: 8, 251 | styles: PosStyles(align: PosAlign.right, width: PosTextSize.size2)), 252 | PosColumn( 253 | text: '\$15.00', 254 | width: 4, 255 | styles: PosStyles(align: PosAlign.right, width: PosTextSize.size2)), 256 | ]); 257 | printer.row([ 258 | PosColumn( 259 | text: 'Change', 260 | width: 8, 261 | styles: PosStyles(align: PosAlign.right, width: PosTextSize.size2)), 262 | PosColumn( 263 | text: '\$4.03', 264 | width: 4, 265 | styles: PosStyles(align: PosAlign.right, width: PosTextSize.size2)), 266 | ]); 267 | 268 | printer.feed(2); 269 | printer.text('Thank you!', 270 | styles: PosStyles(align: PosAlign.center, bold: true)); 271 | 272 | final now = DateTime.now(); 273 | final formatter = DateFormat('MM/dd/yyyy H:m'); 274 | final String timestamp = formatter.format(now); 275 | printer.text(timestamp, 276 | styles: PosStyles(align: PosAlign.center), linesAfter: 2); 277 | 278 | // Print QR Code from image 279 | // try { 280 | // const String qrData = 'example.com'; 281 | // const double qrSize = 200; 282 | // final uiImg = await QrPainter( 283 | // data: qrData, 284 | // version: QrVersions.auto, 285 | // gapless: false, 286 | // ).toImageData(qrSize); 287 | // final dir = await getTemporaryDirectory(); 288 | // final pathName = '${dir.path}/qr_tmp.png'; 289 | // final qrFile = File(pathName); 290 | // final imgFile = await qrFile.writeAsBytes(uiImg.buffer.asUint8List()); 291 | // final img = decodeImage(imgFile.readAsBytesSync()); 292 | 293 | // printer.image(img); 294 | // } catch (e) { 295 | // print(e); 296 | // } 297 | 298 | // Print QR Code using native function 299 | // printer.qrcode('example.com'); 300 | 301 | printer.feed(1); 302 | printer.cut(); 303 | } 304 | 305 | void testPrint(String printerIp, BuildContext ctx) async { 306 | // TODO Don't forget to choose printer's paper size 307 | const PaperSize paper = PaperSize.mm80; 308 | final profile = await CapabilityProfile.load(); 309 | final printer = NetworkPrinter(paper, profile); 310 | 311 | final PosPrintResult res = await printer.connect(printerIp, port: 9100); 312 | 313 | if (res == PosPrintResult.success) { 314 | // DEMO RECEIPT 315 | await printDemoReceipt(printer); 316 | // TEST PRINT 317 | // await testReceipt(printer); 318 | printer.disconnect(); 319 | } 320 | 321 | final snackBar = 322 | SnackBar(content: Text(res.msg, textAlign: TextAlign.center)); 323 | Scaffold.of(ctx).showSnackBar(snackBar); 324 | } 325 | 326 | @override 327 | Widget build(BuildContext context) { 328 | return Scaffold( 329 | appBar: AppBar( 330 | title: Text('Discover Printers'), 331 | ), 332 | body: Builder( 333 | builder: (BuildContext context) { 334 | return Container( 335 | padding: EdgeInsets.symmetric(horizontal: 10, vertical: 20), 336 | child: Column( 337 | crossAxisAlignment: CrossAxisAlignment.center, 338 | children: [ 339 | TextField( 340 | controller: portController, 341 | keyboardType: TextInputType.number, 342 | decoration: InputDecoration( 343 | labelText: 'Port', 344 | hintText: 'Port', 345 | ), 346 | ), 347 | SizedBox(height: 10), 348 | Text('Local ip: $localIp', style: TextStyle(fontSize: 16)), 349 | SizedBox(height: 15), 350 | RaisedButton( 351 | child: Text( 352 | '${isDiscovering ? 'Discovering...' : 'Discover'}'), 353 | onPressed: isDiscovering ? null : () => discover(context)), 354 | SizedBox(height: 15), 355 | found >= 0 356 | ? Text('Found: $found device(s)', 357 | style: TextStyle(fontSize: 16)) 358 | : Container(), 359 | Expanded( 360 | child: ListView.builder( 361 | itemCount: devices.length, 362 | itemBuilder: (BuildContext context, int index) { 363 | return InkWell( 364 | onTap: () => testPrint(devices[index], context), 365 | child: Column( 366 | children: [ 367 | Container( 368 | height: 60, 369 | padding: EdgeInsets.only(left: 10), 370 | alignment: Alignment.centerLeft, 371 | child: Row( 372 | children: [ 373 | Icon(Icons.print), 374 | SizedBox(width: 10), 375 | Expanded( 376 | child: Column( 377 | crossAxisAlignment: 378 | CrossAxisAlignment.start, 379 | mainAxisAlignment: 380 | MainAxisAlignment.center, 381 | children: [ 382 | Text( 383 | '${devices[index]}:${portController.text}', 384 | style: TextStyle(fontSize: 16), 385 | ), 386 | Text( 387 | 'Click to print a test receipt', 388 | style: TextStyle( 389 | color: Colors.grey[700]), 390 | ), 391 | ], 392 | ), 393 | ), 394 | Icon(Icons.chevron_right), 395 | ], 396 | ), 397 | ), 398 | Divider(), 399 | ], 400 | ), 401 | ); 402 | }, 403 | ), 404 | ) 405 | ], 406 | ), 407 | ); 408 | }, 409 | ), 410 | ); 411 | } 412 | } 413 | -------------------------------------------------------------------------------- /example/discover_printers/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 362DF7156FCA6052D1E4B0CE /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE54026063ACDAFE1048A727 /* Pods_Runner.framework */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXCopyFilesBuildPhase section */ 20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 21 | isa = PBXCopyFilesBuildPhase; 22 | buildActionMask = 2147483647; 23 | dstPath = ""; 24 | dstSubfolderSpec = 10; 25 | files = ( 26 | ); 27 | name = "Embed Frameworks"; 28 | runOnlyForDeploymentPostprocessing = 0; 29 | }; 30 | /* End PBXCopyFilesBuildPhase section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 0CDE8BC18C1DFBE071567F38 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 34 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 35 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 36 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 37 | 5884D7CF958B4B0493BA84F1 /* 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 = ""; }; 38 | 6E6770F4D495B8661B3CC4F6 /* 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 = ""; }; 39 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 40 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 41 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 42 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 43 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 44 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 46 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | AE54026063ACDAFE1048A727 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 362DF7156FCA6052D1E4B0CE /* Pods_Runner.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 213BA37BFE54E1332CB2DC88 /* Pods */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 6E6770F4D495B8661B3CC4F6 /* Pods-Runner.debug.xcconfig */, 68 | 5884D7CF958B4B0493BA84F1 /* Pods-Runner.release.xcconfig */, 69 | 0CDE8BC18C1DFBE071567F38 /* Pods-Runner.profile.xcconfig */, 70 | ); 71 | path = Pods; 72 | sourceTree = ""; 73 | }; 74 | 9740EEB11CF90186004384FC /* Flutter */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 78 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 79 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 80 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 81 | ); 82 | name = Flutter; 83 | sourceTree = ""; 84 | }; 85 | 97C146E51CF9000F007C117D = { 86 | isa = PBXGroup; 87 | children = ( 88 | 9740EEB11CF90186004384FC /* Flutter */, 89 | 97C146F01CF9000F007C117D /* Runner */, 90 | 97C146EF1CF9000F007C117D /* Products */, 91 | 213BA37BFE54E1332CB2DC88 /* Pods */, 92 | F34A84B3E792F7D85285D0E7 /* Frameworks */, 93 | ); 94 | sourceTree = ""; 95 | }; 96 | 97C146EF1CF9000F007C117D /* Products */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 97C146EE1CF9000F007C117D /* Runner.app */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | 97C146F01CF9000F007C117D /* Runner */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 108 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 109 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 110 | 97C147021CF9000F007C117D /* Info.plist */, 111 | 97C146F11CF9000F007C117D /* Supporting Files */, 112 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 113 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 114 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 115 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 116 | ); 117 | path = Runner; 118 | sourceTree = ""; 119 | }; 120 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | ); 124 | name = "Supporting Files"; 125 | sourceTree = ""; 126 | }; 127 | F34A84B3E792F7D85285D0E7 /* Frameworks */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | AE54026063ACDAFE1048A727 /* Pods_Runner.framework */, 131 | ); 132 | name = Frameworks; 133 | sourceTree = ""; 134 | }; 135 | /* End PBXGroup section */ 136 | 137 | /* Begin PBXNativeTarget section */ 138 | 97C146ED1CF9000F007C117D /* Runner */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 141 | buildPhases = ( 142 | A021681291715BC9CD1D98D5 /* [CP] Check Pods Manifest.lock */, 143 | 9740EEB61CF901F6004384FC /* Run Script */, 144 | 97C146EA1CF9000F007C117D /* Sources */, 145 | 97C146EB1CF9000F007C117D /* Frameworks */, 146 | 97C146EC1CF9000F007C117D /* Resources */, 147 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 148 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 149 | ADC659B8E658577280ACA627 /* [CP] Embed Pods Frameworks */, 150 | ); 151 | buildRules = ( 152 | ); 153 | dependencies = ( 154 | ); 155 | name = Runner; 156 | productName = Runner; 157 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 158 | productType = "com.apple.product-type.application"; 159 | }; 160 | /* End PBXNativeTarget section */ 161 | 162 | /* Begin PBXProject section */ 163 | 97C146E61CF9000F007C117D /* Project object */ = { 164 | isa = PBXProject; 165 | attributes = { 166 | LastUpgradeCheck = 1020; 167 | ORGANIZATIONNAME = "The Chromium Authors"; 168 | TargetAttributes = { 169 | 97C146ED1CF9000F007C117D = { 170 | CreatedOnToolsVersion = 7.3.1; 171 | DevelopmentTeam = 8YA3WTV6AF; 172 | LastSwiftMigration = 1100; 173 | }; 174 | }; 175 | }; 176 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 177 | compatibilityVersion = "Xcode 3.2"; 178 | developmentRegion = en; 179 | hasScannedForEncodings = 0; 180 | knownRegions = ( 181 | en, 182 | Base, 183 | ); 184 | mainGroup = 97C146E51CF9000F007C117D; 185 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 186 | projectDirPath = ""; 187 | projectRoot = ""; 188 | targets = ( 189 | 97C146ED1CF9000F007C117D /* Runner */, 190 | ); 191 | }; 192 | /* End PBXProject section */ 193 | 194 | /* Begin PBXResourcesBuildPhase section */ 195 | 97C146EC1CF9000F007C117D /* Resources */ = { 196 | isa = PBXResourcesBuildPhase; 197 | buildActionMask = 2147483647; 198 | files = ( 199 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 200 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 201 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 202 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | }; 206 | /* End PBXResourcesBuildPhase section */ 207 | 208 | /* Begin PBXShellScriptBuildPhase section */ 209 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 210 | isa = PBXShellScriptBuildPhase; 211 | buildActionMask = 2147483647; 212 | files = ( 213 | ); 214 | inputPaths = ( 215 | ); 216 | name = "Thin Binary"; 217 | outputPaths = ( 218 | ); 219 | runOnlyForDeploymentPostprocessing = 0; 220 | shellPath = /bin/sh; 221 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 222 | }; 223 | 9740EEB61CF901F6004384FC /* Run Script */ = { 224 | isa = PBXShellScriptBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | ); 228 | inputPaths = ( 229 | ); 230 | name = "Run Script"; 231 | outputPaths = ( 232 | ); 233 | runOnlyForDeploymentPostprocessing = 0; 234 | shellPath = /bin/sh; 235 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 236 | }; 237 | A021681291715BC9CD1D98D5 /* [CP] Check Pods Manifest.lock */ = { 238 | isa = PBXShellScriptBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | ); 242 | inputFileListPaths = ( 243 | ); 244 | inputPaths = ( 245 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 246 | "${PODS_ROOT}/Manifest.lock", 247 | ); 248 | name = "[CP] Check Pods Manifest.lock"; 249 | outputFileListPaths = ( 250 | ); 251 | outputPaths = ( 252 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | shellPath = /bin/sh; 256 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 257 | showEnvVarsInLog = 0; 258 | }; 259 | ADC659B8E658577280ACA627 /* [CP] Embed Pods Frameworks */ = { 260 | isa = PBXShellScriptBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | ); 264 | inputPaths = ( 265 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", 266 | "${PODS_ROOT}/../Flutter/Flutter.framework", 267 | "${BUILT_PRODUCTS_DIR}/charset_converter/charset_converter.framework", 268 | "${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework", 269 | "${BUILT_PRODUCTS_DIR}/wifi/wifi.framework", 270 | ); 271 | name = "[CP] Embed Pods Frameworks"; 272 | outputPaths = ( 273 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", 274 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/charset_converter.framework", 275 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework", 276 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wifi.framework", 277 | ); 278 | runOnlyForDeploymentPostprocessing = 0; 279 | shellPath = /bin/sh; 280 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 281 | showEnvVarsInLog = 0; 282 | }; 283 | /* End PBXShellScriptBuildPhase section */ 284 | 285 | /* Begin PBXSourcesBuildPhase section */ 286 | 97C146EA1CF9000F007C117D /* Sources */ = { 287 | isa = PBXSourcesBuildPhase; 288 | buildActionMask = 2147483647; 289 | files = ( 290 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 291 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 292 | ); 293 | runOnlyForDeploymentPostprocessing = 0; 294 | }; 295 | /* End PBXSourcesBuildPhase section */ 296 | 297 | /* Begin PBXVariantGroup section */ 298 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 299 | isa = PBXVariantGroup; 300 | children = ( 301 | 97C146FB1CF9000F007C117D /* Base */, 302 | ); 303 | name = Main.storyboard; 304 | sourceTree = ""; 305 | }; 306 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 307 | isa = PBXVariantGroup; 308 | children = ( 309 | 97C147001CF9000F007C117D /* Base */, 310 | ); 311 | name = LaunchScreen.storyboard; 312 | sourceTree = ""; 313 | }; 314 | /* End PBXVariantGroup section */ 315 | 316 | /* Begin XCBuildConfiguration section */ 317 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 318 | isa = XCBuildConfiguration; 319 | buildSettings = { 320 | ALWAYS_SEARCH_USER_PATHS = NO; 321 | CLANG_ANALYZER_NONNULL = YES; 322 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 323 | CLANG_CXX_LIBRARY = "libc++"; 324 | CLANG_ENABLE_MODULES = YES; 325 | CLANG_ENABLE_OBJC_ARC = YES; 326 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 327 | CLANG_WARN_BOOL_CONVERSION = YES; 328 | CLANG_WARN_COMMA = YES; 329 | CLANG_WARN_CONSTANT_CONVERSION = YES; 330 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 331 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 332 | CLANG_WARN_EMPTY_BODY = YES; 333 | CLANG_WARN_ENUM_CONVERSION = YES; 334 | CLANG_WARN_INFINITE_RECURSION = YES; 335 | CLANG_WARN_INT_CONVERSION = YES; 336 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 337 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 338 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 339 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 340 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 341 | CLANG_WARN_STRICT_PROTOTYPES = YES; 342 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 343 | CLANG_WARN_UNREACHABLE_CODE = YES; 344 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 345 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 346 | COPY_PHASE_STRIP = NO; 347 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 348 | ENABLE_NS_ASSERTIONS = NO; 349 | ENABLE_STRICT_OBJC_MSGSEND = YES; 350 | GCC_C_LANGUAGE_STANDARD = gnu99; 351 | GCC_NO_COMMON_BLOCKS = YES; 352 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 353 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 354 | GCC_WARN_UNDECLARED_SELECTOR = YES; 355 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 356 | GCC_WARN_UNUSED_FUNCTION = YES; 357 | GCC_WARN_UNUSED_VARIABLE = YES; 358 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 359 | MTL_ENABLE_DEBUG_INFO = NO; 360 | SDKROOT = iphoneos; 361 | SUPPORTED_PLATFORMS = iphoneos; 362 | TARGETED_DEVICE_FAMILY = "1,2"; 363 | VALIDATE_PRODUCT = YES; 364 | }; 365 | name = Profile; 366 | }; 367 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 368 | isa = XCBuildConfiguration; 369 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 370 | buildSettings = { 371 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 372 | CLANG_ENABLE_MODULES = YES; 373 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 374 | DEVELOPMENT_TEAM = 8YA3WTV6AF; 375 | ENABLE_BITCODE = NO; 376 | FRAMEWORK_SEARCH_PATHS = ( 377 | "$(inherited)", 378 | "$(PROJECT_DIR)/Flutter", 379 | ); 380 | INFOPLIST_FILE = Runner/Info.plist; 381 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 382 | LIBRARY_SEARCH_PATHS = ( 383 | "$(inherited)", 384 | "$(PROJECT_DIR)/Flutter", 385 | ); 386 | PRODUCT_BUNDLE_IDENTIFIER = com.example.discoverPrinters; 387 | PRODUCT_NAME = "$(TARGET_NAME)"; 388 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 389 | SWIFT_VERSION = 5.0; 390 | VERSIONING_SYSTEM = "apple-generic"; 391 | }; 392 | name = Profile; 393 | }; 394 | 97C147031CF9000F007C117D /* Debug */ = { 395 | isa = XCBuildConfiguration; 396 | buildSettings = { 397 | ALWAYS_SEARCH_USER_PATHS = NO; 398 | CLANG_ANALYZER_NONNULL = YES; 399 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 400 | CLANG_CXX_LIBRARY = "libc++"; 401 | CLANG_ENABLE_MODULES = YES; 402 | CLANG_ENABLE_OBJC_ARC = YES; 403 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 404 | CLANG_WARN_BOOL_CONVERSION = YES; 405 | CLANG_WARN_COMMA = YES; 406 | CLANG_WARN_CONSTANT_CONVERSION = YES; 407 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 408 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 409 | CLANG_WARN_EMPTY_BODY = YES; 410 | CLANG_WARN_ENUM_CONVERSION = YES; 411 | CLANG_WARN_INFINITE_RECURSION = YES; 412 | CLANG_WARN_INT_CONVERSION = YES; 413 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 414 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 415 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 416 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 417 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 418 | CLANG_WARN_STRICT_PROTOTYPES = YES; 419 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 420 | CLANG_WARN_UNREACHABLE_CODE = YES; 421 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 422 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 423 | COPY_PHASE_STRIP = NO; 424 | DEBUG_INFORMATION_FORMAT = dwarf; 425 | ENABLE_STRICT_OBJC_MSGSEND = YES; 426 | ENABLE_TESTABILITY = YES; 427 | GCC_C_LANGUAGE_STANDARD = gnu99; 428 | GCC_DYNAMIC_NO_PIC = NO; 429 | GCC_NO_COMMON_BLOCKS = YES; 430 | GCC_OPTIMIZATION_LEVEL = 0; 431 | GCC_PREPROCESSOR_DEFINITIONS = ( 432 | "DEBUG=1", 433 | "$(inherited)", 434 | ); 435 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 436 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 437 | GCC_WARN_UNDECLARED_SELECTOR = YES; 438 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 439 | GCC_WARN_UNUSED_FUNCTION = YES; 440 | GCC_WARN_UNUSED_VARIABLE = YES; 441 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 442 | MTL_ENABLE_DEBUG_INFO = YES; 443 | ONLY_ACTIVE_ARCH = YES; 444 | SDKROOT = iphoneos; 445 | TARGETED_DEVICE_FAMILY = "1,2"; 446 | }; 447 | name = Debug; 448 | }; 449 | 97C147041CF9000F007C117D /* Release */ = { 450 | isa = XCBuildConfiguration; 451 | buildSettings = { 452 | ALWAYS_SEARCH_USER_PATHS = NO; 453 | CLANG_ANALYZER_NONNULL = YES; 454 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 455 | CLANG_CXX_LIBRARY = "libc++"; 456 | CLANG_ENABLE_MODULES = YES; 457 | CLANG_ENABLE_OBJC_ARC = YES; 458 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 459 | CLANG_WARN_BOOL_CONVERSION = YES; 460 | CLANG_WARN_COMMA = YES; 461 | CLANG_WARN_CONSTANT_CONVERSION = YES; 462 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 463 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 464 | CLANG_WARN_EMPTY_BODY = YES; 465 | CLANG_WARN_ENUM_CONVERSION = YES; 466 | CLANG_WARN_INFINITE_RECURSION = YES; 467 | CLANG_WARN_INT_CONVERSION = YES; 468 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 469 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 470 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 471 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 472 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 473 | CLANG_WARN_STRICT_PROTOTYPES = YES; 474 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 475 | CLANG_WARN_UNREACHABLE_CODE = YES; 476 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 477 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 478 | COPY_PHASE_STRIP = NO; 479 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 480 | ENABLE_NS_ASSERTIONS = NO; 481 | ENABLE_STRICT_OBJC_MSGSEND = YES; 482 | GCC_C_LANGUAGE_STANDARD = gnu99; 483 | GCC_NO_COMMON_BLOCKS = YES; 484 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 485 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 486 | GCC_WARN_UNDECLARED_SELECTOR = YES; 487 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 488 | GCC_WARN_UNUSED_FUNCTION = YES; 489 | GCC_WARN_UNUSED_VARIABLE = YES; 490 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 491 | MTL_ENABLE_DEBUG_INFO = NO; 492 | SDKROOT = iphoneos; 493 | SUPPORTED_PLATFORMS = iphoneos; 494 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 495 | TARGETED_DEVICE_FAMILY = "1,2"; 496 | VALIDATE_PRODUCT = YES; 497 | }; 498 | name = Release; 499 | }; 500 | 97C147061CF9000F007C117D /* Debug */ = { 501 | isa = XCBuildConfiguration; 502 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 503 | buildSettings = { 504 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 505 | CLANG_ENABLE_MODULES = YES; 506 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 507 | DEVELOPMENT_TEAM = 8YA3WTV6AF; 508 | ENABLE_BITCODE = NO; 509 | FRAMEWORK_SEARCH_PATHS = ( 510 | "$(inherited)", 511 | "$(PROJECT_DIR)/Flutter", 512 | ); 513 | INFOPLIST_FILE = Runner/Info.plist; 514 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 515 | LIBRARY_SEARCH_PATHS = ( 516 | "$(inherited)", 517 | "$(PROJECT_DIR)/Flutter", 518 | ); 519 | PRODUCT_BUNDLE_IDENTIFIER = com.example.discoverPrinters; 520 | PRODUCT_NAME = "$(TARGET_NAME)"; 521 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 522 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 523 | SWIFT_VERSION = 5.0; 524 | VERSIONING_SYSTEM = "apple-generic"; 525 | }; 526 | name = Debug; 527 | }; 528 | 97C147071CF9000F007C117D /* Release */ = { 529 | isa = XCBuildConfiguration; 530 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 531 | buildSettings = { 532 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 533 | CLANG_ENABLE_MODULES = YES; 534 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 535 | DEVELOPMENT_TEAM = 8YA3WTV6AF; 536 | ENABLE_BITCODE = NO; 537 | FRAMEWORK_SEARCH_PATHS = ( 538 | "$(inherited)", 539 | "$(PROJECT_DIR)/Flutter", 540 | ); 541 | INFOPLIST_FILE = Runner/Info.plist; 542 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 543 | LIBRARY_SEARCH_PATHS = ( 544 | "$(inherited)", 545 | "$(PROJECT_DIR)/Flutter", 546 | ); 547 | PRODUCT_BUNDLE_IDENTIFIER = com.example.discoverPrinters; 548 | PRODUCT_NAME = "$(TARGET_NAME)"; 549 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 550 | SWIFT_VERSION = 5.0; 551 | VERSIONING_SYSTEM = "apple-generic"; 552 | }; 553 | name = Release; 554 | }; 555 | /* End XCBuildConfiguration section */ 556 | 557 | /* Begin XCConfigurationList section */ 558 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 559 | isa = XCConfigurationList; 560 | buildConfigurations = ( 561 | 97C147031CF9000F007C117D /* Debug */, 562 | 97C147041CF9000F007C117D /* Release */, 563 | 249021D3217E4FDB00AE95B9 /* Profile */, 564 | ); 565 | defaultConfigurationIsVisible = 0; 566 | defaultConfigurationName = Release; 567 | }; 568 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 569 | isa = XCConfigurationList; 570 | buildConfigurations = ( 571 | 97C147061CF9000F007C117D /* Debug */, 572 | 97C147071CF9000F007C117D /* Release */, 573 | 249021D4217E4FDB00AE95B9 /* Profile */, 574 | ); 575 | defaultConfigurationIsVisible = 0; 576 | defaultConfigurationName = Release; 577 | }; 578 | /* End XCConfigurationList section */ 579 | }; 580 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 581 | } 582 | --------------------------------------------------------------------------------