TF-2764 Add PDFViewer to preview PDF attachment
This commit is contained in:
@@ -4,4 +4,6 @@ class Constant {
|
||||
static const pdfMimeType = 'application/pdf';
|
||||
static const textHtmlMimeType = 'text/html';
|
||||
static const octetStreamMimeType = 'application/octet-stream';
|
||||
static const pdfExtension = '.pdf';
|
||||
static const imageType = 'image';
|
||||
}
|
||||
@@ -3,8 +3,6 @@ import 'package:core/domain/preview/supported_preview_file_types.dart';
|
||||
import 'package:http_parser/http_parser.dart';
|
||||
|
||||
extension MediaTypeExtension on MediaType {
|
||||
static const String imageType = 'image';
|
||||
|
||||
bool isAndroidSupportedPreview() => SupportedPreviewFileTypes.androidSupportedTypes.contains(mimeType);
|
||||
|
||||
bool isIOSSupportedPreview() => SupportedPreviewFileTypes.iOSSupportedTypes.containsKey(mimeType);
|
||||
|
||||
@@ -216,10 +216,6 @@ class ImagePaths {
|
||||
return AssetsPaths.images + imageName;
|
||||
}
|
||||
|
||||
String _getIconPath(String iconName) {
|
||||
return AssetsPaths.icons + iconName;
|
||||
}
|
||||
|
||||
String getConfigurationImagePath(String imageName) {
|
||||
return AssetsPaths.configurationImages + imageName;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class _TextFieldFormBuilderState extends State<TextFormFieldBuilder> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TextFormField(
|
||||
return TextField(
|
||||
key: widget.key,
|
||||
controller: _controller,
|
||||
cursorColor: widget.cursorColor,
|
||||
@@ -105,7 +105,7 @@ class _TextFieldFormBuilderState extends State<TextFormFieldBuilder> {
|
||||
}
|
||||
}
|
||||
},
|
||||
onFieldSubmitted: widget.onTextSubmitted,
|
||||
onSubmitted: widget.onTextSubmitted,
|
||||
onTap: widget.onTap,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:core/data/model/print_attachment.dart';
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
@@ -8,8 +8,16 @@ import 'package:core/utils/html/html_template.dart';
|
||||
import 'package:core/utils/html/html_utils.dart';
|
||||
import 'package:html/dom.dart';
|
||||
import 'package:html/parser.dart';
|
||||
import 'package:printing/printing.dart';
|
||||
|
||||
class PrintUtils {
|
||||
|
||||
Future<void> printPDFFile(Uint8List bytes, String fileName) async {
|
||||
await Printing.layoutPdf(
|
||||
name: fileName,
|
||||
onLayout: (_) => bytes);
|
||||
}
|
||||
|
||||
Element? _createUserInformationElement({
|
||||
required String appName,
|
||||
required String userName,
|
||||
|
||||
Reference in New Issue
Block a user