-
Notifications
You must be signed in to change notification settings - Fork 29
Adding support for TD-2350D printers #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…les for 51mm, 57mm, and 58mm sizes
…d to accept optional dpi parameter
…n for enhanced debugging
…ed asset path in custom_paper.dart
…0 in printer_info.dart; removed redundant logging in modelFromMap function in BrotherUtils.kt
… corrected label ID comment in label_info.dart; removed unused imports in type_b_commands.dart and type_b_printer.dart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds support for TD-2350D printer models (including 203 and 300 DPI variants) with custom paper type definitions, updates the Brother SDK from version 4.6.1 to 4.12.0, and performs code cleanup including removal of unused imports, semicolons, and formatting improvements. The PR also updates the flutter_blue_plus dependency to version 2.0.2, adapting to breaking API changes (device.name → device.localName).
Key changes:
- Added 8 TD-2350D printer model variants (203/300 DPI with different feature sets: standard, DF, DSA, DFSA)
- Introduced BinPaper_TD2350D custom paper class with 3 paper sizes
- Updated Brother printer SDK dependency to 4.12.0
- Migrated to flutter_blue_plus 2.0.2 with API compatibility updates
Reviewed changes
Copilot reviewed 9 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
pubspec.yaml |
Updated flutter_blue_plus dependency to ^2.0.2 and added CustomTD2350DPaper asset directory |
pubspec.lock |
Auto-generated dependency lock file reflecting flutter_blue_plus 2.0.2 upgrade and transitive dependencies |
lib/printer_info.dart |
Added 8 TD-2350D model variants, added dpi field to PrinterInfo, extensive code formatting improvements |
lib/type_b_printer.dart |
Updated BLE device name access from device.name to device.localName for flutter_blue_plus 2.0 compatibility |
lib/type_b_commands.dart |
Removed unused imports (dart:typed_data, flutter/services.dart) |
lib/label_info.dart |
Fixed typo in comment: "labal" → "label" |
lib/custom_paper.dart |
Added BinPaper_TD2350D class with 3 paper size configurations, extensive formatting improvements |
custom_paper/CustomTD2350DPaper/*.bin |
Added 3 binary paper configuration files for TD-2350D printer (51mm×26mm, 57mm, 58mm) |
android/src/main/kotlin/.../BrotherUtils.kt |
Removed unnecessary semicolons from modelFromMap function |
android/src/main/kotlin/.../AnotherBrotherPlugin.kt |
Removed unused PluginRegistry.Registrar import |
android/build.gradle |
Updated Brother SDK from 4.6.1 to 4.12.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 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); |
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All TD-2350D model variants are using the same name "TD_2350D" in the Model._internal2 constructor, but their variable names include DPI suffixes (_203, _300) and variants (DF, DSA, DFSA). This inconsistency with the existing codebase pattern could cause confusion or issues in model identification.
Consider using more descriptive names that match the variable names, such as:
- TD_2350D_203 -> "TD_2350D_203"
- TD_2350D_300 -> "TD_2350D_300"
- TD_2350DF_203 -> "TD_2350DF_203"
etc.
This would align with the existing pattern where model names typically match their variable names (e.g., "TD_2125N", "TD_2130N").
| 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 TD_2350D_203 = Model._internal2("TD_2350D_203", 97, RJ_4030); | |
| static final TD_2350D_300 = Model._internal2("TD_2350D_300", 98, RJ_4030); | |
| static final TD_2350DF_203 = Model._internal2("TD_2350DF_203", 99, RJ_4030); | |
| static final TD_2350DF_300 = Model._internal2("TD_2350DF_300", 100, RJ_4030); | |
| static final TD_2350DSA_203 = Model._internal2("TD_2350DSA_203", 101, RJ_4030); | |
| static final TD_2350DSA_300 = Model._internal2("TD_2350DSA_300", 102, RJ_4030); | |
| static final TD_2350DFSA_203 = Model._internal2("TD_2350DFSA_203", 103, RJ_4030); | |
| static final TD_2350DFSA_300 = Model._internal2("TD_2350DFSA_300", 104, RJ_4030); |
| bool banishMargin; | ||
| bool useCopyCommandInTemplatePrint; | ||
|
|
||
| int? dpi; |
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dpi parameter is added to the PrinterInfo class but is never used. The setPrinterInfo method signature also includes an optional dpi parameter, but it's not assigned to the mPrinterInfo.dpi field.
If DPI information is needed for TD-2350D printers, consider:
- Assigning the
dpiparameter insetPrinterInfotomPrinterInfo.dpi - Including
dpiin thetoMap()method if it needs to be serialized - Using the DPI value somewhere in the printing logic
Otherwise, this field should be removed.
| return status; | ||
| } | ||
|
|
||
| /// Set PrinterInfo object to specify the printer and print settings. |
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dpi parameter is added to the function signature but is never used or assigned to mPrinterInfo.dpi. This suggests incomplete implementation of DPI support for the new TD-2350D printers.
If the DPI parameter is needed, it should be assigned:
Future<bool> setPrinterInfo(PrinterInfo printerInfo, {int? dpi}) async {
mPrinterInfo = printerInfo;
if (dpi != null) {
mPrinterInfo.dpi = dpi;
}
// ... rest of the code
}Otherwise, remove the unused parameter.
| /// Set PrinterInfo object to specify the printer and print settings. | |
| mPrinterInfo = printerInfo; | |
| if (dpi != null) { | |
| mPrinterInfo.dpi = dpi; | |
| } |
Android only, we need to update the iOS SDK to extend support for Apple devices
This pull request includes several updates to dependencies, code cleanup, and the addition of new paper types for custom printing. The most important changes are:
Dependency updates:
com.brother.sdk:printerdependency from version4.6.1to4.12.0inandroid/build.gradle.Code cleanup:
PluginRegistry.RegistrarinAnotherBrotherPlugin.kt.modelFromMapfunction inBrotherUtils.kt.New features:
CustomTD2350DPaperinpubspec.yaml.Related to : #104