Skip to content

Conversation

@alex-melnyk
Copy link

@alex-melnyk alex-melnyk commented Oct 16, 2025

  • Dart classes/structure extracted to a separate files
  • Dart classes/structure naming fixed
  • Upgrade AGP to 8.13
  • Updated Kotlin to 2.1.0
  • Convert Java classes to Kotlin

@alex-melnyk alex-melnyk changed the title code formatting fix Code improvements Oct 16, 2025
@rajada1 rajada1 requested a review from Copilot October 16, 2025 12:23
Copy link

Copilot AI left a 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 DocumentScanKitOptionsiOS to DocumentScanKitOptionsIOS and ModalPresentationStyle to ModalPresentationStyleIOS for 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.

@alex-melnyk alex-melnyk requested a review from Copilot October 16, 2025 13:23
Copy link

Copilot AI left a 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.

@alex-melnyk alex-melnyk requested a review from Copilot October 16, 2025 13:42
Copy link

Copilot AI left a 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.

@rajada1
Copy link
Owner

rajada1 commented Oct 16, 2025

Thanks @alex-melnyk for this PR!
I'm currently working on new features for the plugin in the version/0.2.0 branch.

I'm improving text reading using isolates and adding a more detailed text extraction method that can capture text line by line.
Currently, the text is segmented into blocks. For example:

item 1          value              $3  
item 2          value              $99

When reading an image like this, the current method returns:

item 1  
item 2  
value  
value  
$3  
$99

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:

item 1 value $3  
item 2 value $99

@alex-melnyk
Copy link
Author

Thanks @alex-melnyk for this PR! I'm currently working on new features for the plugin in the version/0.2.0 branch.

I'm improving text reading using isolates and adding a more detailed text extraction method that can capture text line by line. Currently, the text is segmented into blocks. For example:

item 1          value              $3  
item 2          value              $99

When reading an image like this, the current method returns:

item 1  
item 2  
value  
value  
$3  
$99

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:

item 1 value $3  
item 2 value $99

Thank you for the response, changes I did is only affects to the document scan feature.
Also, there where added saving to a single PDF file all scanned files.

It would be great if you review changes to create another release of the plugin, otherwise I would need to use my git fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants