-
Notifications
You must be signed in to change notification settings - Fork 7
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
added onFieldSubmitted callback #22
Conversation
Hi, Great work and Thanks for the PR. So glad you wrote tests as well. 👍 💯 My thoughts on your notes 👇 .
Todo
|
Codecov Report
@@ Coverage Diff @@
## master #22 +/- ##
===========================================
- Coverage 100.00% 99.08% -0.92%
===========================================
Files 1 1
Lines 210 219 +9
===========================================
+ Hits 210 217 +7
- Misses 0 2 +2
Continue to review full report at Codecov.
|
Ok formatting fixed and readme updated. P.S. I initially created this pull request using my master branch rather than a separate branch, hope that's ok. |
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.
OK I remove the print for time being. Merge and release it. If you need it we will discuss again how to proceed with that. Maybe with an error message or something.
? int.parse(value) | ||
: double.parse(value); | ||
} catch (e) { | ||
print("cannot convert $value into a number, e=$e"); |
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.
If you don't need this print statement, shall I remove it. I am not a big fan of print statements in code.
Once again thanks a lot for the PR. I will make a minor release of the same.. 😃 🥳 |
No worries re the print. Thanks for accepting the PR. Cheers. |
I think your I noticed a couple of other things:
As for the nuances re respecting the inc decrement factor - that's interesting.
|
I noticed both these issues while testing. This is because the
It is trickier like you said. As for the interpretation I prefer to go with the second one and create a flag for first mode interpretation, if someone raises an issue with a valid use case. I have to think about a correct way to enforce the second interpretation. If this min/max/inc fields are inconsistent it can be raised as an assertion error with a a warning of in consistent or possible missing values. I will give this a thought, meanwhile I will raise an issue for the first two points, so that we can track the discussion there. The interepretation of min/max/incFactor combo can be tracked via #23 I will update the description there. |
I have exposed an
onSubmitted
callback, including a test.Exposing this was requested in #20
I needed this feature for one of my projects. The widget allowed the user to enter in text values but it was difficult to be notified of such changes and to validate them.
Notes
I introduced
typedef void ValueCallBack(num newValue);
for the type of theonSubmitted
property, however that could be changed to a better name, and documented better. I could have re-used theDiffIncDecCallBack
type but that didn't seem right.The property is exposed as
onSubmitted
- perhaps it should be exposed asonFieldSubmitted
.