10/24/2
This commit is contained in:
@@ -2,5 +2,7 @@ package com.mobileapp.store.ride
|
|||||||
|
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
|
||||||
class MainActivity: FlutterActivity() {
|
import io.flutter.embedding.android.FlutterFragmentActivity
|
||||||
|
|
||||||
|
class MainActivity: FlutterFragmentActivity() {
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
||||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
<!-- <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">-->
|
||||||
|
<style name="LaunchTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||||
<!-- Show a splash screen on the activity. Automatically removed when
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
the Flutter engine draws its first frame -->
|
the Flutter engine draws its first frame -->
|
||||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
@@ -12,7 +13,8 @@
|
|||||||
running.
|
running.
|
||||||
|
|
||||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
<!-- <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">-->
|
||||||
|
<style name="NormalTheme" parent="Theme.MaterialComponents">
|
||||||
<item name="android:windowBackground">?android:colorBackground</item>
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||||
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
<!-- <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">-->
|
||||||
|
<style name="LaunchTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<!-- Show a splash screen on the activity. Automatically removed when
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
the Flutter engine draws its first frame -->
|
the Flutter engine draws its first frame -->
|
||||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
@@ -12,7 +13,8 @@
|
|||||||
running.
|
running.
|
||||||
|
|
||||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
<!-- <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">-->
|
||||||
|
<style name="NormalTheme" parent="Theme.MaterialComponents">
|
||||||
<item name="android:windowBackground">?android:colorBackground</item>
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -34,8 +34,13 @@ class TextExtractionController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> pickAndExtractText() async {
|
Future<void> pickAndExtractText() async {
|
||||||
final pickedImage =
|
final pickedImage = await ImagePicker().pickImage(
|
||||||
await ImagePicker().pickImage(source: ImageSource.camera);
|
source: ImageSource.camera,
|
||||||
|
preferredCameraDevice: CameraDevice.rear,
|
||||||
|
maxHeight: Get.height * .7,
|
||||||
|
maxWidth: Get.width * .9,
|
||||||
|
imageQuality: 99,
|
||||||
|
);
|
||||||
if (pickedImage != null) {
|
if (pickedImage != null) {
|
||||||
isloading = true;
|
isloading = true;
|
||||||
update();
|
update();
|
||||||
@@ -51,7 +56,8 @@ class TextExtractionController extends GetxController {
|
|||||||
languages.join('+'), // Combine multiple languages with '+'
|
languages.join('+'), // Combine multiple languages with '+'
|
||||||
args: {
|
args: {
|
||||||
"psm": "4",
|
"psm": "4",
|
||||||
"preserve_interword_spaces": "1",
|
"preserve_interword_spaces":
|
||||||
|
"1", // "rectangle": Rect.fromLTWH(100, 100, 200, 200),
|
||||||
} // Additional options if needed
|
} // Additional options if needed
|
||||||
);
|
);
|
||||||
isloading = false;
|
isloading = false;
|
||||||
@@ -73,7 +79,6 @@ class TextExtractionController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class TextMLGoogleRecognizerController extends GetxController {
|
class TextMLGoogleRecognizerController extends GetxController {
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
|
|||||||
@@ -176,14 +176,6 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
// );
|
// );
|
||||||
},
|
},
|
||||||
child: const Icon(MaterialIcons.message)),
|
child: const Icon(MaterialIcons.message)),
|
||||||
TextButton(
|
|
||||||
onPressed: () {
|
|
||||||
Get.to(() => TextScanner());
|
|
||||||
},
|
|
||||||
child: const Text(
|
|
||||||
"Text Scanner",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.to(() => TextExtractionView());
|
Get.to(() => TextExtractionView());
|
||||||
|
|||||||
@@ -4,63 +4,6 @@ import 'package:ride/views/widgets/mycircular.dart';
|
|||||||
|
|
||||||
import '../../../controller/functions/ocr_controller.dart';
|
import '../../../controller/functions/ocr_controller.dart';
|
||||||
|
|
||||||
class TextScanner extends StatelessWidget {
|
|
||||||
TextScanner({super.key});
|
|
||||||
|
|
||||||
final OCRController controller = Get.put(OCRController());
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: const Text('Flutter Scalable OCR'),
|
|
||||||
),
|
|
||||||
body: Center(
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
// ScalableOCR(
|
|
||||||
// paintboxCustom: Paint()
|
|
||||||
// ..style = PaintingStyle.stroke
|
|
||||||
// ..strokeWidth = 4.0
|
|
||||||
// ..color = const Color.fromARGB(153, 102, 160, 241),
|
|
||||||
// boxLeftOff: 5,
|
|
||||||
// boxBottomOff: 2.5,
|
|
||||||
// boxRightOff: 5,
|
|
||||||
// boxTopOff: 2.5,
|
|
||||||
// boxHeight: MediaQuery.of(context).size.height / 3,
|
|
||||||
// getRawData: (value) {
|
|
||||||
// // Inspect the raw data here.
|
|
||||||
// },
|
|
||||||
// getScannedText: (value) {
|
|
||||||
// controller.setText(value);
|
|
||||||
// }),
|
|
||||||
|
|
||||||
Result(),
|
|
||||||
Obx(() {
|
|
||||||
return SnackBar(
|
|
||||||
content: Text(controller.text.value),
|
|
||||||
);
|
|
||||||
})
|
|
||||||
],
|
|
||||||
),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Result extends StatelessWidget {
|
|
||||||
Result({
|
|
||||||
Key? key,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
final OCRController controller = Get.find();
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Text("Readed text: ${controller.text.value}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class TextExtractionView extends StatelessWidget {
|
class TextExtractionView extends StatelessWidget {
|
||||||
TextExtractionView({super.key});
|
TextExtractionView({super.key});
|
||||||
|
|
||||||
@@ -106,7 +49,6 @@ class TextRecognizerWidget extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// class TesseractWidget extends StatelessWidget {
|
// class TesseractWidget extends StatelessWidget {
|
||||||
// final TesseractController controller = Get.put(TesseractController());
|
// final TesseractController controller = Get.put(TesseractController());
|
||||||
|
|
||||||
@@ -143,10 +85,6 @@ class TextRecognizerWidget extends StatelessWidget {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// import 'package:flutter/material.dart';
|
// import 'package:flutter/material.dart';
|
||||||
// import 'package:get/get.dart';
|
// import 'package:get/get.dart';
|
||||||
// import 'package:image_picker/image_picker.dart';
|
// import 'package:image_picker/image_picker.dart';
|
||||||
|
|||||||
40
pubspec.lock
40
pubspec.lock
@@ -398,6 +398,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.2.0"
|
version: "5.2.0"
|
||||||
|
flutter_stripe:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_stripe
|
||||||
|
sha256: "7ad314650f6b794e7006a6f906ddbde548fff4e4cff7ad618452728c6b895d1e"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "9.5.0+1"
|
||||||
flutter_tesseract_ocr:
|
flutter_tesseract_ocr:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -416,6 +424,14 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
freezed_annotation:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: freezed_annotation
|
||||||
|
sha256: c3fd9336eb55a38cc1bbd79ab17573113a8deccd0ecbbf926cca3c62803b5c2d
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.1"
|
||||||
geolocator:
|
geolocator:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -981,6 +997,30 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.2.0"
|
||||||
|
stripe_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: stripe_android
|
||||||
|
sha256: c3a4398a777e4378bbc528e7244a73bcd3e6c6d807fce5bb8bcabc21d31abe8c
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "9.5.0+1"
|
||||||
|
stripe_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: stripe_ios
|
||||||
|
sha256: "2756ea9bb3ced403bb7bd97b8bfd3ff2d44e481d613f6150fedb38f70947af11"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "9.5.0+1"
|
||||||
|
stripe_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: stripe_platform_interface
|
||||||
|
sha256: "078142b37e3b7a40f7f9f30428bc3fd3234c493b9b4269ae6f298b7fcfa40f33"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "9.5.0+1"
|
||||||
synchronized:
|
synchronized:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -38,15 +38,11 @@ dependencies:
|
|||||||
crypto: ^3.0.3
|
crypto: ^3.0.3
|
||||||
flutter_rating_bar: ^4.0.1
|
flutter_rating_bar: ^4.0.1
|
||||||
flutter_font_icons: ^2.2.5
|
flutter_font_icons: ^2.2.5
|
||||||
# flutter_charts: ^0.5.2
|
|
||||||
device_info_plus: ^9.1.0
|
device_info_plus: ^9.1.0
|
||||||
# flutter_scalable_ocr: ^2.0.0
|
|
||||||
image_picker: ^1.0.4
|
image_picker: ^1.0.4
|
||||||
flutter_tesseract_ocr: ^0.4.24
|
flutter_tesseract_ocr: ^0.4.24
|
||||||
# document_scanner_flutter: ^0.2.7
|
|
||||||
# ocr_scan_text: ^1.3.1
|
|
||||||
# tesseract_latest: ^0.0.2
|
|
||||||
google_mlkit_text_recognition: ^0.10.0
|
google_mlkit_text_recognition: ^0.10.0
|
||||||
|
flutter_stripe: ^9.5.0+1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user