Add support for auto cut every page count
I have a project where I need to cut every 2 labels, so this PR adds support for the numberOfAutoCutPages from the brother SDK. Tested under iOS 18.3.1 using QL-820NWBc printer connected over BLE.
I'm not sure but seems for Android the property is named differently (although I could not find it on the brother SDK pages). Would be good if someone could test/verify the android changes also work as expected.
Hi @PeterStaev ,
Thanks for taking a crack at this. The native Brother native iOS and Android SDKs unfortunately don't share a one to one parity between them and some features that are supported in one are not supported in the other. This is one of those features, it is supported on iOS but not on Android.
Our approach for features in another_brother is that they must work on both platforms by adding support on the dart side for the missing platform. If no support can be added on the dart side for the missing platform then we opt for not adding the feature.
In the case this flag, it seems that it is something that can be supported for Android on the Flutter side based on the documentation https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/ios_v4/brlmqlprintsettings.html#autocutforeachpagecount
If you'd like to bring this in please add support for Android as well as part of the PR.
Hey @CodeMinion , I understand and fully support this! That's the whole idea of x-plat plugins!
The problem is that I do not see this property on the android side. The link you provided is for iOS. I found a similarly named property for android under the PrintInfo class and I've already added it in the PR:
Sadly I couldn't find the PrintInfo class or this property in the Brother SDK site, so I'm just assuming it does the same by its name. From what I see the PrintInfo class does come from the Brother SDK, so not sure why it is not listed on their site. If you know could you point me to the docs for the PrintInfo class or may be I'm missing something? I'll be more than happy to adjust the PR as needed to bring support for android too.
Hi @PeterStaev ,
Apologies for the lack of clarity on my part. The Android native library does not have support for this which is why it wasn't part of the original another_brother release and the reason you won't find a property for it.
In cases like this one the only option is to replicate the behavior for the missing platform on the Flutter/Dart side of the plugin. Here is one example in which we added support for a feature that was supported in Android but not iOS for a better idea to what we mean: https://github.com/CodeMinion/another_brother/blob/main/lib/printer_info.dart#L3300
And another one from a different plugin in which we added in Flutter/Dart support for papers on iOS that were not supported in the iOS native library: https://github.com/CodeMinion/air_brother/blob/main/lib/air_brother.dart#L107C9-L107C23
Hope this helps, but please don't hesitate to reach out if there is anything else we can help with,
Hey @CodeMinion ,
I found an oldish android tablet here (Galaxy Tab A 8.0 (SM-T380)) and tested the changes that are in this PR (using the numOfAutoCutPages for android). Tested with the same printer as iOS (QL-820NWBc) over BLE connections and seems it is working the same way as for iOS. For example:
- Num of copies set to 2,
autoCutForEachPageCountnot set - produces 2 separate labels - Num of copies set to 4,
autoCutForEachPageCountset to 2 - produces 2 sheets with 2 labels each
Note: I had to remove unused old imports as I was getting a build error using Flutter 3.29 and LadyBug android studio.