-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
29 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
import 'package:formx_sdk_flutter/formx_sdk_flutter.dart'; | ||
import 'package:formx_sdk_flutter/src/formx_sdk_flutter_platform_interface.dart'; | ||
|
||
// A SDK wrapper to communicate with the FormX API | ||
class FormXSDK { | ||
/// Initialize FormX SDK with [formId] and [accessToken] retrieved from https://formextractorai.com. | ||
/// By default offical FormX api is used when [endpoint] is null. | ||
/// Setup SDK with [formId] and [accessToken]. if [endpoint] is null, official formx api endpoint is used. | ||
static Future<void> init( | ||
{required String formId, required String accessToken, String? endpoint}) { | ||
return FormxSdkFlutterPlatform.instance.init(formId, accessToken, endpoint); | ||
} | ||
|
||
/// Detect documents from given image | ||
/// Detect documents by FormX API | ||
static Future<FormXDetectDocumentsResult?> detect(String imagePath) { | ||
return FormxSdkFlutterPlatform.instance.detect(imagePath); | ||
} | ||
|
||
/// Extract document structures from given image | ||
/// Extract form data from documents by FormX API | ||
static Future<FormXExtractionResult?> extract(String imagePath) { | ||
return FormxSdkFlutterPlatform.instance.extract(imagePath); | ||
} | ||
|
||
/// Check whether the given image is blurry | ||
static Future<bool?> isBlurry(String imagePath, double threshold) async { | ||
return FormxSdkFlutterPlatform.instance.isBlurry(imagePath, threshold); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
/// Document detection mode used in FormX camera view | ||
enum DetectMode { online, offline } | ||
import 'package:formx_sdk_flutter/formx_sdk_flutter.dart'; | ||
|
||
/// Document detection mode used in [FormXCameraView] | ||
enum DetectMode { | ||
/// using FormX API | ||
online, | ||
|
||
/// using offline ML models | ||
offline | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters