-
-
Notifications
You must be signed in to change notification settings - Fork 191
HookWidget.debugFillProperties using HookState.diagnosticsProperty #178
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
HookWidget.debugFillProperties using HookState.diagnosticsProperty #178
Conversation
Codecov Report
@@ Coverage Diff @@
## master #178 +/- ##
==========================================
+ Coverage 99.62% 99.67% +0.05%
==========================================
Files 10 10
Lines 531 616 +85
==========================================
+ Hits 529 614 +85
Misses 2 2
Continue to review full report at Codecov.
|
|
Thanks! We will need some tests for this. |
|
|
||
| /// The logic and internal state for a [HookWidget] | ||
| abstract class HookState<R, T extends Hook<R>> { | ||
| abstract class HookState<R, T extends Hook<R>> with Diagnosticable { |
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.
Hook probably should be Diagnosticable too.
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.
What's the need to make Hook diagnosticable?
StatelessWidget is Diagnosticable, but StatefulWidget isn't. Instead, State is Diagnosticable. In this case, Hook is like StatefulWidget and HookState is like State.
|
Covered doesn't mean tested. We need a test that verifies that A good start may be to have some existing hooks override debugFillProperties, like useState/useMemoized, and test that it works properly. |
|
I don't find a way to test the debugFillProperties. Do you have any suggestion? |
|
@rrousselGit I found a way to test de |
…into debug_fill_properties
|
Tests for useState and useMemoized where added |
|
Thanks, sorry for the delay. |
|
I'll do that tomorrow. And the Diagnostics must be updated such that we can have: |
HookWidget.debugFillProperties using HookState.diagnosticsProperty

In the package example, the widget inspector for the useState example shows nothing about the hook state:
With this new feature, if these lines are added to the
_StateHookState, this will be shown int the widget inspector.