-
-
Notifications
You must be signed in to change notification settings - Fork 279
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
feat: Spellchecker for OCR screens #5409
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.
Hi @g123k!
Please have a look at my comments.
packages/smooth_app/lib/pages/preferences/user_preferences_dev_mode.dart
Outdated
Show resolved
Hide resolved
false) && | ||
(Platform.isAndroid || Platform.isIOS) | ||
? const SpellCheckConfiguration() | ||
: const SpellCheckConfiguration.disabled(), |
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.
: const SpellCheckConfiguration.disabled(), | |
: null, |
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.
null
and SpellCheckConfiguration.disabled()
have different meanings here:
null
= inherits from the configSpellCheckConfiguration.disabled()
= I don't want it at all
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.
null and SpellCheckConfiguration.disabled()
I understand your point.
The thing is that in the app we already have tons of TextField
, with implicitly null
spellCheckConfiguration
s (or "inherits from the config").
I would say that this field should behave as before and should behave as the other TextField
s of the app. Unless the user selects the new dev mode switch. Therefore null
.
), | ||
maxLines: null, | ||
textInputAction: TextInputAction.newline, | ||
ConsumerFilter<UserPreferences>( |
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.
Looks a bit complex to me. A context.watch<UserPreferences>()
would do the job, wouldn't it?
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.
A context.watch
redraws the full Widget (that's a giant flaw in the code right now).
Here, it will only rebuild the field.
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.
A context.watch redraws the full Widget
In that specific case, every time the user preferences change, right? Doesn't happen that often.
If really that bothers you, what about a specific private class with a watch
for the text field?
Tbh I'm getting confused with all that mix of provider, consumer, consumerfilter, changenotifier and so on.
Confusion leads to low maintainability and bugs. It wouldn't be a problem if there were many reviewers with expertise in flutter. If we want to be able to integrate more contributors, the less flutter-specific we code, the better we are. My 2 cents.
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.
Could you also enable it on the Product Name field ?
Hi everyone,
Here is the implementation for #5398, that is to say, a dev mode flag to enable spellchecker on ingredients.
In light mode, our theme defines an
onSurface
white color.Unless we want to rewrite everything, the easier thing is just to redefine locally this color, to prevent a white-on-white color.
To investigate: I think the
ThemeProvider
still has issues.Screenshots: