10/24/1
This commit is contained in:
@@ -22,6 +22,7 @@ class TextExtractionController extends GetxController {
|
||||
String getTextAsJSON(String text) {
|
||||
final json = {
|
||||
'text': text,
|
||||
'num_lines': text.split('\n').length,
|
||||
};
|
||||
|
||||
return jsonEncode(json);
|
||||
@@ -61,7 +62,7 @@ class TextExtractionController extends GetxController {
|
||||
textBlocks.toString(); // Convert the extracted text to JSON.
|
||||
|
||||
// Print the JSON to the console.
|
||||
print(textBlocks);
|
||||
print(jsonText);
|
||||
update();
|
||||
// print(text);
|
||||
} catch (e) {
|
||||
@@ -72,35 +73,8 @@ class TextExtractionController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
// class TesseractController extends GetxController {
|
||||
// String text = '';
|
||||
// bool scanning = false;
|
||||
|
||||
// Future<void> extractTextFromImage() async {
|
||||
// scanning = true;
|
||||
// update();
|
||||
|
||||
// // Get the image from the image picker
|
||||
// final ImagePicker picker = ImagePicker();
|
||||
// final XFile? image = await picker.pickImage(source: ImageSource.gallery);
|
||||
|
||||
// // If an image was selected, extract the text from it
|
||||
// if (image != null) {
|
||||
// var watch = Stopwatch()..start();
|
||||
// text = await TesseractLatest.extractText(image.path);
|
||||
// scanning = false;
|
||||
// update();
|
||||
// print('Scanning took ${watch.elapsedMilliseconds} ms');
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// import 'package:get/get.dart';
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:image_picker/image_picker.dart';
|
||||
// import 'package:google_ml_kit/google_ml_kit.dart';
|
||||
//
|
||||
class TextRecognizerController extends GetxController {
|
||||
class TextMLGoogleRecognizerController extends GetxController {
|
||||
@override
|
||||
void onInit() {
|
||||
scanText();
|
||||
@@ -121,7 +95,7 @@ class TextRecognizerController extends GetxController {
|
||||
Future<void> scanText() async {
|
||||
// Pick an image from the camera or gallery
|
||||
final XFile? image =
|
||||
await _imagePicker.pickImage(source: ImageSource.gallery);
|
||||
await _imagePicker.pickImage(source: ImageSource.camera);
|
||||
|
||||
// If no image was picked, return
|
||||
if (image == null) {
|
||||
|
||||
8
lib/controller/functions/remove_account.dart
Normal file
8
lib/controller/functions/remove_account.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
// import 'package:ride/controller/functions/crud.dart';
|
||||
|
||||
// class RemoveAccount {
|
||||
|
||||
// void removeAccount()async{
|
||||
// var res=await CRUD().post(link: link)
|
||||
// }
|
||||
// }
|
||||
Reference in New Issue
Block a user