-
Notifications
You must be signed in to change notification settings - Fork 5
Code improvements #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the codebase to improve structure and maintainability by extracting Dart classes into separate files, fixing naming conventions (iOS suffix), and modernizing the Android implementation by upgrading AGP to 8.13.0, Kotlin to 2.1.0, and converting Java classes to Kotlin with coroutine-based async handling.
Key Changes
- Renamed
DocumentScanKitOptionsiOStoDocumentScanKitOptionsIOSandModalPresentationStyletoModalPresentationStyleIOSfor consistency - Extracted Dart model classes into separate files under
lib/src/models/directory - Converted Android implementation from Java to Kotlin with improved coroutine-based architecture
Reviewed Changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/doc_scan_kit_test.dart | Updated to use corrected iOS class name and const constructor |
| test/doc_scan_kit_method_channel_test.dart | Updated imports and class names with const constructors |
| lib/src/models/scan_result.dart | Extracted ScanResult model with immutable fields and documentation |
| lib/src/models/modal_presentation_style_ios.dart | Extracted iOS modal presentation enum with proper naming |
| lib/src/models/ios_options.dart | Refactored iOS options class with inheritance and corrected naming |
| lib/src/models/doc_scan_kit_options.dart | New base class for platform options |
| lib/src/models/android_options.dart | Refactored Android options with inheritance and extracted enum |
| lib/src/models/scanner_mode_android.dart | Extracted Android scanner mode enum |
| lib/src/doc_scan_kit_platform_interface.dart | Updated imports to use models directory |
| lib/src/doc_scan_kit_method_channel.dart | Improved code formatting and updated to use corrected class names |
| lib/src/doc_scan.dart | Added const constructors and comprehensive documentation |
| lib/doc_scan_kit.dart | Updated exports to include new model files |
| example/lib/main.dart | Updated to use corrected iOS class names and initialValue property |
| example/integration_test/plugin_integration_test.dart | Simplified with const constructors and type inference |
| example/android/settings.gradle | Upgraded AGP to 8.13.0 and Kotlin to 2.1.0 |
| example/android/gradle/wrapper/gradle-wrapper.properties | Updated Gradle wrapper to 8.13 |
| android/src/main/kotlin/com/rajada1_docscan_kit/doc_scan_kit/TextRecognizer.kt | Converted from Java to Kotlin with coroutines |
| android/src/main/kotlin/com/rajada1_docscan_kit/doc_scan_kit/DocumentScanner.kt | Converted from Java to Kotlin with improved async handling |
| android/src/main/kotlin/com/rajada1_docscan_kit/doc_scan_kit/DocScanKitPlugin.kt | Converted from Java to Kotlin with proper lifecycle management |
| android/src/main/kotlin/com/rajada1_docscan_kit/doc_scan_kit/DocScanBarcodeScanner.kt | Converted from Java to Kotlin with coroutines |
| android/build.gradle | Updated Kotlin to 2.1.0 and AGP to 8.13.0 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 38 out of 38 changed files in this pull request and generated 5 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
android/src/main/kotlin/com/rajada1_docscan_kit/doc_scan_kit/DocumentScanner.kt
Show resolved
Hide resolved
android/src/main/kotlin/com/rajada1_docscan_kit/doc_scan_kit/TextRecognizer.kt
Outdated
Show resolved
Hide resolved
android/src/main/kotlin/com/rajada1_docscan_kit/doc_scan_kit/DocumentScanner.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 41 out of 41 changed files in this pull request and generated 6 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
android/src/main/kotlin/com/rajada1_docscan_kit/doc_scan_kit/DocumentScanner.kt
Outdated
Show resolved
Hide resolved
android/src/main/kotlin/com/rajada1_docscan_kit/doc_scan_kit/DocScanBarcodeScanner.kt
Show resolved
Hide resolved
|
Thanks @alex-melnyk for this PR! I'm improving text reading using isolates and adding a more detailed text extraction method that can capture text line by line. When reading an image like this, the current method returns: Because of the spacing between blocks, the text gets segmented in a way I don’t want. I’ll keep the current method (now with new parameters) and add a new one for better scanning, where the expected result would be: |
Thank you for the response, changes I did is only affects to the document scan feature. It would be great if you review changes to create another release of the plugin, otherwise I would need to use my git fork. |
Uh oh!
There was an error while loading. Please reload this page.