Skip to content
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

Use sharedDarwinSource to share MacOS and iOS implementation details #782

Open
navaronbracke opened this issue Oct 12, 2023 · 1 comment
Labels
good first issue Good for newcomers ios Platform iOS macos Platform macos

Comments

@navaronbracke
Copy link
Collaborator

navaronbracke commented Oct 12, 2023

Since the MacOS implementation is very small, it is probably worth it to make use of the new sharedDarwinSource configuration.

Then we can have a single implementation that handles both platforms, which simplifies maintenance.

See https://docs.flutter.dev/packages-and-plugins/developing-packages#shared-ios-and-macos-implementations

This will require bumping the minimum Flutter version to 3.7.0

TODO:

  • the DetectionSpeed.swift file is essentially the same between the two -> deduplicate it
  • the iOS implementation has a BarcodeHandler event sink wrapper, but MacOS does not -> share it between MacOS & iOS
    • a first step for this would be to have MacOS port the BarcodeHandler over from iOS, in a separate PR
  • the main implementation can be shared using available checks where needed
  • We can probably also address Deduplicate isBarcodeInScanWindow #777 with this refactor
  • toggleTorch currently has two implementations, this can be shared and deduplicated
@navaronbracke navaronbracke added good first issue Good for newcomers ios Platform iOS macos Platform macos labels Oct 12, 2023
@juliansteenbakker
Copy link
Owner

Cool, I've been looking for something like this a few months ago but could not find anything. Nice to see this feature in Flutter!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers ios Platform iOS macos Platform macos
Projects
None yet
Development

No branches or pull requests

2 participants