Skip to content

feat(bloc_concurrency): add visual example app #4551

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

Conversation

kirannonstop
Copy link

Status

READY

Breaking Changes

NO

Description

Added movable ball demo example by considering the below transformers provided by bloc_concurrency

  1. sequential()
  2. concurrent()
  3. droppable()
  4. restartable()
  5. debounceTime(Duration)
  6. throttleTime(Duration)

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@kirannonstop kirannonstop requested a review from felangel as a code owner July 2, 2025 11:05
Copy link
Owner

@felangel felangel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! This looks great 💙
I'll take a closer look and try to get this merged later today.

@felangel felangel added example Example application pkg:bloc_concurrency This issue is related to the bloc_concurrency package labels Jul 2, 2025
@felangel felangel changed the title Feat (example)- bloc_cocurrency example using Movable Ball demo feat(bloc_concurrency): add visual example app Jul 2, 2025
Copy link
Author

@kirannonstop kirannonstop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self review done

@kirannonstop
Copy link
Author

Thanks for the contribution! This looks great 💙 I'll take a closer look and try to get this merged later today.

Sure, thanks @felangel .
Kindly let me know if any further changes are required.

@kirannonstop
Copy link
Author

kirannonstop commented Jul 4, 2025

Hi @felangel ,I added test cases for this bloc_concurrency example. Can you please review it too?

Copy link
Author

@kirannonstop kirannonstop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test cases self-review done

@felangel
Copy link
Owner

felangel commented Jul 8, 2025

Sorry for the delay! This is next on my list of PRs to review (should have some time tomorrow).

@kirannonstop
Copy link
Author

Hello @felangel , I updated docs too. It would be great if you could review this PR ? and if any changes are required, kindly suggest me. Thanks!

@felangel
Copy link
Owner

Hello @felangel , I updated docs too. It would be great if you could review this PR ? and if any changes are required, kindly suggest me. Thanks!

Thanks so much! Yup it’s next on my list of things to do. I’ll get it merged by this weekend, apologies for the delay!

Copy link
Owner

@felangel felangel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to make this contribution! I took a look and I think we should try to simplify the demo just to make it easier to maintain and to reduce the complexity while still conveying the same information. Since bloc_concurrency was heavily inspired by ember concurrency, what are your thoughts on refactoring the example to be more inline with the ember concurrency demos at https://ember-concurrency.com/docs/task-concurrency/

I think the bridge tab is currently a bit too complex with lots of magic numbers in code like:

                     // Animated balls on bridge
                      ...state.ballsOnBridge.map((ball) {
                        final screenWidth =
                            MediaQuery.of(context).size.width -
                            32 -
                            50; // Account for padding and platforms
                        final leftPosition =
                            25 +
                            (ball.position *
                                (screenWidth -
                                    50)); // 25 = start platform width

I'd very much prefer to keep examples as simple and easy to maintain as possible and while I think your initiative of making an example that demonstrates bloc_concurrency is a great one, I think the current example has a lot of added complexity that we can eliminate. Let me know what you think and thanks again for taking the time to contribute!

@kirannonstop
Copy link
Author

Sure thank you @felangel ,I will check this demo and will refactor the code.

@felangel
Copy link
Owner

Sure thank you @felangel ,I will check this demo and will refactor the code.

Thanks so much! Going to close this for now and look forward to reviewing the simplified example 🙏

@felangel felangel closed this Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example Example application pkg:bloc_concurrency This issue is related to the bloc_concurrency package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants