print mode change to black mark from gap(label)

master
张萌 2 years ago
parent d3cb7573e4
commit 917ad90f9d

@ -2,7 +2,6 @@
<library name="Flutter Plugins" type="FlutterPluginsLibraryType"> <library name="Flutter Plugins" type="FlutterPluginsLibraryType">
<CLASSES> <CLASSES>
<root url="file://$PROJECT_DIR$" /> <root url="file://$PROJECT_DIR$" />
<root url="file://$PROJECT_DIR$/../.pub-cache/hosted/pub.flutter-io.cn/flutter_image_compress-1.1.0" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>

@ -5,9 +5,13 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="2f8e3712-04e2-429a-bcea-c8db1a54008e" name="默认变更列表" comment=""> <list default="true" id="2f8e3712-04e2-429a-bcea-c8db1a54008e" name="默认变更列表" comment="">
<change beforePath="$PROJECT_DIR$/.idea/libraries/Flutter_Plugins.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/libraries/Flutter_Plugins.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/runConfigurations.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/dj/printer/dj_printer/AsPrint.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/dj/printer/dj_printer/AsPrint.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/android/src/main/java/com/dj/printer/dj_printer/AsPrint.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/dj/printer/dj_printer/AsPrint.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/lib/main.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/main.dart" afterDir="false" /> <change beforePath="$PROJECT_DIR$/example/lib/main.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/main.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/pubspec.lock" beforeDir="false" afterPath="$PROJECT_DIR$/example/pubspec.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/dj_printer.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/dj_printer.dart" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -33,12 +37,12 @@
</file-type-list> </file-type-list>
</component> </component>
<component name="HighlightingSettingsPerFile"> <component name="HighlightingSettingsPerFile">
<setting file="file://$PROJECT_DIR$/example/pubspec.yaml" root0="SKIP_INSPECTION" />
<setting file="file://$PROJECT_DIR$/android/src/main/java/com/dj/printer/dj_printer/DjPrinterPlugin.java" root0="SKIP_INSPECTION" />
<setting file="file://$PROJECT_DIR$/android/src/main/java/com/dj/printer/dj_printer/AsPrint.java" root0="SKIP_INSPECTION" /> <setting file="file://$PROJECT_DIR$/android/src/main/java/com/dj/printer/dj_printer/AsPrint.java" root0="SKIP_INSPECTION" />
<setting file="file://$PROJECT_DIR$/android/src/main/java/com/dj/printer/dj_printer/Blutooth.java" root0="SKIP_INSPECTION" /> <setting file="file://$PROJECT_DIR$/android/src/main/java/com/dj/printer/dj_printer/Blutooth.java" root0="SKIP_INSPECTION" />
<setting file="file://$PROJECT_DIR$/lib/dj_printer.dart" root0="SKIP_INSPECTION" /> <setting file="file://$PROJECT_DIR$/android/src/main/java/com/dj/printer/dj_printer/DjPrinterPlugin.java" root0="SKIP_INSPECTION" />
<setting file="file://$PROJECT_DIR$/example/lib/main.dart" root0="SKIP_INSPECTION" /> <setting file="file://$PROJECT_DIR$/example/lib/main.dart" root0="SKIP_INSPECTION" />
<setting file="file://$PROJECT_DIR$/example/pubspec.yaml" root0="SKIP_INSPECTION" />
<setting file="file://$PROJECT_DIR$/lib/dj_printer.dart" root0="SKIP_INSPECTION" />
</component> </component>
<component name="MarkdownSettingsMigration"> <component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" /> <option name="stateVersion" value="1" />
@ -59,16 +63,13 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent"><![CDATA[{
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" /> "keyToString": {
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> "dart.analysis.tool.window.visible": "false",
<property name="dart.analysis.tool.window.force.activate" value="true" /> "io.flutter.reload.alreadyRun": "true",
<property name="dart.analysis.tool.window.visible" value="false" /> "show.migrate.to.gradle.popup": "false"
<property name="io.flutter.reload.alreadyRun" value="true" /> }
<property name="last_opened_file_path" value="$PROJECT_DIR$" /> }]]></component>
<property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
<property name="show.migrate.to.gradle.popup" value="false" />
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" /> <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager"> <component name="TaskManager">
<task active="true" id="Default" summary="默认任务"> <task active="true" id="Default" summary="默认任务">
@ -96,7 +97,6 @@
</entry> </entry>
</map> </map>
</option> </option>
<option name="oldMeFiltersMigrated" value="true" />
</component> </component>
<component name="XSLT-Support.FileAssociations.UIState"> <component name="XSLT-Support.FileAssociations.UIState">
<expand /> <expand />

