-
Notifications
You must be signed in to change notification settings - Fork 273
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(rxdart_flutter): add ValueStream widgets #782
Conversation
Add three new Flutter widgets for working with ValueStreams: - `ValueStreamBuilder`: A widget that rebuilds UI based on `ValueStream` updates - `ValueStreamListener`: A widget that performs side effects when `ValueStream` values change - `ValueStreamConsumer`: A widget combining both builder and listener capabilities for `ValueStream`s Features: - Optimized for ValueStreams with required initial values - Proper error handling for streams without values/with errors - Optional buildWhen condition for controlling rebuilds - Access to previous/current values in listeners - 100% test coverage - Detailed documentation and examples
Thank you for your PR, I will take a look at it ASAP. |
Enhance error handling in `validateValueStreamInitialValue` by: - Preserving the original stream's stack trace when available - Falling back to `StackTrace.current` only when no stack trace is present
…dencies - Remove local import of rxdart_flutter.dart - Add direct import of rxdart package - Import ValueStreamListener - Streamline import statements for better modularity
…handling Improve the initial value handling in ValueStreamListener by: - Dynamically adjusting skip count based on initialization state - Removing post-frame callback for initial value notification
- Remove null assertion from currentValue in ValueStreamBuilder and ValueStreamConsumer - Add test cases for nullable types - Improve test variable naming for better readability
…gets - Update ValueStreamBuilder, ValueStreamConsumer, and related tests to support an optional `child` parameter - Modify builder signatures to include child widget - Add documentation explaining the purpose and usage of the child parameter - Enhance example code to demonstrate stable child widget usage - Replace BehaviorSubject with ValueStream in tests apps
- Introduce `isReplayValueStream` parameter to ValueStream widgets - Update ValueStreamBuilder, ValueStreamConsumer, and ValueStreamListener to handle non-replay streams - Add comprehensive test cases for non-replay stream scenarios - Modify listener and builder behaviors based on stream replay configuration - Update debug properties to include `isReplayValueStream`
It looks good to me 🙏 Could you please update the flutter_search sample as well? It seems that the builder signature has been changed (with the addition of child param).
|
…nclude child parameter
…ner issues Updated package dependencies via flutter pub upgrade to fix build_runner execution failures.
- Add network client entitlements for debug and release configurations - Update AppDelegate with @main annotation and secure restorable state method - Upgrade Xcode project to version 1510 - Add RunnerTests target with a basic test case - Simplify FlutterViewController initialization
Improve stream skipping logic in ValueStreamListener by: - Conditionally applying skip only when skipCount is greater than 0 - Simplify stream listening mechanism
I did it and added support for macOS. It had some issues when running 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.
Thanks for your hard work 👍 ! The CI failed, but I'll fix it in another PR 🙏.
Add three new Flutter widgets for working with ValueStreams:
ValueStreamBuilder
: A widget that rebuilds UI based onValueStream
updatesValueStreamListener
: A widget that performs side effects whenValueStream
values changeValueStreamConsumer
: A widget combining both builder and listener capabilities forValueStream
sFeatures:
Closes #779