Commit d34bb1b
committed
Fix DynamicStreamWidget to use watchValue instead of constructor param
The previous example used a constructor parameter with WatchingWidget,
which wouldn't properly re-evaluate when the parameter changes. Now
uses watchValue to get a dynamic value from the manager, which is a
realistic use case for allowStreamChange: true.
Changes:
- Added useStream1 ValueNotifier to StreamManager
- Updated DynamicStreamWidget to use watchValue to get the selection
- Removed constructor parameter that wouldn't work correctly1 parent 98f7388 commit d34bb1b
File tree
2 files changed
+10
-5
lines changed- code_samples/lib/watch_it
2 files changed
+10
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
630 | 633 | | |
631 | 634 | | |
632 | 635 | | |
| 636 | + | |
633 | 637 | | |
634 | 638 | | |
635 | 639 | | |
| |||
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
| 82 | + | |
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
88 | | - | |
89 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
0 commit comments