Scan Tips
The SDK provides an optional toolbar item within the scanning screen, that when clicked, will open some tips on how to get the best scan result. By default it is activated for photo payment and disabled for document scan and shows some default items. You can customize it according to your needs or disable it completely.
Disable
To disable the scan tips, set the scanTips
option to null.
For Document Scan, the scan tips are disabled by default.
- Photo Payment
var paymentConfig = PhotoPaymentConfiguration();
paymentConfig.scanTips = null;
var result = await DocutainSdkUi.startPhotoPayment(paymentConfig);
Customize
If you want to provide your own items instead of the default items, you can do that by providing your own list of DocutainListItem
.
Each item consists of an image
, a title
and a message
.
image
needs to be a name of an image resource in the drawable folder (Android), respectively the name of an image in your assets catalog (iOS).
- Document Scan
- Photo Payment
var scanTipsDefaultItems = await DocutainSdkUi.scanTipsDefaultItems();
var scanConfig = DocumentScannerConfiguration();
scanConfig.scanTips = ScanTips();
scanConfig.scanTips?.items = <DocutainListItem>[
scanTipsDefaultItems[1],
scanTipsDefaultItems[3],
DocutainListItem(image: 'my_icon', title: 'my onboarding page 3', message: 'my scantips as page 3\npage 1 is default page 2\npage 2 is default page 4')
];
var result = await DocutainSdkUi.scanDocument(scanConfig);
var scanTipsDefaultItems = await DocutainSdkUi.scanTipsDefaultItems();
var paymentConfig = PhotoPaymentConfiguration();
paymentConfig.scanTips?.items = <DocutainListItem>[
scanTipsDefaultItems[1],
scanTipsDefaultItems[3],
DocutainListItem(image: 'my_icon', title: 'my onboarding page 3', message: 'my scantips as page 3\npage 1 is default page 2\npage 2 is default page 4')
];
var result = await DocutainSdkUi.startPhotoPayment(paymentConfig);
The following provides an overview of the currently available options to alter the scanTips
:
Property | Type | Description |
---|---|---|
items | List<DocutainListItem>? | The items you want to show within the scan tips. If you don't provide any items, some default items will be displayed. |
toolbarItem | DocutainButton? | The toolbar item that will be shown allowing the user to open the scan tips. |
You can get the default items used by the SDK to use them for your own list.
var scanTipsDefaultItems = await DocutainSdkUi.scanTipsDefaultItems();
The following sample alters the toolbarItem
icon.
icon
needs to be a name of an image resource in the drawable folder (Android), respectively the name of an image in your assets catalog (iOS).
- Document Scan
- Photo Payment
var scanTipsDefaultItems = await DocutainSdkUi.scanTipsDefaultItems();
var scanConfig = DocumentScannerConfiguration();
scanConfig.scanTips = ScanTips();
scanConfig.scanTips?.items = scanTipsDefaultItems;
scanConfig.scanTips?.toolbarItem?.icon = 'my_icon';
var result = await DocutainSdkUi.scanDocument(scanConfig);
var paymentConfig = PhotoPaymentConfiguration();
paymentConfig.scanTips?.toolbarItem?.icon = 'my_icon';
var result = await DocutainSdkUi.startPhotoPayment(paymentConfig);