From d037e06fbc0baf9ab20b68483376dc8a24bb599b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Mon, 3 Feb 2025 09:44:59 +0100 Subject: [PATCH 01/29] Added support for TD-2350D --- .../CustomTD2350DPaper/TD2350D-51mm_26mm.bin | Bin 0 -> 156 bytes .../CustomTD2350DPaper/TD2350D-57mm.bin | Bin 0 -> 156 bytes .../CustomTD2350DPaper/TD2350D-58mm.bin | Bin 0 -> 156 bytes lib/custom_paper.dart | 733 ++++++++++-------- lib/printer_info.dart | 2 + 5 files changed, 424 insertions(+), 311 deletions(-) create mode 100644 custom_paper/CustomTD2350DPaper/TD2350D-51mm_26mm.bin create mode 100644 custom_paper/CustomTD2350DPaper/TD2350D-57mm.bin create mode 100644 custom_paper/CustomTD2350DPaper/TD2350D-58mm.bin diff --git a/custom_paper/CustomTD2350DPaper/TD2350D-51mm_26mm.bin b/custom_paper/CustomTD2350DPaper/TD2350D-51mm_26mm.bin new file mode 100644 index 0000000000000000000000000000000000000000..254cf3ed7c0c1ba2e59c51dac0356319a3b895c2 GIT binary patch literal 156 zcmb2nOk|YK4D}ZWXL e=7O~u=@}>i`G!CWYRnTLEdgdTf+^|D#Qy-<^AD8( literal 0 HcmV?d00001 diff --git a/custom_paper/CustomTD2350DPaper/TD2350D-57mm.bin b/custom_paper/CustomTD2350DPaper/TD2350D-57mm.bin new file mode 100644 index 0000000000000000000000000000000000000000..0c556ffefd8d107cd361e8d9c9f87716dfed05b4 GIT binary patch literal 156 zcmb2nOk|YK4D}Z2~vn7y3q%#x$0{{ks3hDp= literal 0 HcmV?d00001 diff --git a/custom_paper/CustomTD2350DPaper/TD2350D-58mm.bin b/custom_paper/CustomTD2350DPaper/TD2350D-58mm.bin new file mode 100644 index 0000000000000000000000000000000000000000..b29260cf6cb9aec43b15412da29b6ff005d8db8e GIT binary patch literal 156 zcmb2nOk|YK4D}Z 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/printer_info.dart b/lib/printer_info.dart index f3e6f5b..57f7154 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -187,6 +187,7 @@ 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 = Model._internal2("TD_2350D", 84, RJ_4030); static final UNSUPPORTED = Model._internal("UNSUPPORTED", 255, @@ -276,6 +277,7 @@ class Model implements AModel { TD_2125NWB, TD_2135N, TD_2135NWB, + TD_2350D, UNSUPPORTED ]; From 2f42cec5d74f1ec3bfa6ff43b10f373b2cff1e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Mon, 3 Feb 2025 10:45:24 +0100 Subject: [PATCH 02/29] Added TD-2350D custom paper folder to pubspecs.yaml --- lib/printer_info.dart | 741 ++++++++++++++++++++++-------------------- pubspec.yaml | 1 + 2 files changed, 390 insertions(+), 352 deletions(-) diff --git a/lib/printer_info.dart b/lib/printer_info.dart index 57f7154..ec7db74 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -62,10 +62,7 @@ class PaperSize implements ALabelName { } Map toMap() { - return { - "id": this._id, - "name": this._name - }; + return {"id": this._id, "name": this._name}; } } @@ -168,10 +165,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); @@ -189,7 +184,6 @@ class Model implements AModel { static final TD_2135NWB = Model._internal2("TD_2135NWB", 84, RJ_4030); static final TD_2350D = Model._internal2("TD_2350D", 84, RJ_4030); - static final UNSUPPORTED = Model._internal("UNSUPPORTED", 255, PaperSize.CUSTOM.getPaperId(), PrinterSeries.UNSUPPORTED); @@ -378,10 +372,7 @@ class Model implements AModel { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } static List getValues() => List.of(_values); @@ -478,10 +469,7 @@ class Port { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -521,10 +509,7 @@ class Orientation { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -566,10 +551,7 @@ class PrintMode { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -610,10 +592,7 @@ class Halftone { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -621,11 +600,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]; @@ -654,10 +633,7 @@ class Align { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -698,10 +674,7 @@ class VAlign { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -713,7 +686,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, @@ -746,10 +720,7 @@ class PjRollCase { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -759,10 +730,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, @@ -796,10 +771,7 @@ class PjFeedMode { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -810,7 +782,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]; @@ -840,10 +813,7 @@ class CheckPrintEnd { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -854,63 +824,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, @@ -1025,10 +1038,7 @@ class ErrorCode { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } static List getValues() => List.from(_values); @@ -1170,44 +1180,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"); @@ -1308,10 +1344,7 @@ class PrinterSettingItem { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } @override @@ -1363,10 +1396,7 @@ class PrintQuality { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -1406,10 +1436,7 @@ class PjPaperKind { } Map toMap() { - return { - "id": _id, - "name": _name - }; + return {"id": _id, "name": _name}; } } @@ -1490,8 +1517,7 @@ class PrinterInfo { bool useCopyCommandInTemplatePrint; PrinterInfo( - { - Model? printerModel, + {Model? printerModel, this.port = Port.BLUETOOTH, this.ipAddress = "", this.macAddress = "", @@ -1547,9 +1573,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() { @@ -1705,8 +1732,6 @@ class PrinterInfo { CustomPaperInfo? getCustomPaperInfo() { return this.customPaperInfo; }*/ - - } class BatteryTernary { @@ -1757,7 +1782,6 @@ class BatteryTernary { return Unknown; } - static int ordinalFromID(int id) { for (int i = 0; i < _values.length; ++i) { BatteryTernary num = _values[i]; @@ -1775,10 +1799,7 @@ class BatteryTernary { } Map toMap() { - return { - "id": this._id, - "name": this._name - }; + return {"id": this._id, "name": this._name}; } } @@ -1816,23 +1837,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, @@ -1845,7 +1866,6 @@ class PrinterStatus { String toString() { return toMap().toString(); } - } class TimeoutSetting { @@ -1898,8 +1918,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( @@ -1911,8 +1939,7 @@ class PrinterSpec { yDpi: map["yDpi"], printerCase: map["printerCase"], tubeHeadpin: map["tubeHeadpin"], - modelName:map["modelName"] - ); + modelName: map["modelName"]); } Map toMap() { @@ -1928,7 +1955,6 @@ class PrinterSpec { "modelName": modelName }; } - } class TemplateInfo { @@ -1939,14 +1965,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( @@ -1955,8 +1983,7 @@ class TemplateInfo { checksum: map["checksum"], modifiedDate: map["modifiedDate"], fileName: map["fileName"], - modifiedDateRaw: map["modifiedDateRaw"] - ); + modifiedDateRaw: map["modifiedDateRaw"]); } Map toMap() { @@ -2048,8 +2075,7 @@ class Paper { pinOffsetRight: map["pinOffsetRight"], labelType: map["labelType"], paperName: map["paperName"], - paperNameInch: map["paperNameInch:"] - ); + paperNameInch: map["paperNameInch:"]); } Map toMap() { @@ -2073,6 +2099,7 @@ class Paper { }; } } + class LabelParam { int headPinNum = 0; int labelWidth; @@ -2103,7 +2130,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, @@ -2139,8 +2166,7 @@ class LabelParam { physicalOffsetX: map["physicalOffsetX"], physicalOffsetY: map["physicalOffsetY"], labelType: map["labelType"], - paperID : map["paperID"] - ); + paperID: map["paperID"]); } Map toMap() { @@ -2183,7 +2209,6 @@ class LabelParam { "paperName $paperName, " "paperNameInch $paperNameInch, " "paperID $paperID}"; - } } @@ -2194,7 +2219,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"); @@ -2241,17 +2266,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 { @@ -2267,13 +2288,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() { @@ -2334,7 +2353,6 @@ class NetPrinter implements ABrotherPrinter { @override String getName() => modelName; - } class PaperKind { @@ -2346,11 +2364,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; @@ -2378,7 +2392,6 @@ class PaperKind { String toString() { return toMap().toString(); } - } class Unit { @@ -2388,10 +2401,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; @@ -2449,16 +2459,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) { @@ -2483,7 +2543,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, @@ -2514,14 +2574,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 @@ -2533,11 +2590,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) @@ -2549,16 +2606,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 @@ -2570,15 +2622,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; @@ -2601,8 +2652,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) { @@ -2638,31 +2689,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) { @@ -2671,74 +2722,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 { @@ -2775,11 +2821,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); @@ -2792,11 +2837,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); @@ -2805,23 +2849,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. @@ -2835,18 +2875,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 @@ -2856,25 +2894,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); @@ -2889,19 +2925,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; } @@ -2912,24 +2949,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, @@ -2941,15 +2978,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; } @@ -2958,21 +2995,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); @@ -2981,16 +3018,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"]; @@ -3004,11 +3040,11 @@ class Printer { /// Set PrinterInfo object to specify the printer and print settings. Future setPrinterInfo(PrinterInfo printerInfo) 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; @@ -3016,13 +3052,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; @@ -3034,31 +3070,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"]; @@ -3077,7 +3115,8 @@ class Printer { "printInfo": mPrinterInfo.toMap(), }; - final String systemReport = await _channel.invokeMethod("getSystemReport", params); + final String systemReport = + await _channel.invokeMethod("getSystemReport", params); return systemReport; } @@ -3093,21 +3132,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; @@ -3118,20 +3159,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. @@ -3163,13 +3205,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(), @@ -3177,16 +3217,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(), @@ -3215,46 +3254,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; @@ -3263,7 +3305,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(), @@ -3275,11 +3316,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(), @@ -3287,24 +3326,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 @@ -3317,33 +3356,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; @@ -3352,7 +3393,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(), @@ -3364,7 +3404,6 @@ class Printer { return result; } - /// Cancel printing. Invalid while sending data. Future cancel() async { var params = { @@ -3375,6 +3414,4 @@ class Printer { final bool result = await _channel.invokeMethod("cancel", params); return result; } - } - diff --git a/pubspec.yaml b/pubspec.yaml index e042af9..41e6e7a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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 From 5d1e54885774278551176ed2d5e628a23e3d94f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Mon, 3 Feb 2025 11:46:27 +0100 Subject: [PATCH 03/29] Updated TD-2350D bin files --- .../CustomTD2350DPaper/TD2350D-51mm_26mm.bin | Bin 156 -> 386 bytes .../CustomTD2350DPaper/TD2350D-57mm.bin | Bin 156 -> 386 bytes .../CustomTD2350DPaper/TD2350D-58mm.bin | Bin 156 -> 386 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/custom_paper/CustomTD2350DPaper/TD2350D-51mm_26mm.bin b/custom_paper/CustomTD2350DPaper/TD2350D-51mm_26mm.bin index 254cf3ed7c0c1ba2e59c51dac0356319a3b895c2..68bce8f27b73b3b9acfe837b1b390feb6df603c5 100644 GIT binary patch literal 386 zcmb2n3@vB2=Q5UJFxO?MW1PbP2g?}YOp+L;hPk;46$(aXxw&9{MtTNHK)xZ6f|~OL zNK1g(j9|*1!-|2yN`PSpvW=^dIZ%znP^K18d!dSr^o%TE79;dStcURJIV>3%EJYYL VAltYNnS;j5HY6K?3%EJYYL VAltYNnS;j5HY6K?3%EJYYL VAltYNnS;j5HY6K? Date: Tue, 11 Feb 2025 08:44:05 +0100 Subject: [PATCH 04/29] Updated Brother SDK dependency to version 4.12.0 --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index e4bda1f..8d42190 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' } From 90cce81a74ba3f649602b04ef467571ba2a3f61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Fri, 14 Feb 2025 15:45:47 +0100 Subject: [PATCH 05/29] Removed deprecated Registrar import from AnotherBrotherPlugin.kt --- .../com/rouninlabs/another_brother/AnotherBrotherPlugin.kt | 1 - 1 file changed, 1 deletion(-) 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 2091c16..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 */ From 6572c0db10e57ab26ffb92c3003346cef74a6dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Sat, 15 Mar 2025 15:56:59 +0100 Subject: [PATCH 06/29] Updated TD-2350D model identifier to include dpi --- lib/printer_info.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/printer_info.dart b/lib/printer_info.dart index ec7db74..3b1c5e1 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -182,7 +182,7 @@ 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 = Model._internal2("TD_2350D", 84, RJ_4030); + static final TD_2350D = Model._internal2("TD_2350D_203", 84, RJ_4030); static final UNSUPPORTED = Model._internal("UNSUPPORTED", 255, PaperSize.CUSTOM.getPaperId(), PrinterSeries.UNSUPPORTED); From 21f814e21c747b0aa8553b8bd74f3c922b1db33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Sat, 15 Mar 2025 16:04:35 +0100 Subject: [PATCH 07/29] Updated TD-2350D model identifier to remove unnecessary suffix --- lib/printer_info.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/printer_info.dart b/lib/printer_info.dart index 3b1c5e1..ec7db74 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -182,7 +182,7 @@ 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 = Model._internal2("TD_2350D_203", 84, RJ_4030); + static final TD_2350D = Model._internal2("TD_2350D", 84, RJ_4030); static final UNSUPPORTED = Model._internal("UNSUPPORTED", 255, PaperSize.CUSTOM.getPaperId(), PrinterSeries.UNSUPPORTED); From fdad638c676b9291b68f8b01e6093f30fe2425f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Sat, 15 Mar 2025 17:16:19 +0100 Subject: [PATCH 08/29] Updated TD-2350D model identifier to include dpi --- lib/printer_info.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/printer_info.dart b/lib/printer_info.dart index ec7db74..3b1c5e1 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -182,7 +182,7 @@ 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 = Model._internal2("TD_2350D", 84, RJ_4030); + static final TD_2350D = Model._internal2("TD_2350D_203", 84, RJ_4030); static final UNSUPPORTED = Model._internal("UNSUPPORTED", 255, PaperSize.CUSTOM.getPaperId(), PrinterSeries.UNSUPPORTED); From 821dd0076ec2bcbd2827f7df7464bc3e530989f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Sat, 15 Mar 2025 17:19:19 +0100 Subject: [PATCH 09/29] Updated TD-2350D model identifier to correct version number --- lib/printer_info.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/printer_info.dart b/lib/printer_info.dart index 3b1c5e1..4ac50f6 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -182,7 +182,7 @@ 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 = Model._internal2("TD_2350D_203", 84, RJ_4030); + static final TD_2350D = Model._internal2("TD_2350D_203", 85, RJ_4030); static final UNSUPPORTED = Model._internal("UNSUPPORTED", 255, PaperSize.CUSTOM.getPaperId(), PrinterSeries.UNSUPPORTED); From 8219f680e322761025c735a05db24199434ffb75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Sat, 15 Mar 2025 17:21:15 +0100 Subject: [PATCH 10/29] Updated TD-2350D model identifier to remove dpi suffix --- lib/printer_info.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/printer_info.dart b/lib/printer_info.dart index 4ac50f6..3c7f2c6 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -182,7 +182,7 @@ 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 = Model._internal2("TD_2350D_203", 85, RJ_4030); + static final TD_2350D = Model._internal2("TD_2350D", 85, RJ_4030); static final UNSUPPORTED = Model._internal("UNSUPPORTED", 255, PaperSize.CUSTOM.getPaperId(), PrinterSeries.UNSUPPORTED); From d85b2adf9087c6b3ffc0aa7adb42f8c19fc76211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Sat, 15 Mar 2025 17:48:26 +0100 Subject: [PATCH 11/29] Updated TD-2350D model identifier to include dpi --- lib/printer_info.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/printer_info.dart b/lib/printer_info.dart index 3c7f2c6..220459c 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -182,7 +182,7 @@ 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 = Model._internal2("TD_2350D", 85, RJ_4030); + static final TD_2350D = Model._internal2("TD_2350DF_203", 85, RJ_4030); static final UNSUPPORTED = Model._internal("UNSUPPORTED", 255, PaperSize.CUSTOM.getPaperId(), PrinterSeries.UNSUPPORTED); From 71b09fc217355c764851b13ee883d74632c482bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Sat, 15 Mar 2025 17:54:00 +0100 Subject: [PATCH 12/29] Updated TD-2350D model identifier to include dpi --- lib/printer_info.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/printer_info.dart b/lib/printer_info.dart index 220459c..4ac50f6 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -182,7 +182,7 @@ 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 = Model._internal2("TD_2350DF_203", 85, RJ_4030); + static final TD_2350D = Model._internal2("TD_2350D_203", 85, RJ_4030); static final UNSUPPORTED = Model._internal("UNSUPPORTED", 255, PaperSize.CUSTOM.getPaperId(), PrinterSeries.UNSUPPORTED); From cd99001f405699814c0f5c3de15c25fce740ca03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Sat, 15 Mar 2025 18:08:19 +0100 Subject: [PATCH 13/29] Updated TD-2350D model identifier to TD-2350D203 and added new bin files for 51mm, 57mm, and 58mm sizes --- .../TD2350D203-51mm_26mm.bin | Bin 0 -> 156 bytes .../CustomTD2350D203Paper/TD2350D203-57mm.bin | Bin 0 -> 156 bytes .../CustomTD2350D203Paper/TD2350D203-58mm.bin | Bin 0 -> 156 bytes .../CustomTD2350DPaper/TD2350D-51mm_26mm.bin | Bin 386 -> 0 bytes .../CustomTD2350DPaper/TD2350D-57mm.bin | Bin 386 -> 0 bytes .../CustomTD2350DPaper/TD2350D-58mm.bin | Bin 386 -> 0 bytes lib/custom_paper.dart | 24 +++++++++--------- lib/printer_info.dart | 4 +-- 8 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 custom_paper/CustomTD2350D203Paper/TD2350D203-51mm_26mm.bin create mode 100644 custom_paper/CustomTD2350D203Paper/TD2350D203-57mm.bin create mode 100644 custom_paper/CustomTD2350D203Paper/TD2350D203-58mm.bin delete mode 100644 custom_paper/CustomTD2350DPaper/TD2350D-51mm_26mm.bin delete mode 100644 custom_paper/CustomTD2350DPaper/TD2350D-57mm.bin delete mode 100644 custom_paper/CustomTD2350DPaper/TD2350D-58mm.bin diff --git a/custom_paper/CustomTD2350D203Paper/TD2350D203-51mm_26mm.bin b/custom_paper/CustomTD2350D203Paper/TD2350D203-51mm_26mm.bin new file mode 100644 index 0000000000000000000000000000000000000000..254cf3ed7c0c1ba2e59c51dac0356319a3b895c2 GIT binary patch literal 156 zcmb2nOk|YK4D}ZWXL e=7O~u=@}>i`G!CWYRnTLEdgdTf+^|D#Qy-<^AD8( literal 0 HcmV?d00001 diff --git a/custom_paper/CustomTD2350D203Paper/TD2350D203-57mm.bin b/custom_paper/CustomTD2350D203Paper/TD2350D203-57mm.bin new file mode 100644 index 0000000000000000000000000000000000000000..0c556ffefd8d107cd361e8d9c9f87716dfed05b4 GIT binary patch literal 156 zcmb2nOk|YK4D}Z2~vn7y3q%#x$0{{ks3hDp= literal 0 HcmV?d00001 diff --git a/custom_paper/CustomTD2350D203Paper/TD2350D203-58mm.bin b/custom_paper/CustomTD2350D203Paper/TD2350D203-58mm.bin new file mode 100644 index 0000000000000000000000000000000000000000..b29260cf6cb9aec43b15412da29b6ff005d8db8e GIT binary patch literal 156 zcmb2nOk|YK4D}Z3%EJYYL VAltYNnS;j5HY6K?3%EJYYL VAltYNnS;j5HY6K?3%EJYYL VAltYNnS;j5HY6K? getValues() => List.from(_values); + static List getValues() => List.from(_values); @override String getName() { return _name; } - static BinPaper_TD2350D valueFromName(String name) { + static BinPaper_TD2350D203 valueFromName(String name) { for (int i = 0; i < _values.length; i++) { if (_values[i].getName() == name) { return _values[i]; diff --git a/lib/printer_info.dart b/lib/printer_info.dart index 4ac50f6..1f401c0 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -182,7 +182,7 @@ 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 = Model._internal2("TD_2350D_203", 85, RJ_4030); + static final TD_2350D203 = Model._internal2("TD_2350D_203", 85, RJ_4030); static final UNSUPPORTED = Model._internal("UNSUPPORTED", 255, PaperSize.CUSTOM.getPaperId(), PrinterSeries.UNSUPPORTED); @@ -271,7 +271,7 @@ class Model implements AModel { TD_2125NWB, TD_2135N, TD_2135NWB, - TD_2350D, + TD_2350D203, UNSUPPORTED ]; From a5dbfab0134e61e69a312df433543cfc870e78fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Sat, 15 Mar 2025 18:13:39 +0100 Subject: [PATCH 14/29] Updated CustomTD2350DPaper reference to CustomTD2350D203Paper --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 41e6e7a..c6b8bc1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -59,7 +59,7 @@ flutter: - custom_paper/CustomTD2125NWBPaper/ - custom_paper/CustomTD2130NPaper/ - custom_paper/CustomTD2135NWBPaper/ - - custom_paper/CustomTD2350DPaper/ + - custom_paper/CustomTD2350D203Paper/ - custom_paper/CustomTD4550Paper/ # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg From ee5a69d96a536d5c0c87424d6571e5e701868bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Sat, 15 Mar 2025 18:47:48 +0100 Subject: [PATCH 15/29] Refactored TD-2350D class and updated references to remove the '203' suffix --- .../TD2350D-51mm_26mm.bin} | Bin .../TD2350D-57mm.bin} | Bin .../TD2350D-58mm.bin} | Bin lib/custom_paper.dart | 22 +++++++++--------- lib/printer_info.dart | 4 ++-- pubspec.yaml | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) rename custom_paper/{CustomTD2350D203Paper/TD2350D203-51mm_26mm.bin => CustomTD2350DPaper/TD2350D-51mm_26mm.bin} (100%) rename custom_paper/{CustomTD2350D203Paper/TD2350D203-57mm.bin => CustomTD2350DPaper/TD2350D-57mm.bin} (100%) rename custom_paper/{CustomTD2350D203Paper/TD2350D203-58mm.bin => CustomTD2350DPaper/TD2350D-58mm.bin} (100%) diff --git a/custom_paper/CustomTD2350D203Paper/TD2350D203-51mm_26mm.bin b/custom_paper/CustomTD2350DPaper/TD2350D-51mm_26mm.bin similarity index 100% rename from custom_paper/CustomTD2350D203Paper/TD2350D203-51mm_26mm.bin rename to custom_paper/CustomTD2350DPaper/TD2350D-51mm_26mm.bin diff --git a/custom_paper/CustomTD2350D203Paper/TD2350D203-57mm.bin b/custom_paper/CustomTD2350DPaper/TD2350D-57mm.bin similarity index 100% rename from custom_paper/CustomTD2350D203Paper/TD2350D203-57mm.bin rename to custom_paper/CustomTD2350DPaper/TD2350D-57mm.bin diff --git a/custom_paper/CustomTD2350D203Paper/TD2350D203-58mm.bin b/custom_paper/CustomTD2350DPaper/TD2350D-58mm.bin similarity index 100% rename from custom_paper/CustomTD2350D203Paper/TD2350D203-58mm.bin rename to custom_paper/CustomTD2350DPaper/TD2350D-58mm.bin diff --git a/lib/custom_paper.dart b/lib/custom_paper.dart index ef370c4..27cabf9 100644 --- a/lib/custom_paper.dart +++ b/lib/custom_paper.dart @@ -1019,34 +1019,34 @@ class BinPaper_TD2135NWB implements ACustomPaper { } } -class BinPaper_TD2350D203 implements ACustomPaper { +class BinPaper_TD2350D implements ACustomPaper { final String _name; final String _assetPath; static const String _rootDir = "packages/another_brother/custom_paper/CustomTD2350D203Paper"; - const BinPaper_TD2350D203._internal(this._name, this._assetPath); + const BinPaper_TD2350D._internal(this._name, this._assetPath); - static const W51_H26mm = const BinPaper_TD2350D203._internal( - "TD2350D203-51mm_26mm", "$_rootDir/TD2350D203-51mm_26mm.bin"); - static const W58mm = const BinPaper_TD2350D203._internal( - "TD2350D203-58mm", "$_rootDir/TD2350D203-58mm.bin"); - static const W57mm = const BinPaper_TD2350D203._internal( - "TD2350D203-57mm", "$_rootDir/TD2350D203-57mm.bin"); + 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_TD2350D203._internal("UNSUPPORTED", ""); + const BinPaper_TD2350D._internal("UNSUPPORTED", ""); static final _values = [W51_H26mm, W58mm, W57mm, UNSUPPORTED]; - static List getValues() => List.from(_values); + static List getValues() => List.from(_values); @override String getName() { return _name; } - static BinPaper_TD2350D203 valueFromName(String name) { + static BinPaper_TD2350D valueFromName(String name) { for (int i = 0; i < _values.length; i++) { if (_values[i].getName() == name) { return _values[i]; diff --git a/lib/printer_info.dart b/lib/printer_info.dart index 1f401c0..3c7f2c6 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -182,7 +182,7 @@ 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_2350D203 = Model._internal2("TD_2350D_203", 85, RJ_4030); + static final TD_2350D = Model._internal2("TD_2350D", 85, RJ_4030); static final UNSUPPORTED = Model._internal("UNSUPPORTED", 255, PaperSize.CUSTOM.getPaperId(), PrinterSeries.UNSUPPORTED); @@ -271,7 +271,7 @@ class Model implements AModel { TD_2125NWB, TD_2135N, TD_2135NWB, - TD_2350D203, + TD_2350D, UNSUPPORTED ]; diff --git a/pubspec.yaml b/pubspec.yaml index c6b8bc1..41e6e7a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -59,7 +59,7 @@ flutter: - custom_paper/CustomTD2125NWBPaper/ - custom_paper/CustomTD2130NPaper/ - custom_paper/CustomTD2135NWBPaper/ - - custom_paper/CustomTD2350D203Paper/ + - custom_paper/CustomTD2350DPaper/ - custom_paper/CustomTD4550Paper/ # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg From 8e411e1b5cbebe69fac1edf281b914625556b6d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Sat, 15 Mar 2025 20:05:15 +0100 Subject: [PATCH 16/29] Added logging for model ID retrieval and updated setPrinterInfo method to accept optional dpi parameter --- .../com/rouninlabs/another_brother/method/BrotherUtils.kt | 6 ++++-- lib/printer_info.dart | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) 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..a1dbc3d 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,10 @@ 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 + Log.d(TAG, "Model id : $id") + Log.e(TAG, "All models : ${PrinterInfo.Model.values().joinToString(",") { it.name }}") + return PrinterInfo.Model.valueFromID(id) } fun TimeoutSettingFromMap(map: Map): TimeoutSetting { diff --git a/lib/printer_info.dart b/lib/printer_info.dart index 3c7f2c6..1b6126b 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -1516,6 +1516,8 @@ class PrinterInfo { bool banishMargin; bool useCopyCommandInTemplatePrint; + int? dpi; + PrinterInfo( {Model? printerModel, this.port = Port.BLUETOOTH, @@ -3038,7 +3040,7 @@ 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); From 45917c9aac60e6549ed4320174d5919b68d65132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Mon, 17 Mar 2025 10:34:29 +0100 Subject: [PATCH 17/29] Added TD-2350D_203 model identifier to printer_info.dart --- lib/printer_info.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/printer_info.dart b/lib/printer_info.dart index 1b6126b..5ae9f47 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -183,6 +183,7 @@ class Model implements AModel { 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 = Model._internal2("TD_2350D", 85, RJ_4030); + static final TD_2350D_203 = Model._internal2("TD_2350D_203", 86, RJ_4030); static final UNSUPPORTED = Model._internal("UNSUPPORTED", 255, PaperSize.CUSTOM.getPaperId(), PrinterSeries.UNSUPPORTED); @@ -272,6 +273,7 @@ class Model implements AModel { TD_2135N, TD_2135NWB, TD_2350D, + TD_2350D_203, UNSUPPORTED ]; From 9828da3e531de083e01fad42cde88d94d96612b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Mon, 17 Mar 2025 10:39:58 +0100 Subject: [PATCH 18/29] Added logging for model retrieval in BrotherUtils.kt to enhance debugging --- .../com/rouninlabs/another_brother/method/BrotherUtils.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 a1dbc3d..45745b8 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 @@ -138,7 +138,9 @@ fun modelFromMap(map: Map): PrinterInfo.Model { val id: Int = map["id"] as Int Log.d(TAG, "Model id : $id") Log.e(TAG, "All models : ${PrinterInfo.Model.values().joinToString(",") { it.name }}") - return PrinterInfo.Model.valueFromID(id) + val model = PrinterInfo.Model.valueFromID(id) + Log.d(TAG, "Model : $model") + return model } fun TimeoutSettingFromMap(map: Map): TimeoutSetting { From 5238352735887f657f06670438ae7f1e0b384e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Mon, 17 Mar 2025 10:44:24 +0100 Subject: [PATCH 19/29] Enhanced model retrieval logging in BrotherUtils.kt for improved debugging --- .../another_brother/method/BrotherUtils.kt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 45745b8..bfa33e1 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 @@ -137,10 +137,15 @@ fun paperKindFromMap(map:Map):PaperKind { fun modelFromMap(map: Map): PrinterInfo.Model { val id: Int = map["id"] as Int Log.d(TAG, "Model id : $id") - Log.e(TAG, "All models : ${PrinterInfo.Model.values().joinToString(",") { it.name }}") - val model = PrinterInfo.Model.valueFromID(id) - Log.d(TAG, "Model : $model") - return model + for (model in PrinterInfo.Model.values()) { + Log.d(TAG, "Model : $model") + Log.d(TAG, "Model id : ${model.id}") + if (model.id == id) { + Log.d(TAG, "Model found : $model") + return model + } + } + return PrinterInfo.Model.valueFromID(id) } fun TimeoutSettingFromMap(map: Map): TimeoutSetting { From 40eb54426998fa0a9856d142f4185007f2882c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Mon, 17 Mar 2025 10:49:36 +0100 Subject: [PATCH 20/29] Added detailed logging for model ID iteration in modelFromMap function for enhanced debugging --- .../com/rouninlabs/another_brother/method/BrotherUtils.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 bfa33e1..804717f 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 @@ -137,14 +137,17 @@ fun paperKindFromMap(map:Map):PaperKind { fun modelFromMap(map: Map): PrinterInfo.Model { val id: Int = map["id"] as Int Log.d(TAG, "Model id : $id") - for (model in PrinterInfo.Model.values()) { + + for (i in 0..255) { + Log.d(TAG, "Model id : $i") + val model = PrinterInfo.Model.valueFromID(i) Log.d(TAG, "Model : $model") - Log.d(TAG, "Model id : ${model.id}") if (model.id == id) { Log.d(TAG, "Model found : $model") return model } } + return PrinterInfo.Model.valueFromID(id) } From d2ae20591b65a5431865e30af476a9d218fcb2e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Mon, 17 Mar 2025 10:50:27 +0100 Subject: [PATCH 21/29] Removed redundant logging for model retrieval in BrotherUtils.kt to streamline code --- .../com/rouninlabs/another_brother/method/BrotherUtils.kt | 4 ---- 1 file changed, 4 deletions(-) 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 804717f..3a0b625 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 @@ -142,10 +142,6 @@ fun modelFromMap(map: Map): PrinterInfo.Model { Log.d(TAG, "Model id : $i") val model = PrinterInfo.Model.valueFromID(i) Log.d(TAG, "Model : $model") - if (model.id == id) { - Log.d(TAG, "Model found : $model") - return model - } } return PrinterInfo.Model.valueFromID(id) From c4319172a06f86bc85096dd3a6b661d47000e1e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Mon, 17 Mar 2025 10:53:38 +0100 Subject: [PATCH 22/29] Updated model identifier for TD-2350D in printer_info.dart and adjusted asset path in custom_paper.dart --- lib/custom_paper.dart | 2 +- lib/printer_info.dart | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/custom_paper.dart b/lib/custom_paper.dart index 27cabf9..19f980a 100644 --- a/lib/custom_paper.dart +++ b/lib/custom_paper.dart @@ -1024,7 +1024,7 @@ class BinPaper_TD2350D implements ACustomPaper { final String _assetPath; static const String _rootDir = - "packages/another_brother/custom_paper/CustomTD2350D203Paper"; + "packages/another_brother/custom_paper/CustomTD2350DPaper"; const BinPaper_TD2350D._internal(this._name, this._assetPath); static const W51_H26mm = const BinPaper_TD2350D._internal( diff --git a/lib/printer_info.dart b/lib/printer_info.dart index 5ae9f47..2460467 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -182,8 +182,7 @@ 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 = Model._internal2("TD_2350D", 85, RJ_4030); - static final TD_2350D_203 = Model._internal2("TD_2350D_203", 86, RJ_4030); + static final TD_2350D_203 = Model._internal2("TD_2350D_203", 89, RJ_4030); static final UNSUPPORTED = Model._internal("UNSUPPORTED", 255, PaperSize.CUSTOM.getPaperId(), PrinterSeries.UNSUPPORTED); @@ -272,7 +271,6 @@ class Model implements AModel { TD_2125NWB, TD_2135N, TD_2135NWB, - TD_2350D, TD_2350D_203, UNSUPPORTED ]; From a9eb51658e0bd1ed279b13edc00aeeff5e33eda6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Mon, 17 Mar 2025 11:00:44 +0100 Subject: [PATCH 23/29] Updated model identifier for TD-2350D_203 in printer_info.dart --- lib/printer_info.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/printer_info.dart b/lib/printer_info.dart index 2460467..7dfd242 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -182,7 +182,7 @@ 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_203", 89, RJ_4030); + static final TD_2350D_203 = Model._internal2("TD_2350D_203", 97, RJ_4030); static final UNSUPPORTED = Model._internal("UNSUPPORTED", 255, PaperSize.CUSTOM.getPaperId(), PrinterSeries.UNSUPPORTED); From 9b693bd353a6752d1604f5a68824c34c2b881c35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Mon, 17 Mar 2025 11:07:13 +0100 Subject: [PATCH 24/29] Updated model identifier for TD-2350D and added new model TD-2350D_300 in printer_info.dart; removed redundant logging in modelFromMap function in BrotherUtils.kt --- .../rouninlabs/another_brother/method/BrotherUtils.kt | 9 --------- lib/printer_info.dart | 4 +++- 2 files changed, 3 insertions(+), 10 deletions(-) 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 3a0b625..7285059 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,15 +135,6 @@ fun paperKindFromMap(map:Map):PaperKind { return PaperKind.valueOf(name) } fun modelFromMap(map: Map): PrinterInfo.Model { - val id: Int = map["id"] as Int - Log.d(TAG, "Model id : $id") - - for (i in 0..255) { - Log.d(TAG, "Model id : $i") - val model = PrinterInfo.Model.valueFromID(i) - Log.d(TAG, "Model : $model") - } - return PrinterInfo.Model.valueFromID(id) } diff --git a/lib/printer_info.dart b/lib/printer_info.dart index 7dfd242..40a3e57 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -182,7 +182,8 @@ 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_203", 97, 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 UNSUPPORTED = Model._internal("UNSUPPORTED", 255, PaperSize.CUSTOM.getPaperId(), PrinterSeries.UNSUPPORTED); @@ -272,6 +273,7 @@ class Model implements AModel { TD_2135N, TD_2135NWB, TD_2350D_203, + TD_2350D_300, UNSUPPORTED ]; From f25e37760c4990dbaf1445ff7b1d1ed54a0023ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Mon, 17 Mar 2025 11:08:57 +0100 Subject: [PATCH 25/29] Added model ID extraction in modelFromMap function in BrotherUtils.kt --- .../kotlin/com/rouninlabs/another_brother/method/BrotherUtils.kt | 1 + 1 file changed, 1 insertion(+) 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 7285059..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,6 +135,7 @@ 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) } From 7929b13220d03202031b25ed7418af83e82e0a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= <34269530+PrimaelQuemerais@users.noreply.github.com> Date: Fri, 28 Mar 2025 18:35:04 +0100 Subject: [PATCH 26/29] Updated printer identifiers for TD-2350D series in printer_info.dart; corrected label ID comment in label_info.dart; removed unused imports in type_b_commands.dart and type_b_printer.dart --- lib/label_info.dart | 2 +- lib/printer_info.dart | 15 +++++++++++++-- lib/type_b_commands.dart | 3 --- lib/type_b_printer.dart | 5 +---- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/label_info.dart b/lib/label_info.dart index 5b08b76..54eedc4 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 40a3e57..d38c929 100644 --- a/lib/printer_info.dart +++ b/lib/printer_info.dart @@ -1,5 +1,4 @@ import 'dart:io'; -import 'dart:typed_data'; import 'dart:ui'; import 'dart:async'; @@ -184,6 +183,12 @@ class Model implements AModel { 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); @@ -274,6 +279,12 @@ class Model implements AModel { 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 ]; @@ -3353,7 +3364,7 @@ class Printer { // Listen to scan results var subscription = FlutterBluePlus.scanResults.listen((results) { for (ScanResult r in results) { - BLEPrinter found = BLEPrinter(localName: r.device.name); + BLEPrinter found = BLEPrinter(localName: r.device.localName); if (!foundDevices.contains(found)) { foundDevices.add(found); } diff --git a/lib/type_b_commands.dart b/lib/type_b_commands.dart index 52d3c18..645ce8f 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 655793c..63bd7fa 100644 --- a/lib/type_b_printer.dart +++ b/lib/type_b_printer.dart @@ -1,13 +1,10 @@ import 'dart:async'; -import 'dart:ffi'; import 'dart:io'; -import 'dart:math'; import 'dart:typed_data'; import 'dart:ui'; import 'package:another_brother/printer_info.dart'; import 'package:another_brother/type_b_commands.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter_blue_plus/flutter_blue_plus.dart'; import 'package:path_provider/path_provider.dart'; @@ -778,7 +775,7 @@ class TbPrinter { for (ScanResult r in results) { print("Scan Result: ${r.device}"); - BLEPrinter foundSt = BLEPrinter(localName: r.device.name); + BLEPrinter foundSt = BLEPrinter(localName: r.device.localName); TbBlePrinter found = TbBlePrinter._(foundSt); // For now just filter by device name until we get service working. From 7d11d0fa15ac49e94947f18925810e21ea41ab2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= Date: Mon, 8 Dec 2025 15:10:00 +0100 Subject: [PATCH 27/29] Updated dependencies --- pubspec.lock | 163 +++++++++++++++++++++++++++++++++++++++++---------- pubspec.yaml | 2 +- 2 files changed, 133 insertions(+), 32 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index ceaa866..022f3a1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,14 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" async: dependency: transitive description: @@ -9,6 +17,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.11.0" + bluez: + dependency: transitive + description: + name: bluez + sha256: "61a7204381925896a374301498f2f5399e59827c6498ae1e924aaa598751b545" + url: "https://pub.dev" + source: hosted + version: "0.8.3" boolean_selector: dependency: transitive description: @@ -21,34 +37,42 @@ packages: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" clock: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" collection: dependency: transitive description: name: collection - sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.19.0" + version: "1.19.1" + dbus: + dependency: transitive + description: + name: dbus + sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" + url: "https://pub.dev" + source: hosted + version: "0.7.11" fake_async: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.3" ffi: dependency: transitive description: @@ -74,47 +98,92 @@ packages: dependency: "direct main" description: name: flutter_blue_plus - sha256: "810351799eaf51c08152737615c345e9eb83e13b20adcd91ec0c78cd59dc260d" + sha256: bfcfcd60cd39846d32944f1c1a84f270437ce2d8e7a3e8a1cf8bf9ac9c9a423c + url: "https://pub.dev" + source: hosted + version: "2.0.2" + flutter_blue_plus_android: + dependency: transitive + description: + name: flutter_blue_plus_android + sha256: e62c1cfa4da3594cc8360333bc3f9208a84963bfcbae192fb95a61635caf75fe + url: "https://pub.dev" + source: hosted + version: "8.0.1" + flutter_blue_plus_darwin: + dependency: transitive + description: + name: flutter_blue_plus_darwin + sha256: d789861c37aee73101515df99f1d6d162b0ea69a13b961e1b3339f27ea06dcb6 + url: "https://pub.dev" + source: hosted + version: "8.0.1" + flutter_blue_plus_linux: + dependency: transitive + description: + name: flutter_blue_plus_linux + sha256: "1fd456e7f17f6c9e50a2bdfca8bcfd5dfee83e3c0a9fd7d493dd73d4e60b9755" + url: "https://pub.dev" + source: hosted + version: "8.0.1" + flutter_blue_plus_platform_interface: + dependency: transitive + description: + name: flutter_blue_plus_platform_interface + sha256: "8d8440360bed1dce921f3140510c9294ec81d21945c30607afd29bda9a8a87d6" + url: "https://pub.dev" + source: hosted + version: "8.0.1" + flutter_blue_plus_web: + dependency: transitive + description: + name: flutter_blue_plus_web + sha256: "87d4d63cd06e1e3e9c4b4f5774cea6d2a8516b5693dce0e4dbf7c9d4e63dbcfd" url: "https://pub.dev" source: hosted - version: "1.12.13" + version: "8.0.1" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" leak_tracker: dependency: transitive description: name: leak_tracker - sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.7" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.8" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" matcher: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.17" material_color_utilities: dependency: transitive description: @@ -127,18 +196,18 @@ packages: dependency: transitive description: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.17.0" path: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" path_provider: dependency: "direct main" description: @@ -187,6 +256,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "1a97266a94f7350d30ae522c0af07890c70b8e62c71e8e3920d1db4d23c057d1" + url: "https://pub.dev" + source: hosted + version: "7.0.1" platform: dependency: transitive description: @@ -211,6 +288,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.2.4" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" sky_engine: dependency: transitive description: flutter @@ -228,18 +313,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.12.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" string_scanner: dependency: transitive description: @@ -260,18 +345,18 @@ packages: dependency: transitive description: name: test_api - sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 url: "https://pub.dev" source: hosted - version: "0.7.3" + version: "0.7.7" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: @@ -280,6 +365,14 @@ packages: url: "https://pub.dev" source: hosted version: "14.3.0" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" xdg_directories: dependency: transitive description: @@ -288,6 +381,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.2.0+1" + xml: + dependency: transitive + description: + name: xml + sha256: "971043b3a0d3da28727e40ed3e0b5d18b742fa5a68665cca88e74b7876d5e025" + url: "https://pub.dev" + source: hosted + version: "6.6.1" sdks: - dart: ">=3.5.0 <4.0.0" + dart: ">=3.8.0 <4.0.0" flutter: ">=3.24.0" diff --git a/pubspec.yaml b/pubspec.yaml index 41e6e7a..903c91a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: sdk: flutter #flutter_blue: ^0.8.0 - flutter_blue_plus: ^1.12.13 #^1.1.3 + flutter_blue_plus: ^2.0.2 path_provider: ^2.1.5 From dc3189cc146f0b668d4a6dfb6f544cc4890265e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= Date: Mon, 8 Dec 2025 15:15:14 +0100 Subject: [PATCH 28/29] Refactor code style for consistency and readability in type_b_printer.dart --- lib/type_b_printer.dart | 229 +++++++++++++++++++++------------------- 1 file changed, 118 insertions(+), 111 deletions(-) diff --git a/lib/type_b_printer.dart b/lib/type_b_printer.dart index 2f35c3d..c41ef68 100644 --- a/lib/type_b_printer.dart +++ b/lib/type_b_printer.dart @@ -5,6 +5,7 @@ import 'dart:ui'; import 'package:another_brother/printer_info.dart'; import 'package:another_brother/type_b_commands.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter_blue_plus/flutter_blue_plus.dart'; import 'package:path_provider/path_provider.dart'; @@ -29,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, @@ -52,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"])); } } @@ -83,7 +83,6 @@ class TbPrinter { return resolution / dots * _MM_IN_INCHE; } - TbPrinter({TbPrinterInfo? printerInfo}) { if (printerInfo != null) { this._printerInfo = printerInfo; @@ -322,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 = @@ -423,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, @@ -450,11 +449,9 @@ class TbPrinter { outImageBytes); //sendCommand(String.fromCharCodes(outImageBytes)); result = result && await sendCommand("\"\r\n"); - return result; //return bmpImage; //return grayPicture; - } } @@ -463,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 @@ -495,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()); @@ -506,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()); @@ -559,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]); @@ -570,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. @@ -750,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; } @@ -763,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 = {}; @@ -779,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); } } @@ -951,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]; } @@ -961,9 +977,7 @@ class TbSensor { } Map toMap() { - return { - "name": _name - }; + return {"name": _name}; } static TbSensor fromMap(Map map) { @@ -1030,9 +1044,7 @@ class TbPrinterStatus { } } -abstract class ATbModel implements AModel { - -} +abstract class ATbModel implements AModel {} class TbModel implements ATbModel { final String _displayName; @@ -1040,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); } @@ -1081,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]; } @@ -1093,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) { @@ -1113,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 { @@ -1137,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. @@ -1151,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'); @@ -1180,8 +1186,7 @@ class BrotherUtils { binLine = ""; } - binLine = - binLine + " " + (bytes[i].toRadixString(16).padLeft(2, '0')); + binLine = binLine + " " + (bytes[i].toRadixString(16).padLeft(2, '0')); } } } @@ -1202,7 +1207,6 @@ class TbBlePrinter implements BLEPrinter, ABrotherTbPrinter { @override Map toMap() => _printer.toMap(); - } class TbBluetoothPrinter implements BluetoothPrinter, ABrotherTbPrinter { @@ -1223,7 +1227,6 @@ class TbBluetoothPrinter implements BluetoothPrinter, ABrotherTbPrinter { } abstract class ATbLabelName extends ALabelName { - int getWidth() => 50; int getHeight() => 50; int getSpeed() => 1; @@ -1234,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; @@ -1252,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. @@ -1276,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() { @@ -1313,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 @@ -1344,7 +1352,6 @@ class TbLabelName implements ATbLabelName { @override int getSpeed() => _speed; - } /* From 13f22a152515353094567832fd8f629455c9b45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Prima=C3=ABl=20Qu=C3=A9merais?= Date: Mon, 8 Dec 2025 15:45:20 +0100 Subject: [PATCH 29/29] Remove obsolete binary files and add new custom paper specifications for 40mm and 57mm formats --- ...D2135NWB-RD40x40mm.bin => TD2135NWB-40x40mm.bin} | Bin .../{TD2135NWB-RD57mm.bin => TD2135NWB-57mm.bin} | Bin 2 files changed, 0 insertions(+), 0 deletions(-) rename custom_paper/CustomTD2135NWBPaper/{TD2135NWB-RD40x40mm.bin => TD2135NWB-40x40mm.bin} (100%) rename custom_paper/CustomTD2135NWBPaper/{TD2135NWB-RD57mm.bin => TD2135NWB-57mm.bin} (100%) 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