-
-
Notifications
You must be signed in to change notification settings - Fork 271
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:
![Screenshot_1718780020](https://private-user-images.githubusercontent.com/246838/340971737-1185c2e2-d9c2-470c-89d5-a89b82406b1c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxNjc5MjYsIm5iZiI6MTcyNjE2NzYyNiwicGF0aCI6Ii8yNDY4MzgvMzQwOTcxNzM3LTExODVjMmUyLWQ5YzItNDcwYy04OWQ1LWE4OWI4MjQwNmIxYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkxMlQxOTAwMjZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yZmY3MTE1YjEwNzQxNGM2NjNkNzA5ZWY1OTYxODQyYzA4MDgyZmJiYmNiMTkwMTkxYjAyNTVkNDExN2Y3NDQ4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.7oLOJTZAYHJ4dcwhHS4RR4trt8ecdaZ3xsZVn8olxk0)
![Screenshot_1718781981](https://private-user-images.githubusercontent.com/246838/340971744-ad09e24d-2f8e-4f50-ab2c-1bc8060db3bc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxNjc5MjYsIm5iZiI6MTcyNjE2NzYyNiwicGF0aCI6Ii8yNDY4MzgvMzQwOTcxNzQ0LWFkMDllMjRkLTJmOGUtNGY1MC1hYjJjLTFiYzgwNjBkYjNiYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkxMlQxOTAwMjZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04YmQ1Mzk2MzM4MWQ1ZDIyN2IxOTA0MjExOTRiMWFkZTAwMGYxYTZhZDEwNDc5ZTM3ODBkMmM0ZTUwYjBlMWYzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.0taV2UOeBda-PYHuMNjsoOspAen80QuNrT5Q27IndCg)
![Screenshot_1718781984](https://private-user-images.githubusercontent.com/246838/340971751-1ce4776f-9f2c-4687-97f8-fc51766b86f8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVz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