diff --git a/android/build.gradle b/android/build.gradle index 204dc24..7b31c61 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -58,6 +58,6 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1' - implementation 'com.brother.sdk:printer:4.6.1@aar' + implementation 'com.brother.sdk:printer:4.12.0@aar' implementation 'com.brother.typeb:print:1.0.0' } diff --git a/android/src/main/kotlin/com/rouninlabs/another_brother/AnotherBrotherPlugin.kt b/android/src/main/kotlin/com/rouninlabs/another_brother/AnotherBrotherPlugin.kt index 78218dd..b832310 100644 --- a/android/src/main/kotlin/com/rouninlabs/another_brother/AnotherBrotherPlugin.kt +++ b/android/src/main/kotlin/com/rouninlabs/another_brother/AnotherBrotherPlugin.kt @@ -11,7 +11,6 @@ import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel.MethodCallHandler import io.flutter.plugin.common.MethodChannel.Result -//import io.flutter.plugin.common.PluginRegistry.Registrar import kotlin.contracts.contract /** AnotherBrotherPlugin */ diff --git a/android/src/main/kotlin/com/rouninlabs/another_brother/method/BrotherUtils.kt b/android/src/main/kotlin/com/rouninlabs/another_brother/method/BrotherUtils.kt index e36d817..491775d 100644 --- a/android/src/main/kotlin/com/rouninlabs/another_brother/method/BrotherUtils.kt +++ b/android/src/main/kotlin/com/rouninlabs/another_brother/method/BrotherUtils.kt @@ -135,8 +135,8 @@ fun paperKindFromMap(map:Map):PaperKind { return PaperKind.valueOf(name) } fun modelFromMap(map: Map): PrinterInfo.Model { - val id: Int = map["id"] as Int; - return PrinterInfo.Model.valueFromID(id); + val id: Int = map["id"] as Int + return PrinterInfo.Model.valueFromID(id) } fun TimeoutSettingFromMap(map: Map): TimeoutSetting { diff --git a/custom_paper/CustomTD2135NWBPaper/TD2135NWB-RD40x40mm.bin b/custom_paper/CustomTD2135NWBPaper/TD2135NWB-40x40mm.bin similarity index 100% rename from custom_paper/CustomTD2135NWBPaper/TD2135NWB-RD40x40mm.bin rename to custom_paper/CustomTD2135NWBPaper/TD2135NWB-40x40mm.bin diff --git a/custom_paper/CustomTD2135NWBPaper/TD2135NWB-RD57mm.bin b/custom_paper/CustomTD2135NWBPaper/TD2135NWB-57mm.bin similarity index 100% rename from custom_paper/CustomTD2135NWBPaper/TD2135NWB-RD57mm.bin rename to custom_paper/CustomTD2135NWBPaper/TD2135NWB-57mm.bin diff --git a/custom_paper/CustomTD2350DPaper/TD2350D-51mm_26mm.bin b/custom_paper/CustomTD2350DPaper/TD2350D-51mm_26mm.bin new file mode 100644 index 0000000..254cf3e Binary files /dev/null and b/custom_paper/CustomTD2350DPaper/TD2350D-51mm_26mm.bin differ diff --git a/custom_paper/CustomTD2350DPaper/TD2350D-57mm.bin b/custom_paper/CustomTD2350DPaper/TD2350D-57mm.bin new file mode 100644 index 0000000..0c556ff Binary files /dev/null and b/custom_paper/CustomTD2350DPaper/TD2350D-57mm.bin differ diff --git a/custom_paper/CustomTD2350DPaper/TD2350D-58mm.bin b/custom_paper/CustomTD2350DPaper/TD2350D-58mm.bin new file mode 100644 index 0000000..b29260c Binary files /dev/null and b/custom_paper/CustomTD2350DPaper/TD2350D-58mm.bin differ diff --git a/lib/custom_paper.dart b/lib/custom_paper.dart index e5ca33a..19f980a 100644 --- a/lib/custom_paper.dart +++ b/lib/custom_paper.dart @@ -1,4 +1,3 @@ - import 'package:another_brother/label_info.dart'; abstract class ACustomPaper implements ALabelName { @@ -11,29 +10,27 @@ class BinPaper_RJ2050 implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomRJ2050Paper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomRJ2050Paper"; const BinPaper_RJ2050._internal(this._name, this._assetPath); - static const RD_W50mm = const BinPaper_RJ2050._internal("RJ2050-RD50mm", "$_rootDir/RJ2050-RD50mm.bin"); - static const RD_W58mm = const BinPaper_RJ2050._internal("RJ2050-RD58mm", "$_rootDir/RJ2050-RD58mm.bin"); + static const RD_W50mm = const BinPaper_RJ2050._internal( + "RJ2050-RD50mm", "$_rootDir/RJ2050-RD50mm.bin"); + static const RD_W58mm = const BinPaper_RJ2050._internal( + "RJ2050-RD58mm", "$_rootDir/RJ2050-RD58mm.bin"); static const UNSUPPORTED = const BinPaper_RJ2050._internal("UNSUPPORTED", ""); - static final _values = [ - RD_W50mm, - RD_W58mm, - UNSUPPORTED - ]; + static final _values = [RD_W50mm, RD_W58mm, UNSUPPORTED]; static BinPaper_RJ2050 valueFromName(String name) { for (int i = 0; i < _values.length; i++) { - if (_values[i].getName() == name) { - return _values[i]; - } + if (_values[i].getName() == name) { + return _values[i]; + } } return UNSUPPORTED; } - static List getValues() => List.from(_values); @override @@ -43,28 +40,32 @@ class BinPaper_RJ2050 implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } - } class BinPaper_RJ2150 implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomRJ2150Paper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomRJ2150Paper"; const BinPaper_RJ2150._internal(this._name, this._assetPath); - static const RD_W2H4in = const BinPaper_RJ2150._internal("RJ2150-2x4in", "$_rootDir/RJ2150-2x4inch.bin"); - static const RD_W1_9H3_3in = const BinPaper_RJ2150._internal("RJ2150-RD1.9x3.3i", "$_rootDir/RJ2150-RD1.9x3.3inch.bin"); - static const RD_W50mm = const BinPaper_RJ2150._internal("RJ2150-RD50mm", "$_rootDir/RJ2150-RD50mm.bin"); - static const RD_W50H85mm = const BinPaper_RJ2150._internal("RJ2150-RD50x85mm", "$_rootDir/RJ2150-RD50x85mm.bin"); - static const RD_W58mm = const BinPaper_RJ2150._internal("RJ2150-RD58mm", "$_rootDir/RJ2150-RD58mm.bin"); - static const RD_W2H1in = const BinPaper_RJ2150._internal("RJ2150_20ix10i", "$_rootDir/RJ2150_20ix10i.bin"); - static const RD_W2_1H1_5in = const BinPaper_RJ2150._internal("RJ2150_21ix15i", "$_rootDir/RJ2150_21ix15i.bin"); + static const RD_W2H4in = const BinPaper_RJ2150._internal( + "RJ2150-2x4in", "$_rootDir/RJ2150-2x4inch.bin"); + static const RD_W1_9H3_3in = const BinPaper_RJ2150._internal( + "RJ2150-RD1.9x3.3i", "$_rootDir/RJ2150-RD1.9x3.3inch.bin"); + static const RD_W50mm = const BinPaper_RJ2150._internal( + "RJ2150-RD50mm", "$_rootDir/RJ2150-RD50mm.bin"); + static const RD_W50H85mm = const BinPaper_RJ2150._internal( + "RJ2150-RD50x85mm", "$_rootDir/RJ2150-RD50x85mm.bin"); + static const RD_W58mm = const BinPaper_RJ2150._internal( + "RJ2150-RD58mm", "$_rootDir/RJ2150-RD58mm.bin"); + static const RD_W2H1in = const BinPaper_RJ2150._internal( + "RJ2150_20ix10i", "$_rootDir/RJ2150_20ix10i.bin"); + static const RD_W2_1H1_5in = const BinPaper_RJ2150._internal( + "RJ2150_21ix15i", "$_rootDir/RJ2150_21ix15i.bin"); static const UNSUPPORTED = const BinPaper_RJ2150._internal("UNSUPPORTED", ""); static final _values = [ @@ -95,27 +96,30 @@ class BinPaper_RJ2150 implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } - } class BinPaper_RJ3050Ai implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomRJ3050AiPaper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomRJ3050AiPaper"; const BinPaper_RJ3050Ai._internal(this._name, this._assetPath); - static const RD_W76mm = const BinPaper_RJ3050Ai._internal("RJ3050Ai-RD76mm", "$_rootDir/RJ3050Ai-RD76mm.bin"); - static const RD_W2_2in = const BinPaper_RJ3050Ai._internal("RJ-3050Ai_RD2.2Continuous", "$_rootDir/RJ-3050Ai_RD2.2Continuous.bin"); - static const RD_W50mm = const BinPaper_RJ3050Ai._internal("RJ-3050Ai_RD50mmContinuous", "$_rootDir/RJ-3050Ai_RD50mmContinuous.bin"); - static const RD_W58mm = const BinPaper_RJ3050Ai._internal("RJ-3050Ai_RD58mmContinuous", "$_rootDir/RJ-3050Ai_RD58mmContinuous.bin"); - static const RD_W80mm = const BinPaper_RJ3050Ai._internal("RJ-3050Ai_RD80mmContinuous", "$_rootDir/RJ-3050Ai_RD80mmContinuous.bin"); - static const UNSUPPORTED = const BinPaper_RJ3050Ai._internal("UNSUPPORTED", ""); + static const RD_W76mm = const BinPaper_RJ3050Ai._internal( + "RJ3050Ai-RD76mm", "$_rootDir/RJ3050Ai-RD76mm.bin"); + static const RD_W2_2in = const BinPaper_RJ3050Ai._internal( + "RJ-3050Ai_RD2.2Continuous", "$_rootDir/RJ-3050Ai_RD2.2Continuous.bin"); + static const RD_W50mm = const BinPaper_RJ3050Ai._internal( + "RJ-3050Ai_RD50mmContinuous", "$_rootDir/RJ-3050Ai_RD50mmContinuous.bin"); + static const RD_W58mm = const BinPaper_RJ3050Ai._internal( + "RJ-3050Ai_RD58mmContinuous", "$_rootDir/RJ-3050Ai_RD58mmContinuous.bin"); + static const RD_W80mm = const BinPaper_RJ3050Ai._internal( + "RJ-3050Ai_RD80mmContinuous", "$_rootDir/RJ-3050Ai_RD80mmContinuous.bin"); + static const UNSUPPORTED = + const BinPaper_RJ3050Ai._internal("UNSUPPORTED", ""); static final _values = [ RD_W76mm, @@ -143,34 +147,29 @@ class BinPaper_RJ3050Ai implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } - } class BinPaper_RJ3050 implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomRJ3050Paper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomRJ3050Paper"; const BinPaper_RJ3050._internal(this._name, this._assetPath); - static const RD_W1_9in = const BinPaper_RJ3050._internal("RJ3050-RD1.90inch", "$_rootDir/RJ3050-RD1.90inch.bin"); - static const RD_W2in = const BinPaper_RJ3050._internal("RJ3050-RD2.00inch", "$_rootDir/RJ3050-RD2.00inch.bin"); - static const RD_W3in = const BinPaper_RJ3050._internal("RJ3050-RD3.00inch", "$_rootDir/RJ3050-RD3.00inch.bin"); - static const RD_W3_15in = const BinPaper_RJ3050._internal("RJ3050-RD3.15inch", "$_rootDir/RJ3050-RD3.15inch.bin"); + static const RD_W1_9in = const BinPaper_RJ3050._internal( + "RJ3050-RD1.90inch", "$_rootDir/RJ3050-RD1.90inch.bin"); + static const RD_W2in = const BinPaper_RJ3050._internal( + "RJ3050-RD2.00inch", "$_rootDir/RJ3050-RD2.00inch.bin"); + static const RD_W3in = const BinPaper_RJ3050._internal( + "RJ3050-RD3.00inch", "$_rootDir/RJ3050-RD3.00inch.bin"); + static const RD_W3_15in = const BinPaper_RJ3050._internal( + "RJ3050-RD3.15inch", "$_rootDir/RJ3050-RD3.15inch.bin"); static const UNSUPPORTED = const BinPaper_RJ3050._internal("UNSUPPORTED", ""); - static final _values = [ - RD_W1_9in, - RD_W2in, - RD_W3in, - RD_W3_15in, - UNSUPPORTED - ]; + static final _values = [RD_W1_9in, RD_W2in, RD_W3in, RD_W3_15in, UNSUPPORTED]; List getValues() => List.from(_values); @override @@ -189,28 +188,32 @@ class BinPaper_RJ3050 implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } - } class BinPaper_RJ3150Ai implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomRJ3150AiPaper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomRJ3150AiPaper"; const BinPaper_RJ3150Ai._internal(this._name, this._assetPath); - static const RD_W76mm = const BinPaper_RJ3150Ai._internal("RJ3150Ai-RD76mm", "$_rootDir/RJ3150Ai-RD76mm.bin"); - static const RD_W76H44mm = const BinPaper_RJ3150Ai._internal("RJ3150Ai-RD76mm44mm", "$_rootDir/RJ3150Ai-RD76mm44mm.bin"); - static const RD_W2_2in = const BinPaper_RJ3150Ai._internal("RJ-3150Ai_RD2.2Continuous", "$_rootDir/RJ-3150Ai_RD2.2Continuous.bin"); - static const RD_W50mm = const BinPaper_RJ3150Ai._internal("RJ-3150Ai_RD50mmContinuous", "$_rootDir/RJ-3150Ai_RD50mmContinuous.bin"); - static const RD_W58mm = const BinPaper_RJ3150Ai._internal("RJ-3150Ai_RD58mmContinuous", "$_rootDir/RJ-3150Ai_RD58mmContinuous.bin"); - static const RD_W80mm = const BinPaper_RJ3150Ai._internal("RJ-3150Ai_RD80mmContinuous", "$_rootDir/RJ-3150Ai_RD80mmContinuous.bin"); - static const UNSUPPORTED = const BinPaper_RJ3150Ai._internal("UNSUPPORTED", ""); + static const RD_W76mm = const BinPaper_RJ3150Ai._internal( + "RJ3150Ai-RD76mm", "$_rootDir/RJ3150Ai-RD76mm.bin"); + static const RD_W76H44mm = const BinPaper_RJ3150Ai._internal( + "RJ3150Ai-RD76mm44mm", "$_rootDir/RJ3150Ai-RD76mm44mm.bin"); + static const RD_W2_2in = const BinPaper_RJ3150Ai._internal( + "RJ-3150Ai_RD2.2Continuous", "$_rootDir/RJ-3150Ai_RD2.2Continuous.bin"); + static const RD_W50mm = const BinPaper_RJ3150Ai._internal( + "RJ-3150Ai_RD50mmContinuous", "$_rootDir/RJ-3150Ai_RD50mmContinuous.bin"); + static const RD_W58mm = const BinPaper_RJ3150Ai._internal( + "RJ-3150Ai_RD58mmContinuous", "$_rootDir/RJ-3150Ai_RD58mmContinuous.bin"); + static const RD_W80mm = const BinPaper_RJ3150Ai._internal( + "RJ-3150Ai_RD80mmContinuous", "$_rootDir/RJ-3150Ai_RD80mmContinuous.bin"); + static const UNSUPPORTED = + const BinPaper_RJ3150Ai._internal("UNSUPPORTED", ""); static final _values = [ RD_W76mm, @@ -239,37 +242,48 @@ class BinPaper_RJ3150Ai implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } - } class BinPaper_RJ3150 implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomRJ3150Paper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomRJ3150Paper"; const BinPaper_RJ3150._internal(this._name, this._assetPath); - static const RD_W1H1in = const BinPaper_RJ3150._internal("RJ3150-RD1.0x1.0[1]", "$_rootDir/RJ3150-RD1.0x1.0[1].bin"); - static const RD_W1_9in = const BinPaper_RJ3150._internal("RJ3150-RD1.9inch", "$_rootDir/RJ3150-RD1.9inch.bin"); - static const RD_W1_9H3_3in = const BinPaper_RJ3150._internal("RJ3150-RD1.9x3.3", "$_rootDir/RJ3150-RD1.9x3.3.bin"); - static const RD_W2in = const BinPaper_RJ3150._internal("RJ3150-RD2.0inch", "$_rootDir/RJ3150-RD2.0inch.bin"); - static const RD_W2H1in = const BinPaper_RJ3150._internal("RJ3150-RD2.0x1.0[1]", "$_rootDir/RJ3150-RD2.0x1.0[1].bin"); - static const RD_W2_3H3_6in = const BinPaper_RJ3150._internal("RJ3150-RD2.3x3.6", "$_rootDir/RJ3150-RD2.3x3.6.bin"); - static const RD_W3in = const BinPaper_RJ3150._internal("RJ3150-RD3.0inch", "$_rootDir/RJ3150-RD3.0inch.bin"); - static const RD_W3H1in = const BinPaper_RJ3150._internal("RJ3150-RD3.0x1.0[1]", "$_rootDir/RJ3150-RD3.0x1.0[1].bin"); - static const RD_W3H1_75mm = const BinPaper_RJ3150._internal("RJ3150-RD3.0x1.75", "$_rootDir/RJ3150-RD3.0x1.75.bin"); - static const RD_W3_15in = const BinPaper_RJ3150._internal("RJ3150-RD3.15inch", "$_rootDir/RJ3150-RD3.15inch.bin"); - static const RD_W50H85mm = const BinPaper_RJ3150._internal("RJ3150-RD50_85mm", "$_rootDir/RJ3150-RD50_85mm.bin"); - static const RD_W60H92mm = const BinPaper_RJ3150._internal("RJ3150-RD60_92mm", "$_rootDir/RJ3150-RD60_92mm.bin"); - static const RD_W76H44mm = const BinPaper_RJ3150._internal("RJ3150-RD76_44mm", "$_rootDir/RJ3150-RD76_44mm.bin"); + static const RD_W1H1in = const BinPaper_RJ3150._internal( + "RJ3150-RD1.0x1.0[1]", "$_rootDir/RJ3150-RD1.0x1.0[1].bin"); + static const RD_W1_9in = const BinPaper_RJ3150._internal( + "RJ3150-RD1.9inch", "$_rootDir/RJ3150-RD1.9inch.bin"); + static const RD_W1_9H3_3in = const BinPaper_RJ3150._internal( + "RJ3150-RD1.9x3.3", "$_rootDir/RJ3150-RD1.9x3.3.bin"); + static const RD_W2in = const BinPaper_RJ3150._internal( + "RJ3150-RD2.0inch", "$_rootDir/RJ3150-RD2.0inch.bin"); + static const RD_W2H1in = const BinPaper_RJ3150._internal( + "RJ3150-RD2.0x1.0[1]", "$_rootDir/RJ3150-RD2.0x1.0[1].bin"); + static const RD_W2_3H3_6in = const BinPaper_RJ3150._internal( + "RJ3150-RD2.3x3.6", "$_rootDir/RJ3150-RD2.3x3.6.bin"); + static const RD_W3in = const BinPaper_RJ3150._internal( + "RJ3150-RD3.0inch", "$_rootDir/RJ3150-RD3.0inch.bin"); + static const RD_W3H1in = const BinPaper_RJ3150._internal( + "RJ3150-RD3.0x1.0[1]", "$_rootDir/RJ3150-RD3.0x1.0[1].bin"); + static const RD_W3H1_75mm = const BinPaper_RJ3150._internal( + "RJ3150-RD3.0x1.75", "$_rootDir/RJ3150-RD3.0x1.75.bin"); + static const RD_W3_15in = const BinPaper_RJ3150._internal( + "RJ3150-RD3.15inch", "$_rootDir/RJ3150-RD3.15inch.bin"); + static const RD_W50H85mm = const BinPaper_RJ3150._internal( + "RJ3150-RD50_85mm", "$_rootDir/RJ3150-RD50_85mm.bin"); + static const RD_W60H92mm = const BinPaper_RJ3150._internal( + "RJ3150-RD60_92mm", "$_rootDir/RJ3150-RD60_92mm.bin"); + static const RD_W76H44mm = const BinPaper_RJ3150._internal( + "RJ3150-RD76_44mm", "$_rootDir/RJ3150-RD76_44mm.bin"); static const UNSUPPORTED = const BinPaper_RJ3150._internal("UNSUPPORTED", ""); - static final _values = [RD_W1H1in, + static final _values = [ + RD_W1H1in, RD_W1_9in, RD_W1_9H3_3in, RD_W2in, @@ -302,30 +316,26 @@ class BinPaper_RJ3150 implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } - } class BinPaper_RJ3230B implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomRJ3230BPaper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomRJ3230BPaper"; const BinPaper_RJ3230B._internal(this._name, this._assetPath); - static const RD_W76mm = const BinPaper_RJ3230B._internal("RJ-3230B-RD76mm", "$_rootDir/RJ-3230B-RD76mm.bin"); - static const RD_W76_44mm = const BinPaper_RJ3230B._internal("RJ-3230b-RD76_44mm", "$_rootDir/RJ-3230b-RD76_44mm.bin"); - static const UNSUPPORTED = const BinPaper_RJ3230B._internal("UNSUPPORTED", ""); + static const RD_W76mm = const BinPaper_RJ3230B._internal( + "RJ-3230B-RD76mm", "$_rootDir/RJ-3230B-RD76mm.bin"); + static const RD_W76_44mm = const BinPaper_RJ3230B._internal( + "RJ-3230b-RD76_44mm", "$_rootDir/RJ-3230b-RD76_44mm.bin"); + static const UNSUPPORTED = + const BinPaper_RJ3230B._internal("UNSUPPORTED", ""); - static final _values = [ - RD_W76mm, - RD_W76_44mm, - UNSUPPORTED - ]; + static final _values = [RD_W76mm, RD_W76_44mm, UNSUPPORTED]; static List getValues() => List.from(_values); @override @@ -344,30 +354,26 @@ class BinPaper_RJ3230B implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } - } class BinPaper_RJ3250WB implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomRJ3250WBPaper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomRJ3250WBPaper"; const BinPaper_RJ3250WB._internal(this._name, this._assetPath); - static const RD_W76mm = const BinPaper_RJ3250WB._internal("RJ-3250WB-RD76mm", "$_rootDir/RJ-3250WB-RD76mm.bin"); - static const RD_W76_44mm = const BinPaper_RJ3250WB._internal("RJ3250WB-RD76_44mm", "$_rootDir/RJ3250WB-RD76_44mm.bin"); - static const UNSUPPORTED = const BinPaper_RJ3250WB._internal("UNSUPPORTED", ""); + static const RD_W76mm = const BinPaper_RJ3250WB._internal( + "RJ-3250WB-RD76mm", "$_rootDir/RJ-3250WB-RD76mm.bin"); + static const RD_W76_44mm = const BinPaper_RJ3250WB._internal( + "RJ3250WB-RD76_44mm", "$_rootDir/RJ3250WB-RD76_44mm.bin"); + static const UNSUPPORTED = + const BinPaper_RJ3250WB._internal("UNSUPPORTED", ""); - static final _values = [ - RD_W76mm, - RD_W76_44mm, - UNSUPPORTED - ]; + static final _values = [RD_W76mm, RD_W76_44mm, UNSUPPORTED]; static List getValues() => List.from(_values); @override @@ -386,30 +392,33 @@ class BinPaper_RJ3250WB implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } - } class BinPaper_RJ4030 implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomRJ4030Paper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomRJ4030Paper"; const BinPaper_RJ4030._internal(this._name, this._assetPath); //static const RD_W80H115mm = const BinPaper_RJ4030._internal("RJ4030Ai-RD80_115mm", "$_rootDir/RJ4030Ai-RD80_115mm.bin"); //static const RD_W2in = const BinPaper_RJ4030._internal("RJ-4030Ai-RD2inch", "$_rootDir/RJ-4030Ai-RD2inch.bin"); //static const RD_W3in = const BinPaper_RJ4030._internal("RJ-4030Ai-RD3inch", "$_rootDir/RJ-4030Ai-RD3inch.bin"); - static const RD_W4in = const BinPaper_RJ4030._internal("RJ-4030-RD4inch", "$_rootDir/RJ-4030-RD4inch.bin"); - static const RD_W4H1in = const BinPaper_RJ4030._internal("RJ-4030-RD4x1", "$_rootDir/RJ-4030-RD4x1.bin"); - static const RD_W4H2in = const BinPaper_RJ4030._internal("RJ-4030-RD4x2", "$_rootDir/RJ-4030-RD4x2.bin"); - static const RD_W4H3in = const BinPaper_RJ4030._internal("RJ-4030-RD4x3", "$_rootDir/RJ-4030-RD4x3.bin"); - static const RD_W4H4in = const BinPaper_RJ4030._internal("RJ-4030-RD4x4", "$_rootDir/RJ-4030-RD4x4.bin"); - static const RD_W102H152mm = const BinPaper_RJ4030._internal("RD_W102H152", "$_rootDir/RJ-4030-RD102mmX152mm.bin"); + static const RD_W4in = const BinPaper_RJ4030._internal( + "RJ-4030-RD4inch", "$_rootDir/RJ-4030-RD4inch.bin"); + static const RD_W4H1in = const BinPaper_RJ4030._internal( + "RJ-4030-RD4x1", "$_rootDir/RJ-4030-RD4x1.bin"); + static const RD_W4H2in = const BinPaper_RJ4030._internal( + "RJ-4030-RD4x2", "$_rootDir/RJ-4030-RD4x2.bin"); + static const RD_W4H3in = const BinPaper_RJ4030._internal( + "RJ-4030-RD4x3", "$_rootDir/RJ-4030-RD4x3.bin"); + static const RD_W4H4in = const BinPaper_RJ4030._internal( + "RJ-4030-RD4x4", "$_rootDir/RJ-4030-RD4x4.bin"); + static const RD_W102H152mm = const BinPaper_RJ4030._internal( + "RD_W102H152", "$_rootDir/RJ-4030-RD102mmX152mm.bin"); //static const RD_W4H6in = const BinPaper_RJ4030._internal("RJ-4030Ai-RD4x6", "$_rootDir/RJ-4030Ai-RD4x6.bin"); static const UNSUPPORTED = const BinPaper_RJ4030._internal("UNSUPPORTED", ""); @@ -444,31 +453,38 @@ class BinPaper_RJ4030 implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } - } class BinPaper_RJ4030Ai implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomRJ4030AiPaper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomRJ4030AiPaper"; const BinPaper_RJ4030Ai._internal(this._name, this._assetPath); - static const RD_W80H115mm = const BinPaper_RJ4030Ai._internal("RJ4030Ai-RD80_115mm", "$_rootDir/RJ4030Ai-RD80_115mm.bin"); - static const RD_W2in = const BinPaper_RJ4030Ai._internal("RJ-4030Ai-RD2inch", "$_rootDir/RJ-4030Ai-RD2inch.bin"); - static const RD_W3in = const BinPaper_RJ4030Ai._internal("RJ-4030Ai-RD3inch", "$_rootDir/RJ-4030Ai-RD3inch.bin"); - static const RD_W4in = const BinPaper_RJ4030Ai._internal("RJ-4030Ai-RD4inch", "$_rootDir/RJ-4030Ai-RD4inch.bin"); - static const RD_W4H1in = const BinPaper_RJ4030Ai._internal("RJ-4030Ai-RD4x1", "$_rootDir/RJ-4030Ai-RD4x1.bin"); - static const RD_W4H2in = const BinPaper_RJ4030Ai._internal("RJ-4030Ai-RD4x2", "$_rootDir/RJ-4030Ai-RD4x2.bin"); - static const RD_W4H3in = const BinPaper_RJ4030Ai._internal("RJ-4030Ai-RD4x3", "$_rootDir/RJ-4030Ai-RD4x3.bin"); - static const RD_W4H4in = const BinPaper_RJ4030Ai._internal("RJ-4030Ai-RD4x4", "$_rootDir/RJ-4030Ai-RD4x4.bin"); - static const RD_W4H6in = const BinPaper_RJ4030Ai._internal("RJ-4030Ai-RD4x6", "$_rootDir/RJ-4030Ai-RD4x6.bin"); - static const UNSUPPORTED = const BinPaper_RJ4030Ai._internal("UNSUPPORTED", ""); + static const RD_W80H115mm = const BinPaper_RJ4030Ai._internal( + "RJ4030Ai-RD80_115mm", "$_rootDir/RJ4030Ai-RD80_115mm.bin"); + static const RD_W2in = const BinPaper_RJ4030Ai._internal( + "RJ-4030Ai-RD2inch", "$_rootDir/RJ-4030Ai-RD2inch.bin"); + static const RD_W3in = const BinPaper_RJ4030Ai._internal( + "RJ-4030Ai-RD3inch", "$_rootDir/RJ-4030Ai-RD3inch.bin"); + static const RD_W4in = const BinPaper_RJ4030Ai._internal( + "RJ-4030Ai-RD4inch", "$_rootDir/RJ-4030Ai-RD4inch.bin"); + static const RD_W4H1in = const BinPaper_RJ4030Ai._internal( + "RJ-4030Ai-RD4x1", "$_rootDir/RJ-4030Ai-RD4x1.bin"); + static const RD_W4H2in = const BinPaper_RJ4030Ai._internal( + "RJ-4030Ai-RD4x2", "$_rootDir/RJ-4030Ai-RD4x2.bin"); + static const RD_W4H3in = const BinPaper_RJ4030Ai._internal( + "RJ-4030Ai-RD4x3", "$_rootDir/RJ-4030Ai-RD4x3.bin"); + static const RD_W4H4in = const BinPaper_RJ4030Ai._internal( + "RJ-4030Ai-RD4x4", "$_rootDir/RJ-4030Ai-RD4x4.bin"); + static const RD_W4H6in = const BinPaper_RJ4030Ai._internal( + "RJ-4030Ai-RD4x6", "$_rootDir/RJ-4030Ai-RD4x6.bin"); + static const UNSUPPORTED = + const BinPaper_RJ4030Ai._internal("UNSUPPORTED", ""); static final _values = [ RD_W80H115mm, @@ -500,33 +516,42 @@ class BinPaper_RJ4030Ai implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } - } class BinPaper_RJ4040 implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomRJ4040Paper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomRJ4040Paper"; const BinPaper_RJ4040._internal(this._name, this._assetPath); - static const RD_W3in = const BinPaper_RJ4040._internal("RJ4040-RD3inch", "$_rootDir/RJ4040-RD3inch.bin"); - static const RD_W4in = const BinPaper_RJ4040._internal("RJ4040-RD4inch", "$_rootDir/RJ4040-RD4inch.bin"); - static const RD_W4H1in = const BinPaper_RJ4040._internal("RJ4040-RD4x1", "$_rootDir/RJ4040-RD4x1.bin"); - static const RD_W4H2in = const BinPaper_RJ4040._internal("RJ4040-RD4x2", "$_rootDir/RJ4040-RD4x2.bin"); - static const RD_W4H3in = const BinPaper_RJ4040._internal("RJ4040-RD4x3", "$_rootDir/RJ4040-RD4x3.bin"); - static const RD_W4H4in = const BinPaper_RJ4040._internal("RJ4040-RD4x4", "$_rootDir/RJ4040-RD4x4.bin"); - static const RD_W4H6in = const BinPaper_RJ4040._internal("RJ4040-RD4x6", "$_rootDir/RJ4040-RD4x6.bin"); - static const RD_W50H85mm = const BinPaper_RJ4040._internal("RJ4040-RD50_85mm", "$_rootDir/RJ4040-RD50_85mm.bin"); - static const RD_W58mm = const BinPaper_RJ4040._internal("RJ4040-RD58mm", "$_rootDir/RJ4040-RD58mm.bin"); - static const RD_W60H92mm = const BinPaper_RJ4040._internal("RJ4040-RD60_92mm", "$_rootDir/RJ4040-RD60_92mm.bin"); - static const RD_W80H115mm = const BinPaper_RJ4040._internal("RJ4040-RD80_115mm", "$_rootDir/RJ4040-RD80_115mm.bin"); - static const RD_W115H80mm = const BinPaper_RJ4040._internal("RJ4040-RD115_80mm", "$_rootDir/RJ4040-RD115_80mm.bin"); + static const RD_W3in = const BinPaper_RJ4040._internal( + "RJ4040-RD3inch", "$_rootDir/RJ4040-RD3inch.bin"); + static const RD_W4in = const BinPaper_RJ4040._internal( + "RJ4040-RD4inch", "$_rootDir/RJ4040-RD4inch.bin"); + static const RD_W4H1in = const BinPaper_RJ4040._internal( + "RJ4040-RD4x1", "$_rootDir/RJ4040-RD4x1.bin"); + static const RD_W4H2in = const BinPaper_RJ4040._internal( + "RJ4040-RD4x2", "$_rootDir/RJ4040-RD4x2.bin"); + static const RD_W4H3in = const BinPaper_RJ4040._internal( + "RJ4040-RD4x3", "$_rootDir/RJ4040-RD4x3.bin"); + static const RD_W4H4in = const BinPaper_RJ4040._internal( + "RJ4040-RD4x4", "$_rootDir/RJ4040-RD4x4.bin"); + static const RD_W4H6in = const BinPaper_RJ4040._internal( + "RJ4040-RD4x6", "$_rootDir/RJ4040-RD4x6.bin"); + static const RD_W50H85mm = const BinPaper_RJ4040._internal( + "RJ4040-RD50_85mm", "$_rootDir/RJ4040-RD50_85mm.bin"); + static const RD_W58mm = const BinPaper_RJ4040._internal( + "RJ4040-RD58mm", "$_rootDir/RJ4040-RD58mm.bin"); + static const RD_W60H92mm = const BinPaper_RJ4040._internal( + "RJ4040-RD60_92mm", "$_rootDir/RJ4040-RD60_92mm.bin"); + static const RD_W80H115mm = const BinPaper_RJ4040._internal( + "RJ4040-RD80_115mm", "$_rootDir/RJ4040-RD80_115mm.bin"); + static const RD_W115H80mm = const BinPaper_RJ4040._internal( + "RJ4040-RD115_80mm", "$_rootDir/RJ4040-RD115_80mm.bin"); static const UNSUPPORTED = const BinPaper_RJ4040._internal("UNSUPPORTED", ""); static final _values = [ @@ -563,32 +588,40 @@ class BinPaper_RJ4040 implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } - } class BinPaper_RJ4230 implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomRJ4230Paper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomRJ4230Paper"; const BinPaper_RJ4230._internal(this._name, this._assetPath); - static const RD_W1_9H3_3in = const BinPaper_RJ4230._internal("RJ4230B-RD1.9x3.3", "$_rootDir/RJ4230B-RD1.9x3.3.bin"); - static const RD_W2_2in = const BinPaper_RJ4230._internal("RJ4230B-RD2.2inch", "$_rootDir/RJ4230B-RD2.2inch.bin"); - static const RD_W2_3H3_6in = const BinPaper_RJ4230._internal("RJ4230B-RD2.3x3.6", "$_rootDir/RJ4230B-RD2.3x3.6.bin"); - static const RD_W3_1H4_5in = const BinPaper_RJ4230._internal("RJ4230B-RD3.1x4.5", "$_rootDir/RJ4230B-RD3.1x4.5.bin"); - static const RD_W4in = const BinPaper_RJ4230._internal("RJ4230B-RD4inch", "$_rootDir/RJ4230B-RD4inch.bin"); - static const RD_W4H1in = const BinPaper_RJ4230._internal("RJ4230B-RD4x1", "$_rootDir/RJ4230B-RD4x1.bin"); - static const RD_W4H2in = const BinPaper_RJ4230._internal("RJ4230B-RD4x2", "$_rootDir/RJ4230B-RD4x2.bin"); - static const RD_W4H3in = const BinPaper_RJ4230._internal("RJ4230B-RD4x3", "$_rootDir/RJ4230B-RD4x3.bin"); - static const RD_W4H4in = const BinPaper_RJ4230._internal("RJ4230B-RD4x4", "$_rootDir/RJ4230B-RD4x4.bin"); - static const RD_W4H6in = const BinPaper_RJ4230._internal("RJ4230B-RD4x6", "$_rootDir/RJ4230B-RD4x6.bin"); - static const RD_W80mm = const BinPaper_RJ4230._internal("RJ4230B-RD80mm", "$_rootDir/RJ4230B-RD80mm.bin"); + static const RD_W1_9H3_3in = const BinPaper_RJ4230._internal( + "RJ4230B-RD1.9x3.3", "$_rootDir/RJ4230B-RD1.9x3.3.bin"); + static const RD_W2_2in = const BinPaper_RJ4230._internal( + "RJ4230B-RD2.2inch", "$_rootDir/RJ4230B-RD2.2inch.bin"); + static const RD_W2_3H3_6in = const BinPaper_RJ4230._internal( + "RJ4230B-RD2.3x3.6", "$_rootDir/RJ4230B-RD2.3x3.6.bin"); + static const RD_W3_1H4_5in = const BinPaper_RJ4230._internal( + "RJ4230B-RD3.1x4.5", "$_rootDir/RJ4230B-RD3.1x4.5.bin"); + static const RD_W4in = const BinPaper_RJ4230._internal( + "RJ4230B-RD4inch", "$_rootDir/RJ4230B-RD4inch.bin"); + static const RD_W4H1in = const BinPaper_RJ4230._internal( + "RJ4230B-RD4x1", "$_rootDir/RJ4230B-RD4x1.bin"); + static const RD_W4H2in = const BinPaper_RJ4230._internal( + "RJ4230B-RD4x2", "$_rootDir/RJ4230B-RD4x2.bin"); + static const RD_W4H3in = const BinPaper_RJ4230._internal( + "RJ4230B-RD4x3", "$_rootDir/RJ4230B-RD4x3.bin"); + static const RD_W4H4in = const BinPaper_RJ4230._internal( + "RJ4230B-RD4x4", "$_rootDir/RJ4230B-RD4x4.bin"); + static const RD_W4H6in = const BinPaper_RJ4230._internal( + "RJ4230B-RD4x6", "$_rootDir/RJ4230B-RD4x6.bin"); + static const RD_W80mm = const BinPaper_RJ4230._internal( + "RJ4230B-RD80mm", "$_rootDir/RJ4230B-RD80mm.bin"); static const UNSUPPORTED = const BinPaper_RJ4230._internal("UNSUPPORTED", ""); static final _values = [ @@ -623,36 +656,46 @@ class BinPaper_RJ4230 implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } - } - class BinPaper_RJ4250 implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomRJ4250Paper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomRJ4250Paper"; const BinPaper_RJ4250._internal(this._name, this._assetPath); - static const RD_W1_9H3_3in = const BinPaper_RJ4250._internal("RJ4250WB-RD1.9x3.3in", "$_rootDir/RJ4250WB-RD1.9x3.3.bin"); - static const RD_W2_2in = const BinPaper_RJ4250._internal("RJ4250WB-RD2.2in", "$_rootDir/RJ4250WB-RD2.2inch.bin"); - static const RD_W2_3H3_6in = const BinPaper_RJ4250._internal("RJ4250WB-RD2.3x3.6in", "$_rootDir/RJ4250WB-RD2.3x3.6.bin"); - static const RD_W3_1H4_5in = const BinPaper_RJ4250._internal("RJ4250WB-RD3.1x4.5in", "$_rootDir/RJ4250WB-RD3.1x4.5.bin"); - static const RD_W4in = const BinPaper_RJ4250._internal("RJ4250WB-RD4in", "$_rootDir/RJ4250WB-RD4inch.bin"); - static const RD_W4H1in = const BinPaper_RJ4250._internal("RJ4250WB-RD4x1in", "$_rootDir/RJ4250WB-RD4x1.bin"); - static const RD_W4H2in = const BinPaper_RJ4250._internal("RJ4250WB-RD4x2in", "$_rootDir/RJ4250WB-RD4x2.bin"); - static const RD_W4H3in = const BinPaper_RJ4250._internal("RJ4250WB-RD4x3in", "$_rootDir/RJ4250WB-RD4x3.bin"); - static const RD_W4H4in = const BinPaper_RJ4250._internal("RJ4250WB-RD4x4in", "$_rootDir/RJ4250WB-RD4x4.bin"); - static const RD_W4H6in = const BinPaper_RJ4250._internal("RJ4250WB-RD4x6in", "$_rootDir/RJ4250WB-RD4x6.bin"); - static const RD_W50H85mm = const BinPaper_RJ4250._internal("RJ4250WB-RD50x85mm", "$_rootDir/RJ4250WB-RD50_85mm.bin"); - static const RD_W60H92mm = const BinPaper_RJ4250._internal("RJ4250WB-RD60x92mm", "$_rootDir/RJ4250WB-RD60_92mm.bin"); - static const RD_W80H115mm = const BinPaper_RJ4250._internal("RJ4250WB-RD80x115mm", "$_rootDir/RJ4250WB-RD80_115mm.bin"); - static const RD_W80mm = const BinPaper_RJ4250._internal("RJ4250WB-RD80mm", "$_rootDir/RJ4250WB-RD80mm.bin"); + static const RD_W1_9H3_3in = const BinPaper_RJ4250._internal( + "RJ4250WB-RD1.9x3.3in", "$_rootDir/RJ4250WB-RD1.9x3.3.bin"); + static const RD_W2_2in = const BinPaper_RJ4250._internal( + "RJ4250WB-RD2.2in", "$_rootDir/RJ4250WB-RD2.2inch.bin"); + static const RD_W2_3H3_6in = const BinPaper_RJ4250._internal( + "RJ4250WB-RD2.3x3.6in", "$_rootDir/RJ4250WB-RD2.3x3.6.bin"); + static const RD_W3_1H4_5in = const BinPaper_RJ4250._internal( + "RJ4250WB-RD3.1x4.5in", "$_rootDir/RJ4250WB-RD3.1x4.5.bin"); + static const RD_W4in = const BinPaper_RJ4250._internal( + "RJ4250WB-RD4in", "$_rootDir/RJ4250WB-RD4inch.bin"); + static const RD_W4H1in = const BinPaper_RJ4250._internal( + "RJ4250WB-RD4x1in", "$_rootDir/RJ4250WB-RD4x1.bin"); + static const RD_W4H2in = const BinPaper_RJ4250._internal( + "RJ4250WB-RD4x2in", "$_rootDir/RJ4250WB-RD4x2.bin"); + static const RD_W4H3in = const BinPaper_RJ4250._internal( + "RJ4250WB-RD4x3in", "$_rootDir/RJ4250WB-RD4x3.bin"); + static const RD_W4H4in = const BinPaper_RJ4250._internal( + "RJ4250WB-RD4x4in", "$_rootDir/RJ4250WB-RD4x4.bin"); + static const RD_W4H6in = const BinPaper_RJ4250._internal( + "RJ4250WB-RD4x6in", "$_rootDir/RJ4250WB-RD4x6.bin"); + static const RD_W50H85mm = const BinPaper_RJ4250._internal( + "RJ4250WB-RD50x85mm", "$_rootDir/RJ4250WB-RD50_85mm.bin"); + static const RD_W60H92mm = const BinPaper_RJ4250._internal( + "RJ4250WB-RD60x92mm", "$_rootDir/RJ4250WB-RD60_92mm.bin"); + static const RD_W80H115mm = const BinPaper_RJ4250._internal( + "RJ4250WB-RD80x115mm", "$_rootDir/RJ4250WB-RD80_115mm.bin"); + static const RD_W80mm = const BinPaper_RJ4250._internal( + "RJ4250WB-RD80mm", "$_rootDir/RJ4250WB-RD80mm.bin"); static const UNSUPPORTED = const BinPaper_RJ4250._internal("UNSUPPORTED", ""); static final _values = [ @@ -691,10 +734,7 @@ class BinPaper_RJ4250 implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } } @@ -702,23 +742,38 @@ class BinPaper_TD2120N implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomTD2120NPaper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomTD2120NPaper"; const BinPaper_TD2120N._internal(this._name, this._assetPath); - static const RD_W1_1H1_1in = const BinPaper_TD2120N._internal("TD2120N-RD1.1x1.1", "$_rootDir/TD2120N-RD1.1x1.1.bin"); - static const RD_W1_5H1_5in = const BinPaper_TD2120N._internal("TD2120N-RD1.5x1.5", "$_rootDir/TD2120N-RD1.5x1.5.bin"); - static const RD_W1_5H1_9in = const BinPaper_TD2120N._internal("TD2120N-RD1.5x1.9", "$_rootDir/TD2120N-RD1.5x1.9.bin"); - static const RD_W1_5H2_3in = const BinPaper_TD2120N._internal("TD2120N-RD1.5x2.3", "$_rootDir/TD2120N-RD1.5x2.3.bin"); - static const RD_W1_9H1_1in = const BinPaper_TD2120N._internal("TD2120N-RD1.9x1.1", "$_rootDir/TD2120N-RD1.9x1.1.bin"); - static const RD_W2H1in = const BinPaper_TD2120N._internal("TD2120N-RD2.0x1.0", "$_rootDir/TD2120N-RD2.0x1.0.bin"); - static const RD_W2_3H2_3in = const BinPaper_TD2120N._internal("TD2120N-RD2.3x2.3", "$_rootDir/TD2120N-RD2.3x2.3.bin"); - static const RD_W2_25in = const BinPaper_TD2120N._internal("TD2120N-RD2.25inch", "$_rootDir/TD2120N-RD2.25inch.bin"); - static const RD_W2_28in = const BinPaper_TD2120N._internal("TD2120N-RD2.28inch", "$_rootDir/TD2120N-RD2.28inch.bin"); - static const RD_W40H50mm = const BinPaper_TD2120N._internal("TD2120N-RD40_50mm", "$_rootDir/TD2120N-RD40_50mm.bin"); - static const RD_W40H60mm = const BinPaper_TD2120N._internal("TD2120N-RD40_60mm", "$_rootDir/TD2120N-RD40_60mm.bin"); - static const RD_W50H30mm = const BinPaper_TD2120N._internal("TD2120N-RD50_30mm", "$_rootDir/TD2120N-RD50_30mm.bin"); - static const RD_W51H26mm = const BinPaper_TD2120N._internal("TD2120N-RD51_26mm", "$_rootDir/TD2120N-RD51_26mm.bin"); - static const UNSUPPORTED = const BinPaper_TD2120N._internal("UNSUPPORTED", ""); + static const RD_W1_1H1_1in = const BinPaper_TD2120N._internal( + "TD2120N-RD1.1x1.1", "$_rootDir/TD2120N-RD1.1x1.1.bin"); + static const RD_W1_5H1_5in = const BinPaper_TD2120N._internal( + "TD2120N-RD1.5x1.5", "$_rootDir/TD2120N-RD1.5x1.5.bin"); + static const RD_W1_5H1_9in = const BinPaper_TD2120N._internal( + "TD2120N-RD1.5x1.9", "$_rootDir/TD2120N-RD1.5x1.9.bin"); + static const RD_W1_5H2_3in = const BinPaper_TD2120N._internal( + "TD2120N-RD1.5x2.3", "$_rootDir/TD2120N-RD1.5x2.3.bin"); + static const RD_W1_9H1_1in = const BinPaper_TD2120N._internal( + "TD2120N-RD1.9x1.1", "$_rootDir/TD2120N-RD1.9x1.1.bin"); + static const RD_W2H1in = const BinPaper_TD2120N._internal( + "TD2120N-RD2.0x1.0", "$_rootDir/TD2120N-RD2.0x1.0.bin"); + static const RD_W2_3H2_3in = const BinPaper_TD2120N._internal( + "TD2120N-RD2.3x2.3", "$_rootDir/TD2120N-RD2.3x2.3.bin"); + static const RD_W2_25in = const BinPaper_TD2120N._internal( + "TD2120N-RD2.25inch", "$_rootDir/TD2120N-RD2.25inch.bin"); + static const RD_W2_28in = const BinPaper_TD2120N._internal( + "TD2120N-RD2.28inch", "$_rootDir/TD2120N-RD2.28inch.bin"); + static const RD_W40H50mm = const BinPaper_TD2120N._internal( + "TD2120N-RD40_50mm", "$_rootDir/TD2120N-RD40_50mm.bin"); + static const RD_W40H60mm = const BinPaper_TD2120N._internal( + "TD2120N-RD40_60mm", "$_rootDir/TD2120N-RD40_60mm.bin"); + static const RD_W50H30mm = const BinPaper_TD2120N._internal( + "TD2120N-RD50_30mm", "$_rootDir/TD2120N-RD50_30mm.bin"); + static const RD_W51H26mm = const BinPaper_TD2120N._internal( + "TD2120N-RD51_26mm", "$_rootDir/TD2120N-RD51_26mm.bin"); + static const UNSUPPORTED = + const BinPaper_TD2120N._internal("UNSUPPORTED", ""); static final _values = [ RD_W1_1H1_1in, @@ -755,10 +810,7 @@ class BinPaper_TD2120N implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } } @@ -766,20 +818,20 @@ class BinPaper_TD2125N implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomTD2125NPaper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomTD2125NPaper"; const BinPaper_TD2125N._internal(this._name, this._assetPath); - static const W40_H40mm = const BinPaper_TD2125N._internal("TD2125N-40mm40mm", "$_rootDir/TD2125N-40mm40mm.bin"); - static const W51_H26mm = const BinPaper_TD2125N._internal("TD2125N-51x26mm", "$_rootDir/TD2125N-51x26mm.bin"); - static const W57mm = const BinPaper_TD2125N._internal("TD2125N-57mm", "$_rootDir/TD2125N-57mm.bin"); - static const UNSUPPORTED = const BinPaper_TD2125N._internal("UNSUPPORTED", ""); + static const W40_H40mm = const BinPaper_TD2125N._internal( + "TD2125N-40mm40mm", "$_rootDir/TD2125N-40mm40mm.bin"); + static const W51_H26mm = const BinPaper_TD2125N._internal( + "TD2125N-51x26mm", "$_rootDir/TD2125N-51x26mm.bin"); + static const W57mm = const BinPaper_TD2125N._internal( + "TD2125N-57mm", "$_rootDir/TD2125N-57mm.bin"); + static const UNSUPPORTED = + const BinPaper_TD2125N._internal("UNSUPPORTED", ""); - static final _values = [ - W40_H40mm, - W51_H26mm, - W57mm, - UNSUPPORTED - ]; + static final _values = [W40_H40mm, W51_H26mm, W57mm, UNSUPPORTED]; static List getValues() => List.from(_values); @@ -799,10 +851,7 @@ class BinPaper_TD2125N implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } } @@ -810,25 +859,27 @@ class BinPaper_TD2125NWB implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomTD2125NWBPaper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomTD2125NWBPaper"; const BinPaper_TD2125NWB._internal(this._name, this._assetPath); - static const W40_H40mm = const BinPaper_TD2125NWB._internal("TD2125NWB-40mm40mm", "$_rootDir/TD2125NWB-40mm40mm.bin"); - static const W57mm = const BinPaper_TD2125NWB._internal("TD2125NWB-57mm", "$_rootDir/TD2125NWB-57mm.bin"); - static const W51_H26mm = const BinPaper_TD2125NWB._internal("TD2125NWB-51x26mm", "$_rootDir/TD2125NWB-51x26mm.bin"); - static const W57_H76mm = const BinPaper_TD2125NWB._internal("TD2125NWB-57x76mm", "$_rootDir/TD2125NWB-57x76mm.bin"); - static const W57_H32mm = const BinPaper_TD2125NWB._internal("TD2125NWB-57x32mm", "$_rootDir/TD2125NWB-57x32mm.bin"); - static const W57_H51mm = const BinPaper_TD2125NWB._internal("TD2125NWB-57x51mm", "$_rootDir/TD2125NWB-57x51mm.bin"); + static const W40_H40mm = const BinPaper_TD2125NWB._internal( + "TD2125NWB-40mm40mm", "$_rootDir/TD2125NWB-40mm40mm.bin"); + static const W57mm = const BinPaper_TD2125NWB._internal( + "TD2125NWB-57mm", "$_rootDir/TD2125NWB-57mm.bin"); + static const W51_H26mm = const BinPaper_TD2125NWB._internal( + "TD2125NWB-51x26mm", "$_rootDir/TD2125NWB-51x26mm.bin"); + static const W57_H76mm = const BinPaper_TD2125NWB._internal( + "TD2125NWB-57x76mm", "$_rootDir/TD2125NWB-57x76mm.bin"); + static const W57_H32mm = const BinPaper_TD2125NWB._internal( + "TD2125NWB-57x32mm", "$_rootDir/TD2125NWB-57x32mm.bin"); + static const W57_H51mm = const BinPaper_TD2125NWB._internal( + "TD2125NWB-57x51mm", "$_rootDir/TD2125NWB-57x51mm.bin"); - static const UNSUPPORTED = const BinPaper_TD2125NWB._internal("UNSUPPORTED", ""); + static const UNSUPPORTED = + const BinPaper_TD2125NWB._internal("UNSUPPORTED", ""); - static final _values = [ - W40_H40mm, - W51_H26mm, - W57mm, - W57_H76mm, - UNSUPPORTED - ]; + static final _values = [W40_H40mm, W51_H26mm, W57mm, W57_H76mm, UNSUPPORTED]; static List getValues() => List.from(_values); @@ -848,35 +899,46 @@ class BinPaper_TD2125NWB implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } } - class BinPaper_TD2130N implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomTD2130NPaper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomTD2130NPaper"; const BinPaper_TD2130N._internal(this._name, this._assetPath); - static const RD_W1_1H1_1in = const BinPaper_TD2130N._internal("TD2130N-RD1.1x1.1", "$_rootDir/TD2130N-RD1.1x1.1.bin"); - static const RD_W1_5H1_5in = const BinPaper_TD2130N._internal("TD2130N-RD1.5x1.5", "$_rootDir/TD2130N-RD1.5x1.5.bin"); - static const RD_W1_5H1_9in = const BinPaper_TD2130N._internal("TD2130N-RD1.5x1.9", "$_rootDir/TD2130N-RD1.5x1.9.bin"); - static const RD_W1_5H2_3in = const BinPaper_TD2130N._internal("TD2130N-RD1.5x2.3", "$_rootDir/TD2130N-RD1.5x2.3.bin"); - static const RD_W1_9H1_1in = const BinPaper_TD2130N._internal("TD2130N-RD1.9x1.1", "$_rootDir/TD2130N-RD1.9x1.1.bin"); - static const RD_W2H1in = const BinPaper_TD2130N._internal("TD2130N-RD2.0x1.0", "$_rootDir/TD2130N-RD2.0x1.0.bin"); - static const RD_W2_2H2_3in = const BinPaper_TD2130N._internal("TD2130N-RD2.3x2.3", "$_rootDir/TD2130N-RD2.3x2.3.bin"); - static const RD_W2_5in = const BinPaper_TD2130N._internal("TD2130N-RD2.25inch", "$_rootDir/TD2130N-RD2.25inch.bin"); - static const RD_W2_28in = const BinPaper_TD2130N._internal("TD2130N-RD2.28inch", "$_rootDir/TD2130N-RD2.28inch.bin"); - static const RD_W40H50mm = const BinPaper_TD2130N._internal("TD2130N-RD40_50mm", "$_rootDir/TD2130N-RD40_50mm.bin"); - static const RD_W40H60mm = const BinPaper_TD2130N._internal("TD2130N-RD40_60mm", "$_rootDir/TD2130N-RD40_60mm.bin"); - static const RD_W50H30mm = const BinPaper_TD2130N._internal("TD2130N-RD50_30mm", "$_rootDir/TD2130N-RD50_30mm.bin"); - static const RD_W51H26mm = const BinPaper_TD2130N._internal("TD2130N-RD51_26mm", "$_rootDir/TD2130N-RD51_26mm.bin"); - static const UNSUPPORTED = const BinPaper_TD2130N._internal("UNSUPPORTED", ""); + static const RD_W1_1H1_1in = const BinPaper_TD2130N._internal( + "TD2130N-RD1.1x1.1", "$_rootDir/TD2130N-RD1.1x1.1.bin"); + static const RD_W1_5H1_5in = const BinPaper_TD2130N._internal( + "TD2130N-RD1.5x1.5", "$_rootDir/TD2130N-RD1.5x1.5.bin"); + static const RD_W1_5H1_9in = const BinPaper_TD2130N._internal( + "TD2130N-RD1.5x1.9", "$_rootDir/TD2130N-RD1.5x1.9.bin"); + static const RD_W1_5H2_3in = const BinPaper_TD2130N._internal( + "TD2130N-RD1.5x2.3", "$_rootDir/TD2130N-RD1.5x2.3.bin"); + static const RD_W1_9H1_1in = const BinPaper_TD2130N._internal( + "TD2130N-RD1.9x1.1", "$_rootDir/TD2130N-RD1.9x1.1.bin"); + static const RD_W2H1in = const BinPaper_TD2130N._internal( + "TD2130N-RD2.0x1.0", "$_rootDir/TD2130N-RD2.0x1.0.bin"); + static const RD_W2_2H2_3in = const BinPaper_TD2130N._internal( + "TD2130N-RD2.3x2.3", "$_rootDir/TD2130N-RD2.3x2.3.bin"); + static const RD_W2_5in = const BinPaper_TD2130N._internal( + "TD2130N-RD2.25inch", "$_rootDir/TD2130N-RD2.25inch.bin"); + static const RD_W2_28in = const BinPaper_TD2130N._internal( + "TD2130N-RD2.28inch", "$_rootDir/TD2130N-RD2.28inch.bin"); + static const RD_W40H50mm = const BinPaper_TD2130N._internal( + "TD2130N-RD40_50mm", "$_rootDir/TD2130N-RD40_50mm.bin"); + static const RD_W40H60mm = const BinPaper_TD2130N._internal( + "TD2130N-RD40_60mm", "$_rootDir/TD2130N-RD40_60mm.bin"); + static const RD_W50H30mm = const BinPaper_TD2130N._internal( + "TD2130N-RD50_30mm", "$_rootDir/TD2130N-RD50_30mm.bin"); + static const RD_W51H26mm = const BinPaper_TD2130N._internal( + "TD2130N-RD51_26mm", "$_rootDir/TD2130N-RD51_26mm.bin"); + static const UNSUPPORTED = + const BinPaper_TD2130N._internal("UNSUPPORTED", ""); static final _values = [ RD_W1_1H1_1in, @@ -913,10 +975,7 @@ class BinPaper_TD2130N implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } } @@ -924,19 +983,19 @@ class BinPaper_TD2135NWB implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomTD2135NWBPaper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomTD2135NWBPaper"; const BinPaper_TD2135NWB._internal(this._name, this._assetPath); - static const W40_H40mm = const BinPaper_TD2135NWB._internal("TD2135NWB-40mm40mm", "$_rootDir/TD2135NWB-40mm40mm.bin"); - static const W57mm = const BinPaper_TD2135NWB._internal("TD2135NWB-57mm", "$_rootDir/TD2135NWB-57mm.bin"); + static const W40_H40mm = const BinPaper_TD2135NWB._internal( + "TD2135NWB-40mm40mm", "$_rootDir/TD2135NWB-40mm40mm.bin"); + static const W57mm = const BinPaper_TD2135NWB._internal( + "TD2135NWB-57mm", "$_rootDir/TD2135NWB-57mm.bin"); - static const UNSUPPORTED = const BinPaper_TD2135NWB._internal("UNSUPPORTED", ""); + static const UNSUPPORTED = + const BinPaper_TD2135NWB._internal("UNSUPPORTED", ""); - static final _values = [ - W40_H40mm, - W57mm, - UNSUPPORTED - ]; + static final _values = [W40_H40mm, W57mm, UNSUPPORTED]; static List getValues() => List.from(_values); @@ -956,10 +1015,49 @@ class BinPaper_TD2135NWB implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; + } +} + +class BinPaper_TD2350D implements ACustomPaper { + final String _name; + final String _assetPath; + + static const String _rootDir = + "packages/another_brother/custom_paper/CustomTD2350DPaper"; + const BinPaper_TD2350D._internal(this._name, this._assetPath); + + static const W51_H26mm = const BinPaper_TD2350D._internal( + "TD2350D-51mm_26mm", "$_rootDir/TD2350D-51mm_26mm.bin"); + static const W58mm = const BinPaper_TD2350D._internal( + "TD2350D-58mm", "$_rootDir/TD2350D-58mm.bin"); + static const W57mm = const BinPaper_TD2350D._internal( + "TD2350D-57mm", "$_rootDir/TD2350D-57mm.bin"); + + static const UNSUPPORTED = + const BinPaper_TD2350D._internal("UNSUPPORTED", ""); + + static final _values = [W51_H26mm, W58mm, W57mm, UNSUPPORTED]; + + static List getValues() => List.from(_values); + + @override + String getName() { + return _name; + } + + static BinPaper_TD2350D valueFromName(String name) { + for (int i = 0; i < _values.length; i++) { + if (_values[i].getName() == name) { + return _values[i]; + } + } + return UNSUPPORTED; + } + + @override + Map toMap() { + return {"name": _name, "assetPath": _assetPath}; } } @@ -967,24 +1065,40 @@ class BinPaper_TD4550 implements ACustomPaper { final String _name; final String _assetPath; - static const String _rootDir = "packages/another_brother/custom_paper/CustomTD4550Paper"; + static const String _rootDir = + "packages/another_brother/custom_paper/CustomTD4550Paper"; const BinPaper_TD4550._internal(this._name, this._assetPath); - static const RD_W2_2in = const BinPaper_TD4550._internal("TD4550DNWB-RD2.2inch", "$_rootDir/TD4550DNWB-RD2.2inch.bin"); - static const RD_W2_9in = const BinPaper_TD4550._internal("TD4550DNWB-RD2.9inch", "$_rootDir/TD4550DNWB-RD2.9inch.bin"); - static const RD_W2H1in = const BinPaper_TD4550._internal("TD4550DNWB-RD2x1", "$_rootDir/TD4550DNWB-RD2x1.bin"); - static const RD_W3_5in = const BinPaper_TD4550._internal("TD4550DNWB-RD3.5inch", "$_rootDir/TD4550DNWB-RD3.5inch.bin"); - static const RD_W3H1in = const BinPaper_TD4550._internal("TD4550DNWB-RD3x1", "$_rootDir/TD4550DNWB-RD3x1.bin"); - static const RD_W4in = const BinPaper_TD4550._internal("TD4550DNWB-RD4inch", "$_rootDir/TD4550DNWB-RD4inch.bin"); - static const RD_W4H1in = const BinPaper_TD4550._internal("TD4550DNWB-RD4x1", "$_rootDir/TD4550DNWB-RD4x1.bin"); - static const RD_W4H2in = const BinPaper_TD4550._internal("TD4550DNWB-RD4x2", "$_rootDir/TD4550DNWB-RD4x2.bin"); - static const RD_W4H3in = const BinPaper_TD4550._internal("TD4550DNWB-RD4x3", "$_rootDir/TD4550DNWB-RD4x3.bin"); - static const RD_W4H4in = const BinPaper_TD4550._internal("TD4550DNWB-RD4x4", "$_rootDir/TD4550DNWB-RD4x4.bin"); - static const RD_W4H6in = const BinPaper_TD4550._internal("TD4550DNWB-RD4x6", "$_rootDir/TD4550DNWB-RD4x6.bin"); - static const RD_W51H26mm = const BinPaper_TD4550._internal("TD4550DNWB-RD51_26mm", "$_rootDir/TD4550DNWB-RD51_26mm.bin"); - static const RD_W76H26mm = const BinPaper_TD4550._internal("TD4550DNWB-RD76_26mm", "$_rootDir/TD4550DNWB-RD76_26mm.bin"); - static const RD_W76mm = const BinPaper_TD4550._internal("TD4550DNWB-RD76mm", "$_rootDir/TD4550DNWB-RD76mm.bin"); - static const RD_W90mm = const BinPaper_TD4550._internal("TD4550DNWB-RD90mm", "$_rootDir/TD4550DNWB-RD90mm.bin"); + static const RD_W2_2in = const BinPaper_TD4550._internal( + "TD4550DNWB-RD2.2inch", "$_rootDir/TD4550DNWB-RD2.2inch.bin"); + static const RD_W2_9in = const BinPaper_TD4550._internal( + "TD4550DNWB-RD2.9inch", "$_rootDir/TD4550DNWB-RD2.9inch.bin"); + static const RD_W2H1in = const BinPaper_TD4550._internal( + "TD4550DNWB-RD2x1", "$_rootDir/TD4550DNWB-RD2x1.bin"); + static const RD_W3_5in = const BinPaper_TD4550._internal( + "TD4550DNWB-RD3.5inch", "$_rootDir/TD4550DNWB-RD3.5inch.bin"); + static const RD_W3H1in = const BinPaper_TD4550._internal( + "TD4550DNWB-RD3x1", "$_rootDir/TD4550DNWB-RD3x1.bin"); + static const RD_W4in = const BinPaper_TD4550._internal( + "TD4550DNWB-RD4inch", "$_rootDir/TD4550DNWB-RD4inch.bin"); + static const RD_W4H1in = const BinPaper_TD4550._internal( + "TD4550DNWB-RD4x1", "$_rootDir/TD4550DNWB-RD4x1.bin"); + static const RD_W4H2in = const BinPaper_TD4550._internal( + "TD4550DNWB-RD4x2", "$_rootDir/TD4550DNWB-RD4x2.bin"); + static const RD_W4H3in = const BinPaper_TD4550._internal( + "TD4550DNWB-RD4x3", "$_rootDir/TD4550DNWB-RD4x3.bin"); + static const RD_W4H4in = const BinPaper_TD4550._internal( + "TD4550DNWB-RD4x4", "$_rootDir/TD4550DNWB-RD4x4.bin"); + static const RD_W4H6in = const BinPaper_TD4550._internal( + "TD4550DNWB-RD4x6", "$_rootDir/TD4550DNWB-RD4x6.bin"); + static const RD_W51H26mm = const BinPaper_TD4550._internal( + "TD4550DNWB-RD51_26mm", "$_rootDir/TD4550DNWB-RD51_26mm.bin"); + static const RD_W76H26mm = const BinPaper_TD4550._internal( + "TD4550DNWB-RD76_26mm", "$_rootDir/TD4550DNWB-RD76_26mm.bin"); + static const RD_W76mm = const BinPaper_TD4550._internal( + "TD4550DNWB-RD76mm", "$_rootDir/TD4550DNWB-RD76mm.bin"); + static const RD_W90mm = const BinPaper_TD4550._internal( + "TD4550DNWB-RD90mm", "$_rootDir/TD4550DNWB-RD90mm.bin"); static const UNSUPPORTED = const BinPaper_TD4550._internal("UNSUPPORTED", ""); static final _values = [ @@ -1024,9 +1138,6 @@ class BinPaper_TD4550 implements ACustomPaper { @override Map toMap() { - return { - "name": _name, - "assetPath": _assetPath - }; + return {"name": _name, "assetPath": _assetPath}; } -} \ No newline at end of file +} diff --git a/lib/label_info.dart b/lib/label_info.dart index 58404ee..eeb9e27 100644 --- a/lib/label_info.dart +++ b/lib/label_info.dart @@ -11,7 +11,7 @@ class LabelInfo { LabelInfo( { - // TODO Consider using labal ID instead + // TODO Consider using label ID instead this.labelNameIndex = -1, this.isAutoCut = true, this.isEndCut = true, diff --git a/lib/printer_info.dart b/lib/printer_info.dart index ab888ab..5296021 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -61,10 +61,7 @@ class PaperSize implements ALabelName { } Map toMap() { - return { - "id": this._id, - "name": this._name - }; + return {"id": this._id, "name": this._name}; } } @@ -167,10 +164,8 @@ class Model implements AModel { static final PT_P715eBT = Model._internal2("PT_P715eBT", 69, PT_E550W); static final PT_P910BT = Model._internal( "PT_P910BT", 68, PT.W36.getId(), PrinterSeries.PT_LABEL_PRINTER); - static final RJ_3230B = Model._internal2( - "RJ_3230B", 70, RJ_4030); - static final RJ_3250WB = Model._internal2( - "RJ_3250WB", 71, RJ_4030); + static final RJ_3230B = Model._internal2("RJ_3230B", 70, RJ_4030); + static final RJ_3250WB = Model._internal2("RJ_3250WB", 71, RJ_4030); static final PT_D410 = Model._internal( "PT_D410", 72, PT.W18.getId(), PrinterSeries.PT_LABEL_PRINTER); static final PT_D460BT = Model._internal2("PT_D460BT", 73, PT_D410); @@ -186,7 +181,14 @@ class Model implements AModel { static final TD_2125NWB = Model._internal2("TD_2125NWB", 82, RJ_4030); static final TD_2135N = Model._internal2("TD_2135N", 83, RJ_4030); static final TD_2135NWB = Model._internal2("TD_2135NWB", 84, RJ_4030); - + static final TD_2350D_203 = Model._internal2("TD_2350D", 97, RJ_4030); + static final TD_2350D_300 = Model._internal2("TD_2350D", 98, RJ_4030); + static final TD_2350DF_203 = Model._internal2("TD_2350D", 99, RJ_4030); + static final TD_2350DF_300 = Model._internal2("TD_2350D", 100, RJ_4030); + static final TD_2350DSA_203 = Model._internal2("TD_2350D", 101, RJ_4030); + static final TD_2350DSA_300 = Model._internal2("TD_2350D", 102, RJ_4030); + static final TD_2350DFSA_203 = Model._internal2("TD_2350D", 103, RJ_4030); + static final TD_2350DFSA_300 = Model._internal2("TD_2350D", 104, RJ_4030); static final UNSUPPORTED = Model._internal("UNSUPPORTED", 255, PaperSize.CUSTOM.getPaperId(), PrinterSeries.UNSUPPORTED); @@ -275,6 +277,14 @@ class Model implements AModel { TD_2125NWB, TD_2135N, TD_2135NWB, + TD_2350D_203, + TD_2350D_300, + TD_2350DF_203, + TD_2350DF_300, + TD_2350DSA_203, + TD_2350DSA_300, + TD_2350DFSA_203, + TD_2350DFSA_300, UNSUPPORTED ]; @@ -375,10 +385,7 @@ class Model implements AModel { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } static List getValues() => List.of(_values); @@ -475,10 +482,7 @@ class Port { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -518,10 +522,7 @@ class Orientation { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -563,10 +564,7 @@ class PrintMode { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -607,10 +605,7 @@ class Halftone { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -618,11 +613,11 @@ class Align { final int _id; final String _name; - const Align._insternal(this._id, this._name); + const Align._internal(this._id, this._name); - static const LEFT = const Align._insternal(1, "LEFT"); - static const CENTER = const Align._insternal(2, "CENTER"); - static const RIGHT = const Align._insternal(3, "RIGHT"); + static const LEFT = const Align._internal(1, "LEFT"); + static const CENTER = const Align._internal(2, "CENTER"); + static const RIGHT = const Align._internal(3, "RIGHT"); static final _values = [LEFT, CENTER, RIGHT]; @@ -651,10 +646,7 @@ class Align { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -695,10 +687,7 @@ class VAlign { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -710,7 +699,8 @@ class PjRollCase { static const PJ_ROLLCASE_OFF = PjRollCase._internal(1, "PJ_ROLLCASE_OFF"); static const PJ_ROLLCASE_ON = PjRollCase._internal(2, "PJ_ROLLCASE_ON"); - static const PJ_ROLLCASE_WITH_ANTICURL = PjRollCase._internal(3, "PJ_ROLLCASE_WITH_ANTICURL"); + static const PJ_ROLLCASE_WITH_ANTICURL = + PjRollCase._internal(3, "PJ_ROLLCASE_WITH_ANTICURL"); static final _values = [ PJ_ROLLCASE_OFF, @@ -743,10 +733,7 @@ class PjRollCase { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -756,10 +743,14 @@ class PjFeedMode { const PjFeedMode._internal(this._id, this._name); - static const PJ_FEED_MODE_FREE = const PjFeedMode._internal(1, "PJ_FEED_MODE_FREE"); - static const PJ_FEED_MODE_FIXEDPAGE = const PjFeedMode._internal(2, "PJ_FEED_MODE_FIXEDPAGE"); - static const PJ_FEED_MODE_ENDOFPAGE = const PjFeedMode._internal(3, "PJ_FEED_MODE_ENDOFPAGE"); - static const PJ_FEED_MODE_ENDOFPAGERETRACT = const PjFeedMode._internal(4, "PJ_FEED_MODE_ENDOFPAGERETRACT"); + static const PJ_FEED_MODE_FREE = + const PjFeedMode._internal(1, "PJ_FEED_MODE_FREE"); + static const PJ_FEED_MODE_FIXEDPAGE = + const PjFeedMode._internal(2, "PJ_FEED_MODE_FIXEDPAGE"); + static const PJ_FEED_MODE_ENDOFPAGE = + const PjFeedMode._internal(3, "PJ_FEED_MODE_ENDOFPAGE"); + static const PJ_FEED_MODE_ENDOFPAGERETRACT = + const PjFeedMode._internal(4, "PJ_FEED_MODE_ENDOFPAGERETRACT"); static final _values = [ PJ_FEED_MODE_FREE, @@ -793,10 +784,7 @@ class PjFeedMode { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -807,7 +795,8 @@ class CheckPrintEnd { const CheckPrintEnd._internal(this._id, this._name); static const CPE_NO_CHECK = const CheckPrintEnd._internal(1, "CPE_NO_CHECK"); - static const CPE_SKIP_LAST = const CheckPrintEnd._internal(2, "CPE_SKIP_LAST"); + static const CPE_SKIP_LAST = + const CheckPrintEnd._internal(2, "CPE_SKIP_LAST"); static const CPE_CHECK = const CheckPrintEnd._internal(3, "CPE_CHECK"); static final _values = [CPE_NO_CHECK, CPE_SKIP_LAST, CPE_CHECK]; @@ -837,10 +826,7 @@ class CheckPrintEnd { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -851,63 +837,106 @@ class ErrorCode { const ErrorCode._internal(this._id, this._name); static const ERROR_NONE = ErrorCode._internal(1, "ERROR_NONE"); - static const ERROR_NOT_SAME_MODEL = ErrorCode._internal(2, "ERROR_NOT_SAME_MODEL"); - static const ERROR_BROTHER_PRINTER_NOT_FOUND = ErrorCode._internal(3, "ERROR_BROTHER_PRINTER_NOT_FOUND"); + static const ERROR_NOT_SAME_MODEL = + ErrorCode._internal(2, "ERROR_NOT_SAME_MODEL"); + static const ERROR_BROTHER_PRINTER_NOT_FOUND = + ErrorCode._internal(3, "ERROR_BROTHER_PRINTER_NOT_FOUND"); static const ERROR_PAPER_EMPTY = ErrorCode._internal(4, "ERROR_PAPER_EMPTY"); - static const ERROR_BATTERY_EMPTY = ErrorCode._internal(5, "ERROR_BATTERY_EMPTY"); - static const ERROR_COMMUNICATION_ERROR = ErrorCode._internal(6, "ERROR_COMMUNICATION_ERROR"); + static const ERROR_BATTERY_EMPTY = + ErrorCode._internal(5, "ERROR_BATTERY_EMPTY"); + static const ERROR_COMMUNICATION_ERROR = + ErrorCode._internal(6, "ERROR_COMMUNICATION_ERROR"); static const ERROR_OVERHEAT = ErrorCode._internal(7, "ERROR_OVERHEAT"); static const ERROR_PAPER_JAM = ErrorCode._internal(8, "ERROR_PAPER_JAM"); - static const ERROR_HIGH_VOLTAGE_ADAPTER = ErrorCode._internal(9, "ERROR_HIGH_VOLTAGE_ADAPTER"); - static const ERROR_CHANGE_CASSETTE = ErrorCode._internal(10, "ERROR_CHANGE_CASSETTE"); - static const ERROR_FEED_OR_CASSETTE_EMPTY = ErrorCode._internal(11, "ERROR_FEED_OR_CASSETTE_EMPTY"); - static const ERROR_SYSTEM_ERROR = ErrorCode._internal(12, "ERROR_SYSTEM_ERROR"); + static const ERROR_HIGH_VOLTAGE_ADAPTER = + ErrorCode._internal(9, "ERROR_HIGH_VOLTAGE_ADAPTER"); + static const ERROR_CHANGE_CASSETTE = + ErrorCode._internal(10, "ERROR_CHANGE_CASSETTE"); + static const ERROR_FEED_OR_CASSETTE_EMPTY = + ErrorCode._internal(11, "ERROR_FEED_OR_CASSETTE_EMPTY"); + static const ERROR_SYSTEM_ERROR = + ErrorCode._internal(12, "ERROR_SYSTEM_ERROR"); static const ERROR_NO_CASSETTE = ErrorCode._internal(13, "ERROR_NO_CASSETTE"); - static const ERROR_WRONG_CASSETTE_DIRECT = ErrorCode._internal(14, "ERROR_WRONG_CASSETTE_DIRECT"); - static const ERROR_CREATE_SOCKET_FAILED = ErrorCode._internal(15, "ERROR_CREATE_SOCKET_FAILED"); - static const ERROR_CONNECT_SOCKET_FAILED = ErrorCode._internal(16, "ERROR_CONNECT_SOCKET_FAILED"); - static const ERROR_GET_OUTPUT_STREAM_FAILED = ErrorCode._internal(17, "ERROR_GET_OUTPUT_STREAM_FAILED"); - static const ERROR_GET_INPUT_STREAM_FAILED = ErrorCode._internal(18, "ERROR_GET_INPUT_STREAM_FAILED"); - static const ERROR_CLOSE_SOCKET_FAILED = ErrorCode._internal(19, "ERROR_CLOSE_SOCKET_FAILED"); - static const ERROR_OUT_OF_MEMORY = ErrorCode._internal(20, "ERROR_OUT_OF_MEMORY"); - static const ERROR_SET_OVER_MARGIN = ErrorCode._internal(21, "ERROR_SET_OVER_MARGIN"); + static const ERROR_WRONG_CASSETTE_DIRECT = + ErrorCode._internal(14, "ERROR_WRONG_CASSETTE_DIRECT"); + static const ERROR_CREATE_SOCKET_FAILED = + ErrorCode._internal(15, "ERROR_CREATE_SOCKET_FAILED"); + static const ERROR_CONNECT_SOCKET_FAILED = + ErrorCode._internal(16, "ERROR_CONNECT_SOCKET_FAILED"); + static const ERROR_GET_OUTPUT_STREAM_FAILED = + ErrorCode._internal(17, "ERROR_GET_OUTPUT_STREAM_FAILED"); + static const ERROR_GET_INPUT_STREAM_FAILED = + ErrorCode._internal(18, "ERROR_GET_INPUT_STREAM_FAILED"); + static const ERROR_CLOSE_SOCKET_FAILED = + ErrorCode._internal(19, "ERROR_CLOSE_SOCKET_FAILED"); + static const ERROR_OUT_OF_MEMORY = + ErrorCode._internal(20, "ERROR_OUT_OF_MEMORY"); + static const ERROR_SET_OVER_MARGIN = + ErrorCode._internal(21, "ERROR_SET_OVER_MARGIN"); static const ERROR_NO_SD_CARD = ErrorCode._internal(22, "ERROR_NO_SD_CARD"); - static const ERROR_FILE_NOT_SUPPORTED = ErrorCode._internal(23, "ERROR_FILE_NOT_SUPPORTED"); - static const ERROR_EVALUATION_TIMEUP = ErrorCode._internal(24, "ERROR_EVALUATION_TIMEUP"); - static const ERROR_WRONG_CUSTOM_INFO = ErrorCode._internal(25, "ERROR_WRONG_CUSTOM_INFO"); + static const ERROR_FILE_NOT_SUPPORTED = + ErrorCode._internal(23, "ERROR_FILE_NOT_SUPPORTED"); + static const ERROR_EVALUATION_TIMEUP = + ErrorCode._internal(24, "ERROR_EVALUATION_TIMEUP"); + static const ERROR_WRONG_CUSTOM_INFO = + ErrorCode._internal(25, "ERROR_WRONG_CUSTOM_INFO"); static const ERROR_NO_ADDRESS = ErrorCode._internal(26, "ERROR_NO_ADDRESS"); - static const ERROR_NOT_MATCH_ADDRESS = ErrorCode._internal(27, "ERROR_NOT_MATCH_ADDRESS"); - static const ERROR_FILE_NOT_FOUND = ErrorCode._internal(28, "ERROR_FILE_NOT_FOUND"); - static const ERROR_TEMPLATE_FILE_NOT_MATCH_MODEL = ErrorCode._internal(29, "ERROR_TEMPLATE_FILE_NOT_MATCH_MODEL"); - static const ERROR_TEMPLATE_NOT_TRANS_MODEL = ErrorCode._internal(30, "ERROR_TEMPLATE_NOT_TRANS_MODEL"); + static const ERROR_NOT_MATCH_ADDRESS = + ErrorCode._internal(27, "ERROR_NOT_MATCH_ADDRESS"); + static const ERROR_FILE_NOT_FOUND = + ErrorCode._internal(28, "ERROR_FILE_NOT_FOUND"); + static const ERROR_TEMPLATE_FILE_NOT_MATCH_MODEL = + ErrorCode._internal(29, "ERROR_TEMPLATE_FILE_NOT_MATCH_MODEL"); + static const ERROR_TEMPLATE_NOT_TRANS_MODEL = + ErrorCode._internal(30, "ERROR_TEMPLATE_NOT_TRANS_MODEL"); static const ERROR_COVER_OPEN = ErrorCode._internal(31, "ERROR_COVER_OPEN"); static const ERROR_WRONG_LABEL = ErrorCode._internal(32, "ERROR_WRONG_LABEL"); - static const ERROR_PORT_NOT_SUPPORTED = ErrorCode._internal(33, "ERROR_PORT_NOT_SUPPORTED"); - static const ERROR_WRONG_TEMPLATE_KEY = ErrorCode._internal(34, "ERROR_WRONG_TEMPLATE_KEY"); + static const ERROR_PORT_NOT_SUPPORTED = + ErrorCode._internal(33, "ERROR_PORT_NOT_SUPPORTED"); + static const ERROR_WRONG_TEMPLATE_KEY = + ErrorCode._internal(34, "ERROR_WRONG_TEMPLATE_KEY"); static const ERROR_BUSY = ErrorCode._internal(35, "ERROR_BUSY"); - static const ERROR_TEMPLATE_NOT_PRINT_MODEL = ErrorCode._internal(36, "ERROR_TEMPLATE_NOT_PRINT_MODEL"); + static const ERROR_TEMPLATE_NOT_PRINT_MODEL = + ErrorCode._internal(36, "ERROR_TEMPLATE_NOT_PRINT_MODEL"); static const ERROR_CANCEL = ErrorCode._internal(37, "ERROR_CANCEL"); - static const ERROR_PRINTER_SETTING_NOT_SUPPORTED = ErrorCode._internal(38, "ERROR_PRINTER_SETTING_NOT_SUPPORTED"); - static const ERROR_INVALID_PARAMETER = ErrorCode._internal(39, "ERROR_INVALID_PARAMETER"); - static const ERROR_INTERNAL_ERROR = ErrorCode._internal(40, "ERROR_INTERNAL_ERROR"); - static const ERROR_TEMPLATE_NOT_CONTROL_MODEL = ErrorCode._internal(41, "ERROR_TEMPLATE_NOT_CONTROL_MODEL"); - static const ERROR_TEMPLATE_NOT_EXIST = ErrorCode._internal(42, "ERROR_TEMPLATE_NOT_EXIST"); + static const ERROR_PRINTER_SETTING_NOT_SUPPORTED = + ErrorCode._internal(38, "ERROR_PRINTER_SETTING_NOT_SUPPORTED"); + static const ERROR_INVALID_PARAMETER = + ErrorCode._internal(39, "ERROR_INVALID_PARAMETER"); + static const ERROR_INTERNAL_ERROR = + ErrorCode._internal(40, "ERROR_INTERNAL_ERROR"); + static const ERROR_TEMPLATE_NOT_CONTROL_MODEL = + ErrorCode._internal(41, "ERROR_TEMPLATE_NOT_CONTROL_MODEL"); + static const ERROR_TEMPLATE_NOT_EXIST = + ErrorCode._internal(42, "ERROR_TEMPLATE_NOT_EXIST"); static const ERROR_BUFFER_FULL = ErrorCode._internal(44, "ERROR_BUFFER_FULL"); static const ERROR_TUBE_EMPTY = ErrorCode._internal(45, "ERROR_TUBE_EMPTY"); - static const ERROR_TUBE_RIBBON_EMPTY = ErrorCode._internal(46, "ERROR_TUBE_RIBBON_EMPTY"); - static const ERROR_UPDATE_FRIM_NOT_SUPPORTED = ErrorCode._internal(47, "ERROR_UPDATE_FRIM_NOT_SUPPORTED"); - static const ERROR_OS_VERSION_NOT_SUPPORTED = ErrorCode._internal(48, "ERROR_OS_VERSION_NOT_SUPPORTED"); - static const ERROR_RESOLUTION_MODE = ErrorCode._internal(49, "ERROR_RESOLUTION_MODE"); - static const ERROR_POWER_CABLE_UNPLUGGING = ErrorCode._internal(50, "ERROR_POWER_CABLE_UNPLUGGING"); - static const ERROR_BATTERY_TROUBLE = ErrorCode._internal(51, "ERROR_BATTERY_TROUBLE"); - static const ERROR_UNSUPPORTED_MEDIA = ErrorCode._internal(52, "ERROR_UNSUPPORTED_MEDIA"); + static const ERROR_TUBE_RIBBON_EMPTY = + ErrorCode._internal(46, "ERROR_TUBE_RIBBON_EMPTY"); + static const ERROR_UPDATE_FRIM_NOT_SUPPORTED = + ErrorCode._internal(47, "ERROR_UPDATE_FRIM_NOT_SUPPORTED"); + static const ERROR_OS_VERSION_NOT_SUPPORTED = + ErrorCode._internal(48, "ERROR_OS_VERSION_NOT_SUPPORTED"); + static const ERROR_RESOLUTION_MODE = + ErrorCode._internal(49, "ERROR_RESOLUTION_MODE"); + static const ERROR_POWER_CABLE_UNPLUGGING = + ErrorCode._internal(50, "ERROR_POWER_CABLE_UNPLUGGING"); + static const ERROR_BATTERY_TROUBLE = + ErrorCode._internal(51, "ERROR_BATTERY_TROUBLE"); + static const ERROR_UNSUPPORTED_MEDIA = + ErrorCode._internal(52, "ERROR_UNSUPPORTED_MEDIA"); static const ERROR_TUBE_CUTTER = ErrorCode._internal(53, "ERROR_TUBE_CUTTER"); - static const ERROR_UNSUPPORTED_TWO_COLOR = ErrorCode._internal(54, "ERROR_UNSUPPORTED_TWO_COLOR"); - static const ERROR_UNSUPPORTED_MONO_COLOR = ErrorCode._internal(55, "ERROR_UNSUPPORTED_MONO_COLOR"); - static const ERROR_MINIMUM_LENGTH_LIMIT = ErrorCode._internal(56, "ERROR_MINIMUM_LENGTH_LIMIT"); - static const ERROR_WORKPATH_NOT_SET = ErrorCode._internal(57, "ERROR_WORKPATH_NOT_SET"); + static const ERROR_UNSUPPORTED_TWO_COLOR = + ErrorCode._internal(54, "ERROR_UNSUPPORTED_TWO_COLOR"); + static const ERROR_UNSUPPORTED_MONO_COLOR = + ErrorCode._internal(55, "ERROR_UNSUPPORTED_MONO_COLOR"); + static const ERROR_MINIMUM_LENGTH_LIMIT = + ErrorCode._internal(56, "ERROR_MINIMUM_LENGTH_LIMIT"); + static const ERROR_WORKPATH_NOT_SET = + ErrorCode._internal(57, "ERROR_WORKPATH_NOT_SET"); // Another_Brother specific error. Sent when the Android device does not have storage permissions granted. - static const ERROR_STORAGE_PERMISSION_NOT_GRANTED = ErrorCode._internal(9999, "ERROR_STORAGE_PERMISSION_NOT_GRANTED"); + static const ERROR_STORAGE_PERMISSION_NOT_GRANTED = + ErrorCode._internal(9999, "ERROR_STORAGE_PERMISSION_NOT_GRANTED"); static final _values = [ ERROR_NONE, @@ -1022,10 +1051,7 @@ class ErrorCode { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } static List getValues() => List.from(_values); @@ -1167,44 +1193,70 @@ class PrinterSettingItem { static const NET_BOOTMODE = PrinterSettingItem._internal(1, "NET_BOOTMODE"); static const NET_INTERFACE = PrinterSettingItem._internal(2, "NET_INTERFACE"); - static const NET_IPV4_BOOTMETHOD = PrinterSettingItem._internal(5, "NET_IPV4_BOOTMETHOD"); - static const NET_STATIC_IPV4ADDRESS = PrinterSettingItem._internal(6, "NET_STATIC_IPV4ADDRESS"); - static const NET_SUBNETMASK = PrinterSettingItem._internal(7, "NET_SUBNETMASK"); + static const NET_IPV4_BOOTMETHOD = + PrinterSettingItem._internal(5, "NET_IPV4_BOOTMETHOD"); + static const NET_STATIC_IPV4ADDRESS = + PrinterSettingItem._internal(6, "NET_STATIC_IPV4ADDRESS"); + static const NET_SUBNETMASK = + PrinterSettingItem._internal(7, "NET_SUBNETMASK"); static const NET_GATEWAY = PrinterSettingItem._internal(8, "NET_GATEWAY"); - static const NET_DNS_IPV4_BOOTMETHOD = PrinterSettingItem._internal(9, "NET_DNS_IPV4_BOOTMETHOD"); - static const NET_PRIMARY_DNS_IPV4ADDRESS = PrinterSettingItem._internal(10, "NET_PRIMARY_DNS_IPV4ADDRESS"); - static const NET_SECOND_DNS_IPV4ADDRESS = PrinterSettingItem._internal(11, "NET_SECOND_DNS_IPV4ADDRESS"); + static const NET_DNS_IPV4_BOOTMETHOD = + PrinterSettingItem._internal(9, "NET_DNS_IPV4_BOOTMETHOD"); + static const NET_PRIMARY_DNS_IPV4ADDRESS = + PrinterSettingItem._internal(10, "NET_PRIMARY_DNS_IPV4ADDRESS"); + static const NET_SECOND_DNS_IPV4ADDRESS = + PrinterSettingItem._internal(11, "NET_SECOND_DNS_IPV4ADDRESS"); static const NET_USED_IPV6 = PrinterSettingItem._internal(3, "NET_USED_IPV6"); - static const NET_PRIORITY_IPV6 = PrinterSettingItem._internal(4, "NET_PRIORITY_IPV6"); - static const NET_IPV6_BOOTMETHOD = PrinterSettingItem._internal(12, "NET_IPV6_BOOTMETHOD"); - static const NET_STATIC_IPV6ADDRESS = PrinterSettingItem._internal(13, "NET_STATIC_IPV6ADDRESS"); - static const NET_PRIMARY_DNS_IPV6ADDRESS = PrinterSettingItem._internal(14, "NET_PRIMARY_DNS_IPV6ADDRESS"); - static const NET_SECOND_DNS_IPV6ADDRESS = PrinterSettingItem._internal(15, "NET_SECOND_DNS_IPV6ADDRESS"); - static const NET_IPV6ADDRESS_LIST = PrinterSettingItem._internal(16, "NET_IPV6ADDRESS_LIST"); - static const NET_COMMUNICATION_MODE = PrinterSettingItem._internal(17, "NET_COMMUNICATION_MODE"); + static const NET_PRIORITY_IPV6 = + PrinterSettingItem._internal(4, "NET_PRIORITY_IPV6"); + static const NET_IPV6_BOOTMETHOD = + PrinterSettingItem._internal(12, "NET_IPV6_BOOTMETHOD"); + static const NET_STATIC_IPV6ADDRESS = + PrinterSettingItem._internal(13, "NET_STATIC_IPV6ADDRESS"); + static const NET_PRIMARY_DNS_IPV6ADDRESS = + PrinterSettingItem._internal(14, "NET_PRIMARY_DNS_IPV6ADDRESS"); + static const NET_SECOND_DNS_IPV6ADDRESS = + PrinterSettingItem._internal(15, "NET_SECOND_DNS_IPV6ADDRESS"); + static const NET_IPV6ADDRESS_LIST = + PrinterSettingItem._internal(16, "NET_IPV6ADDRESS_LIST"); + static const NET_COMMUNICATION_MODE = + PrinterSettingItem._internal(17, "NET_COMMUNICATION_MODE"); static const NET_SSID = PrinterSettingItem._internal(18, "NET_SSID"); static const NET_CHANNEL = PrinterSettingItem._internal(19, "NET_CHANNEL"); - static const NET_AUTHENTICATION_METHOD = PrinterSettingItem._internal(20, "NET_AUTHENTICATION_METHOD"); - static const NET_ENCRYPTIONMODE = PrinterSettingItem._internal(21, "NET_ENCRYPTIONMODE"); + static const NET_AUTHENTICATION_METHOD = + PrinterSettingItem._internal(20, "NET_AUTHENTICATION_METHOD"); + static const NET_ENCRYPTIONMODE = + PrinterSettingItem._internal(21, "NET_ENCRYPTIONMODE"); static const NET_WEPKEY = PrinterSettingItem._internal(22, "NET_WEPKEY"); - static const NET_PASSPHRASE = PrinterSettingItem._internal(23, "NET_PASSPHRASE"); + static const NET_PASSPHRASE = + PrinterSettingItem._internal(23, "NET_PASSPHRASE"); static const NET_USER_ID = PrinterSettingItem._internal(24, "NET_USER_ID"); static const NET_PASSWORD = PrinterSettingItem._internal(25, "NET_PASSWORD"); static const NET_NODENAME = PrinterSettingItem._internal(26, "NET_NODENAME"); static const WIRELESSDIRECT_KEY_CREATE_MODE = PrinterSettingItem._internal(27, "WIRELESSDIRECT_KEY_CREATE_MODE"); - static const WIRELESSDIRECT_SSID = PrinterSettingItem._internal(28, "WIRELESSDIRECT_SSID"); - static const WIRELESSDIRECT_NETWORK_KEY = PrinterSettingItem._internal(29, "WIRELESSDIRECT_NETWORK_KEY"); - static const BT_ISDISCOVERABLE = PrinterSettingItem._internal(30, "BT_ISDISCOVERABLE"); - static const BT_DEVICENAME = PrinterSettingItem._internal(31, "BT_DEVICENAME"); + static const WIRELESSDIRECT_SSID = + PrinterSettingItem._internal(28, "WIRELESSDIRECT_SSID"); + static const WIRELESSDIRECT_NETWORK_KEY = + PrinterSettingItem._internal(29, "WIRELESSDIRECT_NETWORK_KEY"); + static const BT_ISDISCOVERABLE = + PrinterSettingItem._internal(30, "BT_ISDISCOVERABLE"); + static const BT_DEVICENAME = + PrinterSettingItem._internal(31, "BT_DEVICENAME"); static const BT_BOOTMODE = PrinterSettingItem._internal(34, "BT_BOOTMODE"); - static const PRINT_JPEG_HALFTONE = PrinterSettingItem._internal(37, "PRINT_JPEG_HALFTONE"); - static const PRINT_JPEG_SCALE = PrinterSettingItem._internal(38, "PRINT_JPEG_SCALE"); - static const PRINT_DENSITY = PrinterSettingItem._internal(39, "PRINT_DENSITY"); + static const PRINT_JPEG_HALFTONE = + PrinterSettingItem._internal(37, "PRINT_JPEG_HALFTONE"); + static const PRINT_JPEG_SCALE = + PrinterSettingItem._internal(38, "PRINT_JPEG_SCALE"); + static const PRINT_DENSITY = + PrinterSettingItem._internal(39, "PRINT_DENSITY"); static const PRINT_SPEED = PrinterSettingItem._internal(40, "PRINT_SPEED"); - static const PRINTER_POWEROFFTIME = PrinterSettingItem._internal(35, "PRINTER_POWEROFFTIME"); - static const PRINTER_POWEROFFTIME_BATTERY = PrinterSettingItem._internal(36, "PRINTER_POWEROFFTIME_BATTERY"); - static const BT_AUTO_CONNECTION = PrinterSettingItem._internal(44, "BT_AUTO_CONNECTION"); + static const PRINTER_POWEROFFTIME = + PrinterSettingItem._internal(35, "PRINTER_POWEROFFTIME"); + static const PRINTER_POWEROFFTIME_BATTERY = + PrinterSettingItem._internal(36, "PRINTER_POWEROFFTIME_BATTERY"); + static const BT_AUTO_CONNECTION = + PrinterSettingItem._internal(44, "BT_AUTO_CONNECTION"); static const RESET = PrinterSettingItem._internal(254, "RESET"); static const UNSUPPORTED = PrinterSettingItem._internal(255, "UNSUPPORTED"); @@ -1305,10 +1357,7 @@ class PrinterSettingItem { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } @override @@ -1360,10 +1409,7 @@ class PrintQuality { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -1403,10 +1449,7 @@ class PjPaperKind { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -1486,9 +1529,10 @@ class PrinterInfo { bool banishMargin; bool useCopyCommandInTemplatePrint; + int? dpi; + PrinterInfo( - { - Model? printerModel, + {Model? printerModel, this.port = Port.BLUETOOTH, this.ipAddress = "", this.macAddress = "", @@ -1544,9 +1588,10 @@ class PrinterInfo { this.pjPaperKind = PjPaperKind.PJ_CUT_PAPER, this.useLegacyHalftoneEngine = false, this.banishMargin = false, - this.useCopyCommandInTemplatePrint = false}): - this.printerModel = printerModel == null ? Model.PJ_663 : printerModel, - this._lastConnectedAddress = "", this._localName = "", + this.useCopyCommandInTemplatePrint = false}) + : this.printerModel = printerModel == null ? Model.PJ_663 : printerModel, + this._lastConnectedAddress = "", + this._localName = "", _labelName = QL700.W62; String getLastConnectedAddress() { @@ -1702,8 +1747,6 @@ class PrinterInfo { CustomPaperInfo? getCustomPaperInfo() { return this.customPaperInfo; }*/ - - } class BatteryTernary { @@ -1754,7 +1797,6 @@ class BatteryTernary { return Unknown; } - static int ordinalFromID(int id) { for (int i = 0; i < _values.length; ++i) { BatteryTernary num = _values[i]; @@ -1772,10 +1814,7 @@ class BatteryTernary { } Map toMap() { - return { - "id": this._id, - "name": this._name - }; + return {"id": this._id, "name": this._name}; } } @@ -1815,23 +1854,23 @@ class PrinterStatus { static PrinterStatus fromMap(Map map) { return PrinterStatus( - statusBytes: map["statusBytes"], + statusBytes: map["statusBytes"], errorCode: ErrorCode.fromMap(map["errorCode"]), labelId: map["labelId"], labelType: map["labelType"], isACConnected: BatteryTernary.fromMap(map["isACConnected"]), - isBatteryMounted: BatteryTernary.fromMap(map["isBatteryMounted"]), + isBatteryMounted: BatteryTernary.fromMap(map["isBatteryMounted"]), batteryLevel: map["batteryLevel"], batteryResidualQuantityLevel: map["batteryResidualQuantityLevel"], - maxOfBatteryResidualQuantityLevel: map["maxOfBatteryResidualQuantityLevel"] - ); + maxOfBatteryResidualQuantityLevel: + map["maxOfBatteryResidualQuantityLevel"]); } Map toMap() { return { "errorCode": errorCode.toMap(), "labelId": labelId, - "labelType": labelType , + "labelType": labelType, "isACConnected": isACConnected.toMap(), "isBatteryMounted": isBatteryMounted.toMap(), "batteryLevel": batteryLevel, @@ -1844,7 +1883,6 @@ class PrinterStatus { String toString() { return toMap().toString(); } - } class TimeoutSetting { @@ -1897,8 +1935,16 @@ class PrinterSpec { final bool printerCase; final String modelName; - const PrinterSpec({this.modelId = 0, this.seriesId = 0, this.usdId = 0, this.headpin = 0, this.xDpi = 0, - this.yDpi = 0, this.printerCase = false, this.tubeHeadpin = 0, this.modelName = ""}); + const PrinterSpec( + {this.modelId = 0, + this.seriesId = 0, + this.usdId = 0, + this.headpin = 0, + this.xDpi = 0, + this.yDpi = 0, + this.printerCase = false, + this.tubeHeadpin = 0, + this.modelName = ""}); static PrinterSpec fromMap(Map map) { return PrinterSpec( @@ -1910,8 +1956,7 @@ class PrinterSpec { yDpi: map["yDpi"], printerCase: map["printerCase"], tubeHeadpin: map["tubeHeadpin"], - modelName:map["modelName"] - ); + modelName: map["modelName"]); } Map toMap() { @@ -1927,7 +1972,6 @@ class PrinterSpec { "modelName": modelName }; } - } class TemplateInfo { @@ -1938,14 +1982,16 @@ class TemplateInfo { final String fileName; final int modifiedDateRaw; - TemplateInfo({ - this.key = 0, + TemplateInfo( + {this.key = 0, this.fileSize = 0, this.checksum = 0, Uint8List? modifiedDate, this.fileName = "", this.modifiedDateRaw = 0}) - : this.modifiedDate = modifiedDate != null ? Printer.getDate(modifiedDate): new DateTime(0); + : this.modifiedDate = modifiedDate != null + ? Printer.getDate(modifiedDate) + : new DateTime(0); static TemplateInfo fromMap(Map map) { return TemplateInfo( @@ -1954,8 +2000,7 @@ class TemplateInfo { checksum: map["checksum"], modifiedDate: map["modifiedDate"], fileName: map["fileName"], - modifiedDateRaw: map["modifiedDateRaw"] - ); + modifiedDateRaw: map["modifiedDateRaw"]); } Map toMap() { @@ -2047,8 +2092,7 @@ class Paper { pinOffsetRight: map["pinOffsetRight"], labelType: map["labelType"], paperName: map["paperName"], - paperNameInch: map["paperNameInch:"] - ); + paperNameInch: map["paperNameInch:"]); } Map toMap() { @@ -2072,6 +2116,7 @@ class Paper { }; } } + class LabelParam { int headPinNum = 0; int labelWidth; @@ -2102,7 +2147,7 @@ class LabelParam { double paperLength = 0, int imageAreaWidth = 0, int imageAreaLength = 0, - int pinOffsetLeft = 0 , + int pinOffsetLeft = 0, int pinOffsetRight = 0, int physicalOffsetX = 0, int physicalOffsetY = 0, @@ -2138,8 +2183,7 @@ class LabelParam { physicalOffsetX: map["physicalOffsetX"], physicalOffsetY: map["physicalOffsetY"], labelType: map["labelType"], - paperID : map["paperID"] - ); + paperID: map["paperID"]); } Map toMap() { @@ -2182,7 +2226,6 @@ class LabelParam { "paperName $paperName, " "paperNameInch $paperNameInch, " "paperID $paperID}"; - } } @@ -2193,7 +2236,7 @@ class HealthStatus { static const Excellent = HealthStatus._internal(0, "Excellent"); static const Good = HealthStatus._internal(1, "Good"); - static const ReplaceSoon = HealthStatus._internal(2, "ReplaceSoon"); + static const ReplaceSoon = HealthStatus._internal(2, "ReplaceSoon"); static const ReplaceBattery = HealthStatus._internal(3, "ReplaceBattery"); static const NotInstalled = HealthStatus._internal(4, "NotInstalled"); @@ -2240,17 +2283,13 @@ class HealthStatus { } Map toMap() { - return { - "id": this._id, - "name": this._name - }; + return {"id": this._id, "name": this._name}; } @override String toString() { return _name; } - } class BatteryInfo { @@ -2266,13 +2305,11 @@ class BatteryInfo { this.batteryHealthLevel = healthLevel, this.batteryHealthStatus = healthStatus; - static BatteryInfo fromMap(Map map) { return BatteryInfo( - chargeLevel: map["chargeLevel"], + chargeLevel: map["chargeLevel"], healthLevel: map["healthLevel"], - healthStatus: HealthStatus.fromMap(map["healthStatus"]) - ); + healthStatus: HealthStatus.fromMap(map["healthStatus"])); } Map toMap() { @@ -2333,7 +2370,6 @@ class NetPrinter implements ABrotherPrinter { @override String getName() => modelName; - } class PaperKind { @@ -2345,11 +2381,7 @@ class PaperKind { static const DIE_CUT = PaperKind._internal("DIE_CUT"); static const MARKED_ROLL = PaperKind._internal("MARKED_ROLL"); - static final _values = [ - ROLL, - DIE_CUT, - MARKED_ROLL - ]; + static final _values = [ROLL, DIE_CUT, MARKED_ROLL]; static PaperKind fromName(String name) { int var2 = _values.length; @@ -2377,7 +2409,6 @@ class PaperKind { String toString() { return toMap().toString(); } - } class Unit { @@ -2387,10 +2418,7 @@ class Unit { static const Inch = Unit._internal("Inch"); static const Mm = Unit._internal("Mm"); - static final _values = [ - Inch, - Mm - ]; + static final _values = [Inch, Mm]; static Unit fromName(String name) { int var2 = _values.length; @@ -2448,16 +2476,66 @@ class CustomPaperInfo { this.markPosition, this.markHeight); - static CustomPaperInfo newCustomRollPaper(Model printerModel, Unit unit, double tapeWidth, double rightMargin, double leftMargin, double topMargin) { - return new CustomPaperInfo._internal(printerModel, PaperKind.ROLL, unit, tapeWidth, 0.0, rightMargin, leftMargin, topMargin, 0.0, 0.0, 0.0, 0.0); - } - - static CustomPaperInfo newCustomDiaCutPaper(Model printerModel, Unit unit, double tapeWidth, double tapeLength, double rightMargin, double leftMargin, double topMargin, double bottomMargin, double labelPitch) { - return new CustomPaperInfo._internal(printerModel, PaperKind.DIE_CUT, unit, tapeWidth, tapeLength, rightMargin, leftMargin, topMargin, bottomMargin, labelPitch, 0.0, 0.0); - } - - static CustomPaperInfo newCustomMarkRollPaper(Model printerModel, Unit unit, double tapeWidth, double tapeLength, double rightMargin, double leftMargin, double topMargin, double bottomMargin, double markPosition, double markHeight) { - return new CustomPaperInfo._internal(printerModel, PaperKind.MARKED_ROLL, unit, tapeWidth, tapeLength, rightMargin, leftMargin, topMargin, bottomMargin, 0.0, markPosition, markHeight); + static CustomPaperInfo newCustomRollPaper( + Model printerModel, + Unit unit, + double tapeWidth, + double rightMargin, + double leftMargin, + double topMargin) { + return new CustomPaperInfo._internal(printerModel, PaperKind.ROLL, unit, + tapeWidth, 0.0, rightMargin, leftMargin, topMargin, 0.0, 0.0, 0.0, 0.0); + } + + static CustomPaperInfo newCustomDiaCutPaper( + Model printerModel, + Unit unit, + double tapeWidth, + double tapeLength, + double rightMargin, + double leftMargin, + double topMargin, + double bottomMargin, + double labelPitch) { + return new CustomPaperInfo._internal( + printerModel, + PaperKind.DIE_CUT, + unit, + tapeWidth, + tapeLength, + rightMargin, + leftMargin, + topMargin, + bottomMargin, + labelPitch, + 0.0, + 0.0); + } + + static CustomPaperInfo newCustomMarkRollPaper( + Model printerModel, + Unit unit, + double tapeWidth, + double tapeLength, + double rightMargin, + double leftMargin, + double topMargin, + double bottomMargin, + double markPosition, + double markHeight) { + return new CustomPaperInfo._internal( + printerModel, + PaperKind.MARKED_ROLL, + unit, + tapeWidth, + tapeLength, + rightMargin, + leftMargin, + topMargin, + bottomMargin, + 0.0, + markPosition, + markHeight); } static CustomPaperInfo? fromMap(Map? map) { @@ -2482,7 +2560,7 @@ class CustomPaperInfo { Map toMap() { return { - "printerModel" : this.printerModel.toMap(), + "printerModel": this.printerModel.toMap(), "paperKind": this.paperKind.toMap(), "unit": this.unit.toMap(), "tapeWidth": this.tapeWidth, @@ -2513,14 +2591,11 @@ class BLEPrinter implements ABrotherPrinter { BLEPrinter({this.localName = ""}); static BLEPrinter fromMap(Map map) { - return BLEPrinter( - localName: map["localName"]); + return BLEPrinter(localName: map["localName"]); } Map toMap() { - return { - "localName": localName - }; + return {"localName": localName}; } @override @@ -2532,11 +2607,11 @@ class BLEPrinter implements ABrotherPrinter { int get hashCode => localName.hashCode; @override - bool operator ==(Object other) => other is BLEPrinter && localName == other.localName; + bool operator ==(Object other) => + other is BLEPrinter && localName == other.localName; @override String getName() => localName; - } // TODO Integrate with new API getBluetoothPrinters(List modelNames) @@ -2548,16 +2623,11 @@ class BluetoothPrinter implements ABrotherPrinter { static BluetoothPrinter fromMap(Map map) { return BluetoothPrinter( - modelName: map["modelName"], - macAddress: map["macAddress"] - ); + modelName: map["modelName"], macAddress: map["macAddress"]); } Map toMap() { - return { - "modelName": modelName, - "macAddress": macAddress - }; + return {"modelName": modelName, "macAddress": macAddress}; } @override @@ -2569,15 +2639,14 @@ class BluetoothPrinter implements ABrotherPrinter { int get hashCode => macAddress.hashCode; @override - bool operator ==(Object other) => other is BluetoothPrinter && macAddress == other.macAddress; + bool operator ==(Object other) => + other is BluetoothPrinter && macAddress == other.macAddress; @override String getName() => modelName; - } class Printer { - static const MethodChannel _channel = const MethodChannel('another_brother'); static final int QUALITY = 100; @@ -2600,8 +2669,8 @@ class Printer { static void setUserPrinterInfo(PrinterInfo mPrinterInfo) { Printer.mPrinterInfo = mPrinterInfo; - mPrinterInfo._labelName = Printer.mPrinterInfo.printerModel.getLabelName(mPrinterInfo.labelNameIndex); - + mPrinterInfo._labelName = Printer.mPrinterInfo.printerModel + .getLabelName(mPrinterInfo.labelNameIndex); } static DateTime getDate(Uint8List bytes) { @@ -2637,31 +2706,31 @@ class Printer { var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "filePath" : filepath + "filePath": filepath }; final Map resultMap = await _channel.invokeMethod("printFile", params); - print ("Received Result: $resultMap"); + print("Received Result: $resultMap"); PrinterStatus status = PrinterStatus.fromMap(resultMap); return status; } - static Future get platformVersion async { final String version = await _channel.invokeMethod('getPlatformVersion'); return version; } - // Print the text using print settings. - Future printText(Paragraph paragraph, {Offset offset = Offset.zero, Color background = const Color(0xFFFFFFFF)}) async { + Future printText(Paragraph paragraph, + {Offset offset = Offset.zero, + Color background = const Color(0xFFFFFFFF)}) async { PictureRecorder recorder = PictureRecorder(); Canvas c = Canvas(recorder); Paint paint = new Paint()..color = background; - double height = offset.dy + paragraph.height; + double height = offset.dy + paragraph.height; // TODO Move to constant if (height < 100) { @@ -2670,74 +2739,69 @@ class Printer { c.drawRect(Rect.fromLTWH(0, 0, offset.dx + paragraph.width, height), paint); c.drawParagraph(paragraph, offset); - var picture = await recorder.endRecording().toImage(offset.dx.toInt() + paragraph.width.toInt(), height.toInt()); + var picture = await recorder + .endRecording() + .toImage(offset.dx.toInt() + paragraph.width.toInt(), height.toInt()); return printImage(picture); } /// Print the image using print settings set by setPrinterInfo. Future printImage(Image image) async { + var imageBytes = await image.toByteData(format: ImageByteFormat.png); + if (imageBytes == null) { + return PrinterStatus(errorCode: ErrorCode.ERROR_UNSUPPORTED_MEDIA); + } - var imageBytes = await image.toByteData(format: ImageByteFormat.png); - if (imageBytes == null) { - return PrinterStatus(errorCode: ErrorCode.ERROR_UNSUPPORTED_MEDIA); - } - - var outByteArray = Uint8List(imageBytes.lengthInBytes); - for (int i = 0; i < imageBytes.lengthInBytes; i ++) { - outByteArray[i] = imageBytes.getUint8(i); - } + var outByteArray = Uint8List(imageBytes.lengthInBytes); + for (int i = 0; i < imageBytes.lengthInBytes; i++) { + outByteArray[i] = imageBytes.getUint8(i); + } - var params = { - "printerId": mPrinterId, - "printInfo": mPrinterInfo.toMap(), - "imageBytes": outByteArray - }; + var params = { + "printerId": mPrinterId, + "printInfo": mPrinterInfo.toMap(), + "imageBytes": outByteArray + }; - final Map resultMap = await _channel.invokeMethod("printImage", params); + final Map resultMap = await _channel.invokeMethod("printImage", params); - print("Print Result: ${resultMap} "); + print("Print Result: ${resultMap} "); - PrinterStatus status = PrinterStatus.fromMap(resultMap); + PrinterStatus status = PrinterStatus.fromMap(resultMap); - return status; + return status; } - /// Print the image files using print settings set by setPrinterInfo. Future printFileList(List fileList) async { var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "filePathList" : fileList + "filePathList": fileList }; final Map resultMap = await _channel.invokeMethod("printFileList", params); PrinterStatus status = PrinterStatus.fromMap(resultMap); return status; - } - /// Print the pdf file using print settings set by setPrinterInfo. Available on Android 5.0 or later. Future printPdfFile(String filepath, int pagenum) async { - var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "filePath" : filepath, - "pagenum" : pagenum + "filePath": filepath, + "pagenum": pagenum }; final Map resultMap = await _channel.invokeMethod("printPdfFile", params); PrinterStatus status = PrinterStatus.fromMap(resultMap); return status; - } - /* /// Same functionality as printPdfFile. Available on less than Android 6.0. Future printPDF(String filepath, int pagenum) async { @@ -2774,11 +2838,10 @@ class Printer { /// Get the page count of the specified pdf file. Available on Android 5.0 or later. Future getPdfFilePages(String filepath) async { - var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "filePath" : filepath + "filePath": filepath }; final int pages = await _channel.invokeMethod("getPDFFilePages", params); @@ -2791,11 +2854,10 @@ class Printer { /// a Windows application. For Bluetooth and USB transfers, use pdz files. /// For all interface, use blf files. Future transfer(String filepath) async { - var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "filePath" : filepath, + "filePath": filepath, }; final Map resultMap = await _channel.invokeMethod("transfer", params); @@ -2804,23 +2866,19 @@ class Printer { return status; } - Future updateFirm(String filepath) async { - var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "filePath" : filepath, + "filePath": filepath, }; final Map resultMap = await _channel.invokeMethod("updateFirm", params); PrinterStatus status = PrinterStatus.fromMap(resultMap); return status; - } - /// Send the database data described in .csv format. In addition, /// Updates the database for printers that have templates and databases /// created and linked by P-touch Editor. @@ -2834,18 +2892,16 @@ class Printer { // //PT-E550W Future sendDatabase(String filepath) async { - var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "filePath" : filepath, + "filePath": filepath, }; final Map resultMap = await _channel.invokeMethod("sendDatabase", params); PrinterStatus status = PrinterStatus.fromMap(resultMap); return status; - } /// Send the binary file containing the command. Since the status check is @@ -2855,25 +2911,23 @@ class Printer { var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "filePath" : filepath, + "filePath": filepath, }; final Map resultMap = await _channel.invokeMethod("sendBinaryFile", params); PrinterStatus status = PrinterStatus.fromMap(resultMap); return status; - } /// Send the binary data containing the command. Since the status check /// is not performed, it is sent even if the printer specified by /// printerModel is different from the actually connected printer. Future sendBinary(Uint8List data) async { - var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "data" : data, + "data": data, }; final Map resultMap = await _channel.invokeMethod("sendBinary", params); @@ -2888,19 +2942,20 @@ class Printer { "printInfo": mPrinterInfo.toMap(), }; - final String firmVersion = await _channel.invokeMethod("getFirmVersion", params); + final String firmVersion = + await _channel.invokeMethod("getFirmVersion", params); return firmVersion; } - Future getMediaVersion() async { var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), }; - final String mediaVersion = await _channel.invokeMethod("getMediaVersion", params); + final String mediaVersion = + await _channel.invokeMethod("getMediaVersion", params); return mediaVersion; } @@ -2911,24 +2966,24 @@ class Printer { "printInfo": mPrinterInfo.toMap(), }; - final String serialNumber = await _channel.invokeMethod("getSerialNumber", params); + final String serialNumber = + await _channel.invokeMethod("getSerialNumber", params); return serialNumber; } - Future getBatteryWeak() async { var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), }; - final int batteryWeak = await _channel.invokeMethod("getBatteryWeak", params); + final int batteryWeak = + await _channel.invokeMethod("getBatteryWeak", params); return batteryWeak; } - Future getBootMode() async { var params = { "printerId": mPrinterId, @@ -2940,15 +2995,15 @@ class Printer { return bootMode; } - Future getFirmFileVer(String filePath) async { var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "filePath" : filePath, + "filePath": filePath, }; - final String firmFileVersion = await _channel.invokeMethod("getFirmFileVer", params); + final String firmFileVersion = + await _channel.invokeMethod("getFirmFileVer", params); return firmFileVersion; } @@ -2957,21 +3012,21 @@ class Printer { var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "filePath" : filePath, + "filePath": filePath, }; - final String mediaFileVersion = await _channel.invokeMethod("getMediaFileVer", params); + final String mediaFileVersion = + await _channel.invokeMethod("getMediaFileVer", params); return mediaFileVersion; } /// Removes templates from the printer. Future removeTemplate(List keyList) async { - var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "keyList" : keyList, + "keyList": keyList, }; final Map resultMap = await _channel.invokeMethod("removeTemplate", params); @@ -2980,16 +3035,15 @@ class Printer { return status; } - /// Gets a list of the templates that have been downloaded to the printer. Future getTemplateList(List outTmplList) async { - var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), }; - final Map resultMap = await _channel.invokeMethod("getTemplateList", params); + final Map resultMap = + await _channel.invokeMethod("getTemplateList", params); PrinterStatus status = PrinterStatus.fromMap(resultMap["printerStatus"]); final List templates = resultMap["templateList"]; @@ -3001,13 +3055,13 @@ class Printer { } /// Set PrinterInfo object to specify the printer and print settings. - Future setPrinterInfo(PrinterInfo printerInfo) async { + Future setPrinterInfo(PrinterInfo printerInfo, {int? dpi}) async { mPrinterInfo = printerInfo; - mPrinterInfo._labelName = mPrinterInfo.printerModel.getLabelName(mPrinterInfo.labelNameIndex); + mPrinterInfo._labelName = + mPrinterInfo.printerModel.getLabelName(mPrinterInfo.labelNameIndex); return true; } - /// Get the printer information which is currently set. Future getPrinterInfo() async { return mPrinterInfo; @@ -3015,13 +3069,13 @@ class Printer { /// Retrieves the printer status. Future getPrinterStatus() async { - var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), }; - final Map resultMap = await _channel.invokeMethod("getPrinterStatus", params); + final Map resultMap = + await _channel.invokeMethod("getPrinterStatus", params); PrinterStatus status = PrinterStatus.fromMap(resultMap); return status; @@ -3033,31 +3087,33 @@ class Printer { /// getPrinterSettings after the restart. Future updatePrinterSettings( Map settings) async { - - final Map, String> dartSettings = settings.map((key, value) => new MapEntry(key.toMap(), value)); + final Map, String> dartSettings = + settings.map((key, value) => new MapEntry(key.toMap(), value)); var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), "settings": dartSettings }; - final Map resultMap = await _channel.invokeMethod("updatePrinterSettings", params); + final Map resultMap = + await _channel.invokeMethod("updatePrinterSettings", params); PrinterStatus status = PrinterStatus.fromMap(resultMap); return status; } /// Get printer settings. See Printer Configurations for available values. - Future getPrinterSettings( - List keys, Map outValues) async { - + Future getPrinterSettings(List keys, + Map outValues) async { var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "keys": keys.map((printerSettingItem) => printerSettingItem.toMap()).toList() + "keys": + keys.map((printerSettingItem) => printerSettingItem.toMap()).toList() }; - final Map resultMap = await _channel.invokeMethod("getPrinterSettings", params); + final Map resultMap = + await _channel.invokeMethod("getPrinterSettings", params); PrinterStatus status = PrinterStatus.fromMap(resultMap["printerStatus"]); Map values = resultMap["values"]; @@ -3076,7 +3132,8 @@ class Printer { "printInfo": mPrinterInfo.toMap(), }; - final String systemReport = await _channel.invokeMethod("getSystemReport", params); + final String systemReport = + await _channel.invokeMethod("getSystemReport", params); return systemReport; } @@ -3092,21 +3149,23 @@ class Printer { BatteryInfo info = BatteryInfo.fromMap(resultMap); return info; - } /// Gets Bluetooth settings from the MW series. Refer to BluetoothPreference. - Future getBluetoothPreference(BluetoothPreference btPre) async { + Future getBluetoothPreference( + BluetoothPreference btPre) async { var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), }; - final Map resultMap = await _channel.invokeMethod("getBluetoothPreference", params); + final Map resultMap = + await _channel.invokeMethod("getBluetoothPreference", params); PrinterStatus status = PrinterStatus.fromMap(resultMap["printerStatus"]); - BluetoothPreference resultPrefs = BluetoothPreference.fromMap(resultMap["btPre"]); + BluetoothPreference resultPrefs = + BluetoothPreference.fromMap(resultMap["btPre"]); btPre.authMode = resultPrefs.authMode; btPre.enableSsp = resultPrefs.enableSsp; btPre.powerMode = resultPrefs.powerMode; @@ -3117,20 +3176,21 @@ class Printer { /// Updates Bluetooth settings of the MW series. Refer to BluetoothPreference. /// This method does not check if the request has been reflected on the /// device. Please check using getBluetoothPreference if needed. - Future updateBluetoothPreference(BluetoothPreference btPre) async { + Future updateBluetoothPreference( + BluetoothPreference btPre) async { var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), "btPre": btPre.toMap() }; - final Map resultMap = await _channel.invokeMethod("updateBluetoothPreference", params); + final Map resultMap = + await _channel.invokeMethod("updateBluetoothPreference", params); PrinterStatus status = PrinterStatus.fromMap(resultMap); return status; } - /// Start creating the command and print data string for a P-touch Template. /// Specify a template and the character encoding. /// This function assumes the default P-touch Template settings. @@ -3162,13 +3222,11 @@ class Printer { final bool success = await _channel.invokeMethod("replaceText", params); return success; - } /// Replaces the text in an object of a P-touch Template, specified by /// its object number. Future replaceTextIndex(String data, int index) async { - var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), @@ -3176,16 +3234,15 @@ class Printer { "index": index }; - final bool success = await _channel.invokeMethod("replaceTextIndex", params); + final bool success = + await _channel.invokeMethod("replaceTextIndex", params); return success; } - /// Replaces the text in an object of a P-touch Template, /// specified by the object's name. Future replaceTextName(String data, String objectName) async { - var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), @@ -3214,46 +3271,49 @@ class Printer { /// Discover printers of the given model that are connected to the /// same network. Future> getNetPrinters(List modelName) async { - // TODO If on iOS don't call the platform, do it at the flutter layer. var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "models" : modelName, + "models": modelName, }; - final List resultList = await _channel.invokeMethod("getNetPrinters", params); + final List resultList = + await _channel.invokeMethod("getNetPrinters", params); - final List outList = resultList.map( (netPrinter) => NetPrinter.fromMap(netPrinter)).toList(); + final List outList = + resultList.map((netPrinter) => NetPrinter.fromMap(netPrinter)).toList(); return outList; } - /// Returns the paried printers matching the model name specified. - Future> getBluetoothPrinters(List modelName) async { - + Future> getBluetoothPrinters( + List modelName) async { var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "models" : modelName, + "models": modelName, }; - final List resultList = await _channel.invokeMethod("getBluetoothPrinters", params); + final List resultList = + await _channel.invokeMethod("getBluetoothPrinters", params); - final List outList = resultList.map( (bluetoothPrinter) => BluetoothPrinter.fromMap(bluetoothPrinter)).toList(); + final List outList = resultList + .map((bluetoothPrinter) => BluetoothPrinter.fromMap(bluetoothPrinter)) + .toList(); return outList; } - Future getNetPrinterInfo(String ipAddress) async { var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "ipAddress" : ipAddress, + "ipAddress": ipAddress, }; - final Map resultMap = await _channel.invokeMethod("getNetPrinterInfo", params); + final Map resultMap = + await _channel.invokeMethod("getNetPrinterInfo", params); final NetPrinter outPrinter = NetPrinter.fromMap(resultMap); return outPrinter; @@ -3262,7 +3322,6 @@ class Printer { /// Get the detail information of the media (for QL, PT, TD and RJ series) /// specified by setPrinterInfo. Future getLabelParam() async { - var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), @@ -3274,11 +3333,9 @@ class Printer { return outLabel; } - /// Retrieves the label information from the printer. /// Available for QL and PT series only. Future getLabelInfo() async { - var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), @@ -3286,24 +3343,24 @@ class Printer { final Map resultMap = await _channel.invokeMethod("getLabelInfo", params); - print ("Label Info: $resultMap"); + print("Label Info: $resultMap"); final LabelInfo outLabel = LabelInfo.fromMap(resultMap); return outLabel; } - /// Discover printers which are connectable via BLE. Available /// on Android 5.0 or later. Future> getBLEPrinters(int timeout) async { - // TODO Consider moving this to iOS side. if (Platform.isIOS) { //BLE Scanning //FlutterBluePlus? flutterBlue = FlutterBluePlus(); // Start scanning - FlutterBluePlus.startScan(withServices: [Guid("A76EB9E0-F3AC-4990-84CF-3A94D2426B2B")], timeout: Duration(seconds: timeout~/1000)); + FlutterBluePlus.startScan( + withServices: [Guid("A76EB9E0-F3AC-4990-84CF-3A94D2426B2B")], + timeout: Duration(seconds: timeout ~/ 1000)); Set foundDevices = {}; // Listen to scan results @@ -3316,33 +3373,35 @@ class Printer { } }); - return await Future.delayed(Duration(seconds: timeout~/1000), () => foundDevices.toList()); + return await Future.delayed( + Duration(seconds: timeout ~/ 1000), () => foundDevices.toList()); } var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), - "timeout" : timeout, + "timeout": timeout, }; - final List resultList = await _channel.invokeMethod("getBLEPrinters", params); + final List resultList = + await _channel.invokeMethod("getBLEPrinters", params); - final List outList = resultList.map( (blePrinter) => BLEPrinter.fromMap(blePrinter)).toList(); + final List outList = + resultList.map((blePrinter) => BLEPrinter.fromMap(blePrinter)).toList(); return outList; } - /// Starts a communication with the printer. /// Note: This does not seem to impact whether a print will succeed or not /// on the Android side. Printing without calling this will still print. Future startCommunication() async { - var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), }; - final bool result = await _channel.invokeMethod("startCommunication", params); + final bool result = + await _channel.invokeMethod("startCommunication", params); print("Print Result: ${result} "); return result; @@ -3351,7 +3410,6 @@ class Printer { /// Ends a communication with the printer. /// Note: This does not seem to impact printing. Future endCommunication() async { - var params = { "printerId": mPrinterId, "printInfo": mPrinterInfo.toMap(), @@ -3363,7 +3421,6 @@ class Printer { return result; } - /// Cancel printing. Invalid while sending data. Future cancel() async { var params = { @@ -3374,6 +3431,4 @@ class Printer { final bool result = await _channel.invokeMethod("cancel", params); return result; } - } - diff --git a/lib/type_b_commands.dart b/lib/type_b_commands.dart index 76dfcb9..2701be7 100644 --- a/lib/type_b_commands.dart +++ b/lib/type_b_commands.dart @@ -1,7 +1,4 @@ -import 'dart:typed_data'; - import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; abstract class ITbCommand { String getCommand(); diff --git a/lib/type_b_printer.dart b/lib/type_b_printer.dart index 054a2c9..c41ef68 100644 --- a/lib/type_b_printer.dart +++ b/lib/type_b_printer.dart @@ -30,7 +30,7 @@ class TbPrinterInfo { String btAddress = "", String localName = "", TbModel printerModel = TbModel.RJ_2055WB, - ATbLabelName? labelName, + ATbLabelName? labelName, this.port = Port.NET}) : this.ipAddress = ipAddress, this.portNumber = portNumber, @@ -53,13 +53,12 @@ class TbPrinterInfo { factory TbPrinterInfo.fromMap(Map map) { return TbPrinterInfo( - ipAddress: map["ipAddress"], - portNumber: map["portNumber"], - btAddress: map["btAddress"], - localName:map["localName"], - port: Port.fromMap(map["port"]), - labelName: TbLabelName.fromMap(map["labelName"]) - ); + ipAddress: map["ipAddress"], + portNumber: map["portNumber"], + btAddress: map["btAddress"], + localName: map["localName"], + port: Port.fromMap(map["port"]), + labelName: TbLabelName.fromMap(map["labelName"])); } } @@ -84,7 +83,6 @@ class TbPrinter { return resolution / dots * _MM_IN_INCHE; } - TbPrinter({TbPrinterInfo? printerInfo}) { if (printerInfo != null) { this._printerInfo = printerInfo; @@ -323,7 +321,7 @@ class TbPrinter { //Future downloadImage(Image image, Future downloadImage(Image image, {int x = 0, int y = 0, double scale = 1, int printerDpi = 203}) async { - double ratio = image.height / image.width ; + double ratio = image.height / image.width; double desiredImageWidth = image.width * scale; //image.height * printerDpi / 72 * scale; double desiredImageHeight = @@ -424,21 +422,21 @@ class TbPrinter { //Image bmpImage = await BrotherUtils.bytesToImage(bmpImageBytes); // Save image to temp storage location. - String tempBmpFilename = "temp.bmp"; //"temp_${DateTime.now().microsecondsSinceEpoch}.bmp"; - String tempBmpFilePath = await BrotherUtils.bytesToTempFile( - bmpImageBytes, tempBmpFilename); + String tempBmpFilename = + "temp.bmp"; //"temp_${DateTime.now().microsecondsSinceEpoch}.bmp"; + String tempBmpFilePath = + await BrotherUtils.bytesToTempFile(bmpImageBytes, tempBmpFilename); // downloadBmp //bool downloadSuccess = await downloadBmp(tempBmpFilePath); // The position is set on the canvas instead of the put, so we // place at 0,0 - bool putSuccess = await sendTbCommand( - TbCommandPutBmp(0, 0, tempBmpFilePath)); + bool putSuccess = + await sendTbCommand(TbCommandPutBmp(0, 0, tempBmpFilePath)); // Delete bmp file await File(tempBmpFilePath).delete(); // Return success value. return putSuccess; - } - else { + } else { TbCommandSendBitmap sendBitmapCmd = TbCommandSendBitmap( x, y, @@ -451,11 +449,9 @@ class TbPrinter { outImageBytes); //sendCommand(String.fromCharCodes(outImageBytes)); result = result && await sendCommand("\"\r\n"); - return result; //return bmpImage; //return grayPicture; - } } @@ -464,31 +460,48 @@ class TbPrinter { /// returns the completed BMP bytes. /// Type B uses Windows BMP format (BM) /// Reference: https://en.wikipedia.org/wiki/BMP_file_format - Uint8List _wrapInWindowBmp({required int width, required int height, required Uint8List imageBytes, required int printerDpi}) { - + Uint8List _wrapInWindowBmp( + {required int width, + required int height, + required Uint8List imageBytes, + required int printerDpi}) { // BMP Header - int headerByteSize = 2 // header field - + 4 // size of bmp file in bytes - + 2 // Reserved - + 2 // Reserved - + 4 // The offset, starting address of the byte where the image data can be found + int headerByteSize = 2 // header field + + + 4 // size of bmp file in bytes + + + 2 // Reserved + + + 2 // Reserved + + + 4 // The offset, starting address of the byte where the image data can be found ; // DIB Header - int bitmapInfoHeaderByteSize = 4 // Size of this header in bytes (40) - + 4 //bitmap width in pixels - + 4 // bitmap height in pixels - + 2 // number of color planes, - + 2 // number of bit per pixel, 1, 4 ,8 24 or 32 - + 4 // compression method being used. - + 4 // the size of the raw image bitmap data - + 4 // horizontal resolution of the image - + 4 // vertical resolution of the image - + 4 // the number of colors in teh color palette, or 0 to default to 2^n - + 4 // the number of important colors used, or 0 when every color is important, generally ignored - + 8 // Color Table. because bpp < 8 - ; - + int bitmapInfoHeaderByteSize = 4 // Size of this header in bytes (40) + + + 4 //bitmap width in pixels + + + 4 // bitmap height in pixels + + + 2 // number of color planes, + + + 2 // number of bit per pixel, 1, 4 ,8 24 or 32 + + + 4 // compression method being used. + + + 4 // the size of the raw image bitmap data + + + 4 // horizontal resolution of the image + + + 4 // vertical resolution of the image + + + 4 // the number of colors in teh color palette, or 0 to default to 2^n + + + 4 // the number of important colors used, or 0 when every color is important, generally ignored + + + 8 // Color Table. because bpp < 8 + ; final BytesBuilder bytesBuilder = BytesBuilder(); // BMP Header @@ -496,7 +509,8 @@ class TbPrinter { bytesBuilder.addByte(0x42); // B - 0X42 bytesBuilder.addByte(0x4D); // M - 0x4D // Size of BMP in bytes - 4 bytes - int sizeOfBmpFile = headerByteSize + bitmapInfoHeaderByteSize + imageBytes.length; + int sizeOfBmpFile = + headerByteSize + bitmapInfoHeaderByteSize + imageBytes.length; ByteData sizeData = ByteData(4); sizeData.setInt32(0, sizeOfBmpFile, Endian.little); bytesBuilder.add(sizeData.buffer.asUint8List()); @@ -507,7 +521,7 @@ class TbPrinter { bytesBuilder.addByte(0); bytesBuilder.addByte(0); // Offset, - 4 bytes i.e. starting address of the byte where the image data can be found - int imageDataOffset = headerByteSize + bitmapInfoHeaderByteSize; + int imageDataOffset = headerByteSize + bitmapInfoHeaderByteSize; ByteData imageDataOffsetData = ByteData(4); imageDataOffsetData.setInt32(0, imageDataOffset, Endian.little); bytesBuilder.add(imageDataOffsetData.buffer.asUint8List()); @@ -560,7 +574,8 @@ class TbPrinter { bytesBuilder.add(colorsInPaletteData.buffer.asUint8List()); // Number of important colors - 4 bytes ByteData importantColorData = ByteData(4); - importantColorData.setInt32(0, 0, Endian.little); // 0 - every color is important. + importantColorData.setInt32( + 0, 0, Endian.little); // 0 - every color is important. bytesBuilder.add(importantColorData.buffer.asUint8List()); // Color table, 2 colors (black and white) required if bpp <= 8 bytesBuilder.add([0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00]); @@ -571,23 +586,21 @@ class TbPrinter { if (requiredRowWidth == width) { // Just add since no padding is needed. // TODO: Revisit if image prints updside down Note the image is also built bottom up starting from the last row. - for (int i = height -1; i >= 0; i--) { - int start = i * width~/8; - int end = start + width~/8; + for (int i = height - 1; i >= 0; i--) { + int start = i * width ~/ 8; + int end = start + width ~/ 8; //print ("Start: $start - End: $end - Size: ${imageBytes.length}"); bytesBuilder.add(imageBytes.getRange(start, end).toList()); } - - } - else { + } else { // Add row and pad with extra bits. int paddingBitCount = requiredRowWidth - width; // Important: This only works because the image width is a multiple of 8 as is - ByteData paddingByteData = ByteData(paddingBitCount~/8); + ByteData paddingByteData = ByteData(paddingBitCount ~/ 8); //for (int i = 0; i < height; i++) { - for (int i = height -1; i >= 0; i--) { - int start = i * width~/8; - int end = start + width~/8; + for (int i = height - 1; i >= 0; i--) { + int start = i * width ~/ 8; + int end = start + width ~/ 8; //print ("Start: $start - End: $end - Size: ${imageBytes.length}"); bytesBuilder.add(imageBytes.getRange(start, end).toList()); // TODO Revisit this because right now it's relying on the format from the data above. @@ -751,7 +764,8 @@ class TbPrinter { await _channel.invokeMethod("typeB-getBluetoothPrinters", params); final List outList = resultList - .map((bluetoothPrinter) => TbBluetoothPrinter._(BluetoothPrinter.fromMap(bluetoothPrinter))) + .map((bluetoothPrinter) => + TbBluetoothPrinter._(BluetoothPrinter.fromMap(bluetoothPrinter))) .toList(); return outList; } @@ -764,10 +778,10 @@ class TbPrinter { // Start scanning FlutterBluePlus.startScan( - // Note: For some reason it does not find the printer even though this is the service - //withServices: [Guid("49535343-FE7D-4AE5-8FA9-9FAFD205E455"), - // Guid("F0DD799C-C883-4976-96A5-8BB4907F41D6") - //], + // Note: For some reason it does not find the printer even though this is the service + //withServices: [Guid("49535343-FE7D-4AE5-8FA9-9FAFD205E455"), + // Guid("F0DD799C-C883-4976-96A5-8BB4907F41D6") + //], timeout: Duration(seconds: timeout ~/ 1000)); Set foundDevices = {}; @@ -780,7 +794,8 @@ class TbPrinter { TbBlePrinter found = TbBlePrinter._(foundSt); // For now just filter by device name until we get service working. - if (found.localName.startsWith(_printerInfo.printerModel.getName()) && !foundDevices.contains(found)) { + if (found.localName.startsWith(_printerInfo.printerModel.getName()) && + !foundDevices.contains(found)) { foundDevices.add(found); } } @@ -952,7 +967,7 @@ class TbSensor { int getValue() => _value; static valueFromName(String name) { - for (int i = 0; i < _values.length; i ++ ) { + for (int i = 0; i < _values.length; i++) { if (_values[i].getName() == name) { return _values[i]; } @@ -962,9 +977,7 @@ class TbSensor { } Map toMap() { - return { - "name": _name - }; + return {"name": _name}; } static TbSensor fromMap(Map map) { @@ -1031,9 +1044,7 @@ class TbPrinterStatus { } } -abstract class ATbModel implements AModel { - -} +abstract class ATbModel implements AModel {} class TbModel implements ATbModel { final String _displayName; @@ -1041,7 +1052,7 @@ class TbModel implements ATbModel { const TbModel._internal(this._displayName, this._name); - factory TbModel({required String displayName, String discoveryName = "PS-"}){ + factory TbModel({required String displayName, String discoveryName = "PS-"}) { return TbModel._internal(displayName, discoveryName); } @@ -1082,7 +1093,7 @@ class TbModel implements ATbModel { String getDisplayName() => _displayName; static TbModel valueFromName(String name) { - for (int i =0; i < _values.length; i ++) { + for (int i = 0; i < _values.length; i++) { if (_values[i]._displayName == name) { return _values[i]; } @@ -1094,17 +1105,13 @@ class TbModel implements ATbModel { String getName() { if (Platform.isIOS) { return _displayName; - } - else { + } else { return _name; } } Map toMap() { - return { - "name":_name, - "displayName": _displayName - }; + return {"name": _name, "displayName": _displayName}; } factory TbModel.fromMap(Map map) { @@ -1114,7 +1121,6 @@ class TbModel implements ATbModel { } class BrotherUtils { - /// Utility function for turning a byte array into a UI Image. /// @param imageBytes Byte array of the image. static Future bytesToImage(Uint8List imageBytes) async { @@ -1138,9 +1144,7 @@ class BrotherUtils { } static Future assetFileToPath(String assetKey) async { - String fileName = assetKey - .split("/") - .last; + String fileName = assetKey.split("/").last; // Load byte date from file. ByteData fileData = await PlatformAssetBundle().load(assetKey); // Save to a file. @@ -1152,7 +1156,8 @@ class BrotherUtils { } /// Helper funtion to write a set of bytes to a temp file. - static Future bytesToTempFile(Uint8List bytesToWrite, String fileName) async { + static Future bytesToTempFile( + Uint8List bytesToWrite, String fileName) async { Directory directory = await getTemporaryDirectory(); String dirPath = directory.path; File destFile = File('$dirPath/$fileName'); @@ -1181,8 +1186,7 @@ class BrotherUtils { binLine = ""; } - binLine = - binLine + " " + (bytes[i].toRadixString(16).padLeft(2, '0')); + binLine = binLine + " " + (bytes[i].toRadixString(16).padLeft(2, '0')); } } } @@ -1203,7 +1207,6 @@ class TbBlePrinter implements BLEPrinter, ABrotherTbPrinter { @override Map toMap() => _printer.toMap(); - } class TbBluetoothPrinter implements BluetoothPrinter, ABrotherTbPrinter { @@ -1224,7 +1227,6 @@ class TbBluetoothPrinter implements BluetoothPrinter, ABrotherTbPrinter { } abstract class ATbLabelName extends ALabelName { - int getWidth() => 50; int getHeight() => 50; int getSpeed() => 1; @@ -1235,7 +1237,6 @@ abstract class ATbLabelName extends ALabelName { } class TbLabelName implements ATbLabelName { - static const int _kDefWidth = 50; static const int _kDefHeight = 50; static const int _kDefSpeed = 1; @@ -1253,10 +1254,15 @@ class TbLabelName implements ATbLabelName { final int _sensorDistance; final int _sensorOffset; - const TbLabelName._internal(this._name, - this._width, this._height, - this._speed, this._density, - this._sensor, this._sensorDistance, this._sensorOffset); + const TbLabelName._internal( + this._name, + this._width, + this._height, + this._speed, + this._density, + this._sensor, + this._sensorDistance, + this._sensorOffset); /// Set up the label width, label height, print speed, print density, media sensor type, gap/black /// mark vertical distance, gap/black mark shift distance. @@ -1277,26 +1283,28 @@ class TbLabelName implements ATbLabelName { /// @sensor Media Sensor Type /// @sensorDistance Sensor Distance - Vertical gap height of the gap/black mark in mm /// @sensorOffset Sensor Offset - Shift distance of the gap/black mark in mm. - factory TbLabelName({required String name, int width = _kDefWidth, int height = _kDefHeight, - int speed = _kDefSpeed, int density = _kDefDensity, TbSensor sensor = _kDefSensor, - int sensorDistance = _kDefDistance, - int sensorOffset = _kDefOffset - }) { - return TbLabelName._internal(name, width, height, speed, - density, sensor, sensorDistance, - sensorOffset); + factory TbLabelName( + {required String name, + int width = _kDefWidth, + int height = _kDefHeight, + int speed = _kDefSpeed, + int density = _kDefDensity, + TbSensor sensor = _kDefSensor, + int sensorDistance = _kDefDistance, + int sensorOffset = _kDefOffset}) { + return TbLabelName._internal(name, width, height, speed, density, sensor, + sensorDistance, sensorOffset); } - static const Unsupported = const TbLabelName._internal("UNSUPPORTED", 50, 50, 1, 15, TbSensor.GAP, 0, 0); + static const Unsupported = const TbLabelName._internal( + "UNSUPPORTED", 50, 50, 1, 15, TbSensor.GAP, 0, 0); - static final _values = [ - Unsupported - ]; + static final _values = [Unsupported]; static getValues() => List.of(_values); @override - String getName() =>_name; + String getName() => _name; @override Map toMap() { @@ -1314,15 +1322,14 @@ class TbLabelName implements ATbLabelName { static TbLabelName fromMap(Map map) { return TbLabelName( - name: map["name"], - width: map["width"], - height: map["height"], - speed: map["speed"], - density: map["density"], - sensor: TbSensor.fromMap(map["sensor"]), - sensorDistance: map["sensorDistance"], - sensorOffset: map["sensorOffset"] - ); + name: map["name"], + width: map["width"], + height: map["height"], + speed: map["speed"], + density: map["density"], + sensor: TbSensor.fromMap(map["sensor"]), + sensorDistance: map["sensorDistance"], + sensorOffset: map["sensorOffset"]); } @override @@ -1345,7 +1352,6 @@ class TbLabelName implements ATbLabelName { @override int getSpeed() => _speed; - } /* diff --git a/pubspec.lock b/pubspec.lock index 98bd99e..50c9c79 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -98,50 +98,50 @@ packages: dependency: "direct main" description: name: flutter_blue_plus - sha256: "5fe4395346fa3419cc6044737c409119cf714f60ee098b534b29cf9ab0d8ca90" + sha256: bfcfcd60cd39846d32944f1c1a84f270437ce2d8e7a3e8a1cf8bf9ac9c9a423c url: "https://pub.dev" source: hosted - version: "1.36.0" + version: "2.0.2" flutter_blue_plus_android: dependency: transitive description: name: flutter_blue_plus_android - sha256: "9edba5c955bb9c27ab31305383302fc73f2b29145cf9aac67234c45a919adba6" + sha256: e62c1cfa4da3594cc8360333bc3f9208a84963bfcbae192fb95a61635caf75fe url: "https://pub.dev" source: hosted - version: "6.0.0" + version: "8.0.1" flutter_blue_plus_darwin: dependency: transitive description: name: flutter_blue_plus_darwin - sha256: e32c511900adcb75e48b675ec96f1165ca21c1cf0217d2c4ab90469f784f16ec + sha256: d789861c37aee73101515df99f1d6d162b0ea69a13b961e1b3339f27ea06dcb6 url: "https://pub.dev" source: hosted - version: "6.0.0" + version: "8.0.1" flutter_blue_plus_linux: dependency: transitive description: name: flutter_blue_plus_linux - sha256: "61a84a36ceee719e3c5c0a27151a46acbfebf36232eb24af38bb8d2d71c577d4" + sha256: "1fd456e7f17f6c9e50a2bdfca8bcfd5dfee83e3c0a9fd7d493dd73d4e60b9755" url: "https://pub.dev" source: hosted - version: "6.0.0" + version: "8.0.1" flutter_blue_plus_platform_interface: dependency: transitive description: name: flutter_blue_plus_platform_interface - sha256: "52840efab3c6e5adcd6e5fddeae393d1f7811d14f6361b802e391f8e33a5ee25" + sha256: "8d8440360bed1dce921f3140510c9294ec81d21945c30607afd29bda9a8a87d6" url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "8.0.1" flutter_blue_plus_web: dependency: transitive description: name: flutter_blue_plus_web - sha256: "3e02387d6c922699b4d3d76c18a037c98a20354eea14e9fcb15b9c30716b455d" + sha256: "87d4d63cd06e1e3e9c4b4f5774cea6d2a8516b5693dce0e4dbf7c9d4e63dbcfd" url: "https://pub.dev" source: hosted - version: "6.0.0" + version: "8.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -196,10 +196,10 @@ packages: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" path: dependency: transitive description: @@ -345,10 +345,10 @@ packages: dependency: transitive description: name: test_api - sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 url: "https://pub.dev" source: hosted - version: "0.7.6" + version: "0.7.7" vector_math: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 68db188..826b031 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: sdk: flutter #flutter_blue: ^0.8.0 - flutter_blue_plus: ^1.35.10 #^1.1.3 + flutter_blue_plus: ^2.0.2 path_provider: ^2.1.5 @@ -59,6 +59,7 @@ flutter: - custom_paper/CustomTD2125NWBPaper/ - custom_paper/CustomTD2130NPaper/ - custom_paper/CustomTD2135NWBPaper/ + - custom_paper/CustomTD2350DPaper/ - custom_paper/CustomTD4550Paper/ # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg