Ocr class
Constructors
- Ocr()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
closeCamera(
) → Future< bool> -
cropImage(
String sourcePath) → Future< String?> - Launch native image cropper for the given image path. Returns the cropped image path.
-
getOcrText(
) → Future< String?> - Get the latest OCR recognized text (newline-separated lines).
-
getPlatformVersion(
) → Future< String?> -
loadModel(
{required String detParam, required String detModel, required String recParam, required String recModel, int sizeid = 0, int cpugpu = 0}) → Future< bool> - Load OCR model from file paths.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
ocrFromImage(
String imagePath) → Future< String?> - Run OCR on a static image file. Returns recognized text.
-
openCamera(
int facing) → Future< bool> -
setPhotoMode(
bool isPhoto) → Future< bool?> - Sets whether the native camera is in Photo mode. When true, continuous OCR is paused to save power and only runs on capture.
-
setTargetRect(
double w, double h) → Future< bool?> -
Sets the normalized crop area for auto-cropping in Photo mode.
wandhshould be between 0.0 and 1.0. -
takePhoto(
String savePath) → Future< String?> -
Take a photo and save to
savePath. Returns the saved file path. -
toggleFlash(
) → Future< bool> - Toggle camera flash/torch on/off.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited