Skip to content

[framework] Add textField OCR support for framework side - #96637

Merged
justinmc merged 69 commits into
flutter:masterfrom
luckysmg:ios_text_ocr
Jul 6, 2023
Merged

justinmc merged 69 commits into
flutter:masterfrom
luckysmg:ios_text_ocr

Conversation

@luckysmg

@luckysmg luckysmg commented Jan 14, 2022 •

Copy link
Copy Markdown
Contributor

Preview

12.26.mp4

Related PR in flutter engine (merged):

List which issues are fixed by this PR. You must list at least one issue.
#91896

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@flutter-dashboard flutter-dashboard Bot added a: text input Entering text in a text field or keyboard related problems p: cupertino_ui cupertino_ui package in flutter/packages framework flutter/packages/flutter repository. See also f: labels. labels Jan 14, 2022
@luckysmg
luckysmg marked this pull request as draft January 14, 2022 01:43
@luckysmg luckysmg changed the title Ios text ocr [WIP] Support ios text ocr Feb 4, 2022
@Hixie

Hixie commented May 24, 2022

Copy link
Copy Markdown
Contributor

@luckysmg Is this still something you are working on? I'm just asking because I'm trying to clean out our review queue.

@luckysmg

luckysmg commented May 25, 2022 via email

Copy link
Copy Markdown
Contributor Author

@luckysmg luckysmg changed the title [WIP] Support ios text ocr [WIP] Add textField OCR support for framework side May 28, 2022
@luckysmg

luckysmg commented Jun 1, 2022 •

Copy link
Copy Markdown
Contributor Author

The engine side is working around and ready for review.
flutter-team-archive/engine#34751

After engine side PR merged, work in framework side(here) will start.

@flutter-dashboard flutter-dashboard Bot added the p: material_ui material_ui package in flutter/packages label Jul 19, 2022
Comment thread packages/flutter/lib/src/cupertino/text_selection_toolbar_button.dart Outdated
Comment thread packages/flutter/lib/src/services/live_text_support.dart Outdated
Comment thread packages/flutter/lib/src/services/live_text_support.dart Outdated
Comment thread packages/flutter/lib/src/services/live_text_support.dart Outdated
Comment thread packages/flutter/lib/src/services/text_input.dart Outdated
Comment thread packages/flutter/lib/src/services/text_input.dart Outdated
Comment thread packages/flutter/lib/src/widgets/editable_text.dart Outdated
Comment thread packages/flutter/lib/src/widgets/text_selection.dart Outdated
@Hixie

Hixie commented Dec 14, 2022

Copy link
Copy Markdown
Contributor

@luckysmg Are you still working on this? Looks like you did good progress since the last time I asked. :-)

@luckysmg

luckysmg commented Dec 14, 2022 •

Copy link
Copy Markdown
Contributor Author

Hi @Hixie Very apologize on this.Before I was thinking to work after #107193 merged, because with that code will be more clear and easier. Now, it has been merged and I will continue this work. (^▽^)

@luckysmg luckysmg reopened this Dec 15, 2022
@luckysmg

luckysmg commented Dec 15, 2022 •

Copy link
Copy Markdown
Contributor Author

HI @Hixie.

I come across two things.

  1. I need a iOS style scan text icon, but I can't find it in CupertinoIcons, would you mind telling me how to get that or how to add it to framework? ^_^
  2. Is there a way to regenerate the arb file? I want add a new localiztion text string scanTextButtonLabel. Or I should manually add it for all different languages ?
    O(∩_∩)O

@luckysmg

Copy link
Copy Markdown
Contributor Author

Hi @justinmc. Would you mind sharing your thoughts on current implementation? O(∩_∩)O

"continueButtonLabel": "جاری رکھیں",
"copyButtonLabel": "کاپی کریں",
"cutButtonLabel": "کٹ کریں",
"scanTextButtonLabel": "متن کو اسکین کریں۔",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this has been updated as follows:

-  "scanTextButtonLabel": "متن اسکین کریں۔",
+  "scanTextButtonLabel": "متن کو اسکین کریں۔",

There's an extra word but the Arabic full stop character ('۔') is still there.

canvas.transform(rotationMatrix.storage);
}

// Draw three lines.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there are still some doubles without decimal point in this method and possibly elsewhere e.g.:
..lineTo(origin.dx, origin.dy + 1)
canvas.drawLine(const Offset(-3, 0), const Offset(3, 0), _painter);

@tgucio

tgucio commented Jul 5, 2023

Copy link
Copy Markdown
Contributor

@luckysmg I've LGTM'd with nits: remaining full stop in Urdu l10n and some doubles without decimal point in text_selection_toolbar_button.dart - could you look into those before merging?

@luckysmg

luckysmg commented Jul 5, 2023 •

Copy link
Copy Markdown
Contributor Author

Yes. I ll take a look before merging... Will change. ^_^

Before I didn't understand your meaning very well haha ^_^

@luckysmg

luckysmg commented Jul 5, 2023

Copy link
Copy Markdown
Contributor Author

@tgucio I think all nits done. You can take a look

@luckysmg

luckysmg commented Jul 5, 2023

Copy link
Copy Markdown
Contributor Author

Also @justinmc would you mind help to take a look that why google testing still not completed? ^_^

@justinmc

justinmc commented Jul 6, 2023

Copy link
Copy Markdown
Contributor

Google tests look fine despite the stuck "pending" status. I tried to change the status but it is giving an HTTP error. Merging.

@justinmc
justinmc merged commit e0ad129 into flutter:master Jul 6, 2023
@justinmc

justinmc commented Jul 6, 2023

Copy link
Copy Markdown
Contributor

@luckysmg Thanks for all your work here!

@Void48

Void48 commented Jul 6, 2023

Copy link
Copy Markdown

@luckysmg gj :)

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 7, 2023
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jul 7, 2023
flutter/flutter@bc49cd1...d55a7d8

2023-07-07 [email protected] Revert "fix a bug when android uses CupertinoPageTransitionsBuilder..." (flutter/flutter#130144)
2023-07-07 [email protected] Roll Packages from 771ec9b to 9bcf4bf (12 revisions) (flutter/flutter#130143)
2023-07-07 [email protected] Roll Flutter Engine from 650ff096488a to 8aa2e6516af1 (1 revision) (flutter/flutter#130116)
2023-07-07 [email protected] Roll Flutter Engine from 1fa222fae283 to 650ff096488a (3 revisions) (flutter/flutter#130114)
2023-07-07 [email protected] Roll Flutter Engine from 491f317978f4 to 1fa222fae283 (1 revision) (flutter/flutter#130110)
2023-07-07 [email protected] Roll Flutter Engine from 48bf7ac59254 to 491f317978f4 (2 revisions) (flutter/flutter#130107)
2023-07-06 [email protected] Roll Flutter Engine from 42df55a9e63e to 48bf7ac59254 (1 revision) (flutter/flutter#130106)
2023-07-06 [email protected] Super tiny code optimization: No need to redundantly check whether value has changed (flutter/flutter#130050)
2023-07-06 [email protected] Roll Flutter Engine from 06c936205d96 to 42df55a9e63e (3 revisions) (flutter/flutter#130100)
2023-07-06 [email protected] Manual roll Flutter Engine from bd2e42b203e1 to 06c936205d96 (27 revisions) (flutter/flutter#130097)
2023-07-06 [email protected] Marks Linux firebase_oriol33_abstract_method_smoke_test to be unflaky (flutter/flutter#128398)
2023-07-06 [email protected] Next attempt to make inspector weakly referencing the inspected objects. (flutter/flutter#129962)
2023-07-06 [email protected] [a11y] CupertinoSwitch On/Off labels (flutter/flutter#127776)
2023-07-06 [email protected] Add option for flexible space on material SearchDelegate (flutter/flutter#128132)
2023-07-06 [email protected] Roll Packages from 7042079 to 771ec9b (12 revisions) (flutter/flutter#130077)
2023-07-06 [email protected] [framework] Add textField OCR support for framework side (flutter/flutter#96637)
2023-07-06 [email protected] [flutter_tools] modify Skeleton template to use ListenableBuilder instead of AnimatedBuilder (flutter/flutter#128810)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
@justinmc

Copy link
Copy Markdown
Contributor

Congrats to @luckysmg and @tgucio for the shout out in the 3.13 blog post! https://medium.com/flutter/whats-new-in-flutter-3-13-479d9b11df4d

@JSUYA JSUYA mentioned this pull request Sep 8, 2023
4 tasks done
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
flutter/flutter@bc49cd1...d55a7d8

2023-07-07 [email protected] Revert "fix a bug when android uses CupertinoPageTransitionsBuilder..." (flutter/flutter#130144)
2023-07-07 [email protected] Roll Packages from 771ec9b to 9bcf4bf (12 revisions) (flutter/flutter#130143)
2023-07-07 [email protected] Roll Flutter Engine from 650ff096488a to 8aa2e6516af1 (1 revision) (flutter/flutter#130116)
2023-07-07 [email protected] Roll Flutter Engine from 1fa222fae283 to 650ff096488a (3 revisions) (flutter/flutter#130114)
2023-07-07 [email protected] Roll Flutter Engine from 491f317978f4 to 1fa222fae283 (1 revision) (flutter/flutter#130110)
2023-07-07 [email protected] Roll Flutter Engine from 48bf7ac59254 to 491f317978f4 (2 revisions) (flutter/flutter#130107)
2023-07-06 [email protected] Roll Flutter Engine from 42df55a9e63e to 48bf7ac59254 (1 revision) (flutter/flutter#130106)
2023-07-06 [email protected] Super tiny code optimization: No need to redundantly check whether value has changed (flutter/flutter#130050)
2023-07-06 [email protected] Roll Flutter Engine from 06c936205d96 to 42df55a9e63e (3 revisions) (flutter/flutter#130100)
2023-07-06 [email protected] Manual roll Flutter Engine from bd2e42b203e1 to 06c936205d96 (27 revisions) (flutter/flutter#130097)
2023-07-06 [email protected] Marks Linux firebase_oriol33_abstract_method_smoke_test to be unflaky (flutter/flutter#128398)
2023-07-06 [email protected] Next attempt to make inspector weakly referencing the inspected objects. (flutter/flutter#129962)
2023-07-06 [email protected] [a11y] CupertinoSwitch On/Off labels (flutter/flutter#127776)
2023-07-06 [email protected] Add option for flexible space on material SearchDelegate (flutter/flutter#128132)
2023-07-06 [email protected] Roll Packages from 7042079 to 771ec9b (12 revisions) (flutter/flutter#130077)
2023-07-06 [email protected] [framework] Add textField OCR support for framework side (flutter/flutter#96637)
2023-07-06 [email protected] [flutter_tools] modify Skeleton template to use ListenableBuilder instead of AnimatedBuilder (flutter/flutter#128810)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
flutter/flutter@bc49cd1...d55a7d8

2023-07-07 [email protected] Revert "fix a bug when android uses CupertinoPageTransitionsBuilder..." (flutter/flutter#130144)
2023-07-07 [email protected] Roll Packages from cedd34c to 1b6f41e (12 revisions) (flutter/flutter#130143)
2023-07-07 [email protected] Roll Flutter Engine from 650ff096488a to 8aa2e6516af1 (1 revision) (flutter/flutter#130116)
2023-07-07 [email protected] Roll Flutter Engine from 1fa222fae283 to 650ff096488a (3 revisions) (flutter/flutter#130114)
2023-07-07 [email protected] Roll Flutter Engine from 491f317978f4 to 1fa222fae283 (1 revision) (flutter/flutter#130110)
2023-07-07 [email protected] Roll Flutter Engine from 48bf7ac59254 to 491f317978f4 (2 revisions) (flutter/flutter#130107)
2023-07-06 [email protected] Roll Flutter Engine from 42df55a9e63e to 48bf7ac59254 (1 revision) (flutter/flutter#130106)
2023-07-06 [email protected] Super tiny code optimization: No need to redundantly check whether value has changed (flutter/flutter#130050)
2023-07-06 [email protected] Roll Flutter Engine from 06c936205d96 to 42df55a9e63e (3 revisions) (flutter/flutter#130100)
2023-07-06 [email protected] Manual roll Flutter Engine from bd2e42b203e1 to 06c936205d96 (27 revisions) (flutter/flutter#130097)
2023-07-06 [email protected] Marks Linux firebase_oriol33_abstract_method_smoke_test to be unflaky (flutter/flutter#128398)
2023-07-06 [email protected] Next attempt to make inspector weakly referencing the inspected objects. (flutter/flutter#129962)
2023-07-06 [email protected] [a11y] CupertinoSwitch On/Off labels (flutter/flutter#127776)
2023-07-06 [email protected] Add option for flexible space on material SearchDelegate (flutter/flutter#128132)
2023-07-06 [email protected] Roll Packages from 8b9ce45 to cedd34c (12 revisions) (flutter/flutter#130077)
2023-07-06 [email protected] [framework] Add textField OCR support for framework side (flutter/flutter#96637)
2023-07-06 [email protected] [flutter_tools] modify Skeleton template to use ListenableBuilder instead of AnimatedBuilder (flutter/flutter#128810)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: internationalization Supporting other languages or locales. (aka i18n) a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. p: cupertino_ui cupertino_ui package in flutter/packages p: material_ui material_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants