Skip to content

Conversation

@PrimaelQuemerais
Copy link
Contributor

@PrimaelQuemerais PrimaelQuemerais commented Mar 17, 2025

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:

  • Updated the com.brother.sdk:printer dependency from version 4.6.1 to 4.12.0 in android/build.gradle.

Code cleanup:

  • Removed an unused import statement for PluginRegistry.Registrar in AnotherBrotherPlugin.kt.
  • Removed unnecessary semicolons in modelFromMap function in BrotherUtils.kt.

New features:

  • Added support for TD-2350D-203 and TD-2350D-300 printers
  • Added a new custom paper type CustomTD2350DPaper in pubspec.yaml.

Related to : #104

…0 in printer_info.dart; removed redundant logging in modelFromMap function in BrotherUtils.kt
PrimaelQuemerais and others added 2 commits March 28, 2025 18:35
… corrected label ID comment in label_info.dart; removed unused imports in type_b_commands.dart and type_b_printer.dart
Copilot AI review requested due to automatic review settings December 8, 2025 14:10
Copy link

Copilot AI left a 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.

Comment on lines +184 to +191
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);
Copy link

Copilot AI Dec 8, 2025

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").

Suggested change
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);

Copilot uses AI. Check for mistakes.
bool banishMargin;
bool useCopyCommandInTemplatePrint;

int? dpi;
Copy link

Copilot AI Dec 8, 2025

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:

  1. Assigning the dpi parameter in setPrinterInfo to mPrinterInfo.dpi
  2. Including dpi in the toMap() method if it needs to be serialized
  3. Using the DPI value somewhere in the printing logic

Otherwise, this field should be removed.

Copilot uses AI. Check for mistakes.
return status;
}

/// Set PrinterInfo object to specify the printer and print settings.
Copy link

Copilot AI Dec 8, 2025

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.

Suggested change
/// Set PrinterInfo object to specify the printer and print settings.
mPrinterInfo = printerInfo;
if (dpi != null) {
mPrinterInfo.dpi = dpi;
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant