TF-2736 Remove the logo in printing
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 57 KiB |
@@ -210,7 +210,6 @@ class ImagePaths {
|
|||||||
String get icUnsubscribe => _getImagePath('ic_unsubscribe.svg');
|
String get icUnsubscribe => _getImagePath('ic_unsubscribe.svg');
|
||||||
String get icRecoverDeletedMessages => _getImagePath('ic_recover_deleted_messages.svg');
|
String get icRecoverDeletedMessages => _getImagePath('ic_recover_deleted_messages.svg');
|
||||||
String get icPrinter => _getImagePath('ic_printer.svg');
|
String get icPrinter => _getImagePath('ic_printer.svg');
|
||||||
String get icLogoApp => _getIconPath('logo_app.png');
|
|
||||||
String get icAlwaysReadReceipt => _getImagePath('ic_always_read_receipt.svg');
|
String get icAlwaysReadReceipt => _getImagePath('ic_always_read_receipt.svg');
|
||||||
|
|
||||||
String _getImagePath(String imageName) {
|
String _getImagePath(String imageName) {
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:core/data/model/print_attachment.dart';
|
import 'package:core/data/model/print_attachment.dart';
|
||||||
import 'package:core/presentation/resources/image_paths.dart';
|
|
||||||
import 'package:core/utils/app_logger.dart';
|
import 'package:core/utils/app_logger.dart';
|
||||||
import 'package:core/utils/file_utils.dart';
|
|
||||||
import 'package:core/utils/html/html_interaction.dart';
|
import 'package:core/utils/html/html_interaction.dart';
|
||||||
import 'package:core/utils/html/html_template.dart';
|
import 'package:core/utils/html/html_template.dart';
|
||||||
import 'package:core/utils/html/html_utils.dart';
|
import 'package:core/utils/html/html_utils.dart';
|
||||||
@@ -12,23 +10,15 @@ import 'package:html/dom.dart';
|
|||||||
import 'package:html/parser.dart';
|
import 'package:html/parser.dart';
|
||||||
|
|
||||||
class PrintUtils {
|
class PrintUtils {
|
||||||
final ImagePaths _imagePaths;
|
Element? _createUserInformationElement({
|
||||||
final FileUtils _fileUtils;
|
|
||||||
|
|
||||||
PrintUtils(this._imagePaths, this._fileUtils);
|
|
||||||
|
|
||||||
Future<Element?> _createUserInformationElement({
|
|
||||||
required String appName,
|
required String appName,
|
||||||
required String userName,
|
required String userName,
|
||||||
}) async {
|
}) {
|
||||||
try {
|
try {
|
||||||
final logoBase64Data = await _fileUtils.convertImageAssetToBase64(_imagePaths.icLogoApp);
|
|
||||||
|
|
||||||
return Element.html('''
|
return Element.html('''
|
||||||
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr height="14px">
|
<tr height="14px">
|
||||||
<td width="200"><img src="${HtmlUtils.convertBase64ToImageResourceData(base64Data: logoBase64Data, mimeType: 'image/png')}" width="200" height="40" class="logo" /></td>
|
|
||||||
<td align="right" style="color: #777;">
|
<td align="right" style="color: #777;">
|
||||||
<b>$userName</b>
|
<b>$userName</b>
|
||||||
</td>
|
</td>
|
||||||
@@ -228,7 +218,7 @@ class PrintUtils {
|
|||||||
Element messageElement = Element.html('<table width="100%" cellpadding="0" cellspacing="0" border="0" class="message"></table>');
|
Element messageElement = Element.html('<table width="100%" cellpadding="0" cellspacing="0" border="0" class="message"></table>');
|
||||||
Element messageBodyElement = Element.html('<tbody></tbody>');
|
Element messageBodyElement = Element.html('<tbody></tbody>');
|
||||||
|
|
||||||
Element? userInfoElement = await _createUserInformationElement(
|
Element? userInfoElement = _createUserInformationElement(
|
||||||
appName: appName,
|
appName: appName,
|
||||||
userName: userName);
|
userName: userName);
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class CoreBindings extends Bindings {
|
|||||||
Get.put(CompressFileUtils());
|
Get.put(CompressFileUtils());
|
||||||
Get.put(AppConfigLoader());
|
Get.put(AppConfigLoader());
|
||||||
Get.put(FileUtils());
|
Get.put(FileUtils());
|
||||||
Get.put(PrintUtils(Get.find<ImagePaths>(), Get.find<FileUtils>()));
|
Get.put(PrintUtils());
|
||||||
}
|
}
|
||||||
|
|
||||||
void _bindingIsolate() {
|
void _bindingIsolate() {
|
||||||
|
|||||||
Reference in New Issue
Block a user