m8ty_client_docscan
Document scan client can be used to take documents like pdf, jpeg, png etc. and to send them to the server for QR code scan. If there are codes available those will be returned to the client.
Before you start
Check the documentation of the m8ty_client_docscan library to get an idea about the available models and their properties.
import all needed libraries
import 'package:dio/dio.dart';
import 'package:m8ty_client_docscan/m8ty_client_docscan.dart';
import 'package:m8ty_client_common/m8ty_client_common.dart';
import 'package:built_collection/built_collection.dart';
How to perform different tasks
Here some examples how the dart client can be used
Scan some documents by using filter
final featuresClient = M8tyClientDocscan();
featuresClient.setApiKey(m8tyApiKeyAuth, "myApiKey");
final DocumentScanApi documentScanApi = featuresClient.getDocumentScanApi();
// Create dummy MultipartFile documents
final file1 = MultipartFile.fromFile(
'path/to/your/file1.jpg',
filename: 'file1.jpg',
);
final file2 = MultipartFile.fromFile(
'path/to/your/file2.pdf',
filename: 'file2.pdf',
);
// Add the files to a BuiltList
final documents = BuiltList<MultipartFile>([file1, file2]);
// Specify the types (optional)
final types = BuiltList<CodeTypeModel>([
CodeTypeModel.qrcode,
]);
final Response<ScanCodeResponseModel> scanResponse = await documentScanApi.scanForCodes(
documents: documents,
types: types,
filter: "^SPC[\\s\\S]*\$",
);
Last modified: 19 January 2025