@ -80,7 +80,7 @@ public class AsPrint {
channelY = 460;channelX = 220 - channel.length()*10; channelY = 460;channelX = 220 - channel.length()*10;
} }
cpclPrinter.setForm(0, 203, 203, 800, 575, 0, 1); cpclPrinter.setForm(0, 203, 203, 800, 575, 0, 1);
cpclPrinter.setMedia(CPCLConst.LK_CPCL_LABEL); cpclPrinter.setMedia(CPCLConst.LK_CPCL_BLACKMARK);
cpclPrinter.setJustification(CPCLConst.LK_CPCL_CENTER); cpclPrinter.setJustification(CPCLConst.LK_CPCL_CENTER);
cpclPrinter.printBox(0, 10, 575, 790, 3); cpclPrinter.printBox(0, 10, 575, 790, 3);
cpclPrinter.printLine(0, 160, 570, 160, 3); cpclPrinter.printLine(0, 160, 570, 160, 3);

@ -94,6 +94,8 @@ class _MyAppState extends State<MyApp> {
), ),
TextButton( TextButton(
onPressed: () { onPressed: () {
int i=0;
while ( i<10){
DjPrinter().printNewAScode( DjPrinter().printNewAScode(
code: 'ASSZ000000002', code: 'ASSZ000000002',
barCode: 'ASSZ0000000020001', barCode: 'ASSZ0000000020001',
@ -102,7 +104,7 @@ class _MyAppState extends State<MyApp> {
num: '2', num: '2',
sum:'9', sum:'9',
offset: 0, offset: 0,
hasPlan: false, ); hasPlan: true, );i++;}
}, },
child: const Text('打印')), child: const Text('打印')),

@ -5,70 +5,70 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: async name: async
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.8.2" version: "2.9.0"
barcode: barcode:
dependency: transitive dependency: transitive
description: description:
name: barcode name: barcode
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
barcode_widget: barcode_widget:
dependency: "direct main" dependency: "direct main"
description: description:
name: barcode_widget name: barcode_widget
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.2" version: "2.0.2"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
bot_toast: bot_toast:
dependency: "direct main" dependency: "direct main"
description: description:
name: bot_toast name: bot_toast
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.2" version: "4.0.2"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.1" version: "1.3.1"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.16.0" version: "1.16.0"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
name: cupertino_icons name: cupertino_icons
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.5" version: "1.0.5"
dj_printer: dj_printer:
@ -82,7 +82,7 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.3.0"
flutter: flutter:
@ -94,14 +94,14 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: flutter_image_compress name: flutter_image_compress
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
flutter_lints: flutter_lints:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: flutter_lints name: flutter_lints
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.4" version: "1.0.4"
flutter_test: flutter_test:
@ -113,84 +113,84 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: lints name: lints
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "1.0.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.11" version: "0.12.11"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.4" version: "0.1.4"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.7.0" version: "1.7.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.1" version: "1.8.1"
permission_handler: permission_handler:
dependency: "direct main" dependency: "direct main"
description: description:
name: permission_handler name: permission_handler
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "9.2.0" version: "9.2.0"
permission_handler_android: permission_handler_android:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_android name: permission_handler_android
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "9.0.2+1" version: "9.0.2+1"
permission_handler_apple: permission_handler_apple:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_apple name: permission_handler_apple
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "9.0.4" version: "9.0.4"
permission_handler_platform_interface: permission_handler_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_platform_interface name: permission_handler_platform_interface
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.7.0" version: "3.7.0"
permission_handler_windows: permission_handler_windows:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_windows name: permission_handler_windows
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.0" version: "0.1.0"
plugin_platform_interface: plugin_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: plugin_platform_interface name: plugin_platform_interface
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.2" version: "2.1.2"
qr: qr:
dependency: transitive dependency: transitive
description: description:
name: qr name: qr
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.1" version: "3.0.1"
sky_engine: sky_engine:
@ -202,56 +202,56 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.2" version: "1.8.2"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0" version: "1.10.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.9" version: "0.4.9"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.2" version: "2.1.2"
widget_to_image: widget_to_image:
dependency: "direct main" dependency: "direct main"
description: description:
name: widget_to_image name: widget_to_image
url: "https://pub.flutter-io.cn" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.0"
sdks: sdks:

@ -3,12 +3,9 @@ import 'dart:convert';
import 'dart:typed_data'; import 'dart:typed_data';
import 'dart:ui'; import 'dart:ui';
import 'package:barcode_widget/barcode_widget.dart';
import 'package:dj_printer/src/status_enum.dart'; import 'package:dj_printer/src/status_enum.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_image_compress/flutter_image_compress.dart';
import 'package:widget_to_image/widget_to_image.dart';
class DjPrinter { class DjPrinter {
static late final DjPrinter _instance = DjPrinter._(); static late final DjPrinter _instance = DjPrinter._();
@ -175,109 +172,109 @@ class DjPrinter {
required int offset, required int offset,
required bool hasPlan}) async { required bool hasPlan}) async {
//
ByteData bDCode = await WidgetToImage.widgetToImage( Directionality( // ByteData bDCode = await WidgetToImage.widgetToImage( Directionality(
textDirection: TextDirection.ltr, // textDirection: TextDirection.ltr,
child: Material( // child: Material(
child:_getCode(code), // child:_getCode(code),
), // ),
),pixelRatio: window.devicePixelRatio,size: const Size(25,240)); // ),pixelRatio: window.devicePixelRatio,size: const Size(25,240));
//
Uint8List uint8ListCode = await testComporessList(bDCode); // Uint8List uint8ListCode = await testComporessList(bDCode);
//
//
ByteData bDChannel = await WidgetToImage.widgetToImage( Directionality( // ByteData bDChannel = await WidgetToImage.widgetToImage( Directionality(
textDirection: TextDirection.ltr, // textDirection: TextDirection.ltr,
child: Material( // child: Material(
child:_getChannel(channel) // child:_getChannel(channel)
), // ),
),pixelRatio: window.devicePixelRatio,size: const Size(40,140)); // ),pixelRatio: window.devicePixelRatio,size: const Size(40,140));
//
Uint8List uint8ListChannel = await testComporessList(bDChannel); // Uint8List uint8ListChannel = await testComporessList(bDChannel);
//
//
ByteData bDNum = await WidgetToImage.widgetToImage( Directionality( // ByteData bDNum = await WidgetToImage.widgetToImage( Directionality(
textDirection: TextDirection.ltr, // textDirection: TextDirection.ltr,
child: Material( // child: Material(
child:_getNum(num) // child:_getNum(num)
), // ),
),pixelRatio: window.devicePixelRatio,size: Size(20,(20*num.length).toDouble())); // ),pixelRatio: window.devicePixelRatio,size: Size(20,(20*num.length).toDouble()));
//
Uint8List uint8ListNum = await testComporessList(bDNum); // Uint8List uint8ListNum = await testComporessList(bDNum);
//
//
ByteData bDSum = await WidgetToImage.widgetToImage( Directionality( // ByteData bDSum = await WidgetToImage.widgetToImage( Directionality(
textDirection: TextDirection.ltr, // textDirection: TextDirection.ltr,
child: Material( // child: Material(
child:_getNum(sum) // child:_getNum(sum)
), // ),
),pixelRatio: window.devicePixelRatio,size: Size(20,(20*sum.length).toDouble())); // ),pixelRatio: window.devicePixelRatio,size: Size(20,(20*sum.length).toDouble()));
//
Uint8List uint8ListSum= await testComporessList(bDSum); // Uint8List uint8ListSum= await testComporessList(bDSum);
//
//
Uint8List uint8ListCountry; // Uint8List uint8ListCountry;
if(hasPlan){ // if(hasPlan){
ByteData bDCountry = await WidgetToImage.widgetToImage( Directionality( // ByteData bDCountry = await WidgetToImage.widgetToImage( Directionality(
textDirection: TextDirection.ltr, // textDirection: TextDirection.ltr,
child: Material( // child: Material(
child:_getCountry(country) // child:_getCountry(country)
), // ),
),pixelRatio: window.devicePixelRatio,size: Size(country.length>4?44: 22,70)); // ),pixelRatio: window.devicePixelRatio,size: Size(country.length>4?44: 22,70));
//
uint8ListCountry = await testComporessList(bDCountry); // uint8ListCountry = await testComporessList(bDCountry);
}else{ // }else{
ByteData bDCountry = await WidgetToImage.widgetToImage( Directionality( // ByteData bDCountry = await WidgetToImage.widgetToImage( Directionality(
textDirection: TextDirection.ltr, // textDirection: TextDirection.ltr,
child: Material( // child: Material(
child:_getNoplan() // child:_getNoplan()
), // ),
),pixelRatio: window.devicePixelRatio,size: const Size(22,100)); // ),pixelRatio: window.devicePixelRatio,size: const Size(22,100));
//
uint8ListCountry = await testComporessList(bDCountry); // uint8ListCountry = await testComporessList(bDCountry);
} // }
//
//
//
ByteData bDBarCode = await WidgetToImage.widgetToImage( Directionality( // ByteData bDBarCode = await WidgetToImage.widgetToImage( Directionality(
textDirection: TextDirection.ltr, // textDirection: TextDirection.ltr,
child: Material( // child: Material(
child:_getBarCode(code) // child:_getBarCode(code)
), // ),
),pixelRatio: window.devicePixelRatio,size: const Size(60,120)); // ),pixelRatio: window.devicePixelRatio,size: const Size(60,120));
Uint8List uint8ListBarCode = await testComporessList(bDBarCode); // Uint8List uint8ListBarCode = await testComporessList(bDBarCode);
final res = await _channel.invokeMethod('print', { // final res = await _channel.invokeMethod('print', {
'code': code, // 'code': code,
'channel': channel, // 'channel': channel,
'country': country, // 'country': country,
'countStr': countStr, // 'countStr': countStr,
'offset': offset, // 'offset': offset,
'hasPlan': hasPlan, // 'hasPlan': hasPlan,
'byteCode': uint8ListCode, // 'byteCode': uint8ListCode,
'bytesChannel':uint8ListChannel, // 'bytesChannel':uint8ListChannel,
'bytesCountry':uint8ListCountry, // 'bytesCountry':uint8ListCountry,
'bytesBarCode':uint8ListBarCode, // 'bytesBarCode':uint8ListBarCode,
'bytesSum':uint8ListSum, // 'bytesSum':uint8ListSum,
'bytesNum':uint8ListNum, // 'bytesNum':uint8ListNum,
}); // });
return res; // return res;
} }
Future<Uint8List> testComporessList(ByteData data) async { // Future<Uint8List> testComporessList(ByteData data) async {
final buffer = data.buffer; // final buffer = data.buffer;
//
var result = await FlutterImageCompress.compressWithList( // var result = await FlutterImageCompress.compressWithList(
buffer.asUint8List(), // buffer.asUint8List(),
quality: 1, // quality: 1,
//
); // );
print(buffer.asUint8List().length); // print(buffer.asUint8List().length);
print(result.length); // print(result.length);
return result; // return result;
} // }
Widget _getCountry(String country){ Widget _getCountry(String country){
@ -361,18 +358,18 @@ class DjPrinter {
} }
Widget _getBarCode(String code){ // Widget _getBarCode(String code){
return RotatedBox( // return RotatedBox(
quarterTurns: 1, // quarterTurns: 1,
child: BarcodeWidget( // child: BarcodeWidget(
barcode: Barcode.code128(), // barcode: Barcode.code128(),
data: code, // data: code,
style: TextStyle( // style: TextStyle(
fontSize: 10 // fontSize: 10
), // ),
), // ),
); // );
} // }
Widget _getCard(String code, String channel, String country, String countStr, Widget _getCard(String code, String channel, String country, String countStr,
int offset, bool hasPlan) { int offset, bool hasPlan) {

Loading…
Cancel
Save