Installation | Flutter Document Scanner
The Scanbot SDK Flutter Plugin is available on pub.dev as the scanbot_sdk
package. Follow the steps below to add it to your Flutter project.
Add the package
Include the scanbot_sdk
package in your pubspec.yaml
file under dependencies
:
dependencies:
scanbot_sdk: ^7.0.0 # Use the latest version
Get the latest version from the Changelog.
Then, fetch and install the packages using the Flutter CLI or your IDE:
$ flutter pub get
Android
In the top-level android/build.gradle
file:
-
Ensure the Kotlin version is set to 1.8.20 or higher. Typically, this is defined using the ext.kotlin_version variable:
...
buildscript {
ext.kotlin_version = '1.8.20'
...
} -
Add the following
packagingOptions
android {
...
packagingOptions {
pickFirst 'META-INF/atomicfu.kotlin_module'
pickFirst 'META-INF/proguard/coroutines.pro'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}
In the android/app/src/main/AndroidManifest.xml
file, add the largeHeap
flag:
Since your application will work with high-resolution images it is
strongly recommended to add the attribute android:largeHeap="true"
in the <application>
element of your AndroidManifest.xml
file, especially for Android <= 7.x.
Processing hi-res images is a memory intensive task and this property will ensure
your app has enough heap allocated to avoid OutOfMemoryError
exceptions.
iOS
In your ios/Podfile
, ensure a global platform version is specified:
platform :ios, '13.0'
Navigate to the ios directory and install or update the Pods:
$ cd ios/
$ pod install
Want to scan longer than one minute?
Generate a free trial license to test the Scanbot SDK thoroughly.
Get free trial license