I try use google_mlkit_text_recognition
in flutter app but I got "Errors" with some virables
in flutter?
final inputImage = InputImage.fromFilePath(path!.path);
final textRecognizer = TextRecognizer(script: TextRecognitionScript.latin);
final RecognizedText recognizedText = await textRecognizer.processImage(inputImage);
String text = recognizedText.text;
for (TextBlock block in recognizedText.blocks) {
final Rect rect = block.rect;`Error` <=`The getter 'rect' isn't defined for the type 'TextBlock'.
Try importing the library that defines 'rect', correcting the name to the name of an existing getter, or defining a getter or field named 'rect'`
final List<Offset> cornerPoints = block.cornerPoints; `Error`<=`A value of type 'List<Point<int>>' can't be assigned to a variable of type 'List<Offset>'.
Try changing the type of the variable, or casting the right-hand type to 'List<Offset>'`
final String text = block.text;
final List<String> languages = block.recognizedLanguages;
for (TextLine line in block.lines) {
// Same getters as TextBlock
for (TextElement element in line.elements) {
// Same getters as TextBlock
}
}
}
}```
I want to make google_mlkit_text_recognition inside method to extract text from photo