Skip to content
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

Bloc conversion #69

Closed
wants to merge 5 commits into from
Closed

Conversation

DanKheadies
Copy link

Hello @filiph & @domesticmouse ,

I’m relatively new to making games with Flutter/Dart, and I really appreciate how you guys have some core examples. I’ve been browsing a lot of tutorials and examples, and I was hoping I could contribute to these examples, specifically the state management with bloc. I followed the CONTRIBUTING.md as best I could, so sorry if I missed anything.

My intent was to simplify the state management with bloc and storing / retrieving local data with hydrated bloc. Please feel free to let me know if y’all have any insights or suggestions, and if it would be helpful to make similar PRs to the Card and Endless Runner templates. Again, thanks for putting out this kind of F/D content!

David

Pre-launch Checklist

  • I read the [Flutter Style Guide] recently, and have followed its advice.
  • I signed the [CLA].
  • I read the [Contributors Guide].
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.

Copy link

google-cla bot commented Jul 25, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@DanKheadies
Copy link
Author

Ahh looks like I signed the CLA under my [email protected] email and not my primary email linked to this github account ([email protected]). I've switched my primary email, and will attempt to resign to see if this clears the issue.

@DanKheadies
Copy link
Author

Both emails are accounted for / signed. Let me know if there's anything else I can follow up on.

@filiph
Copy link
Contributor

filiph commented Jul 25, 2024

Hi David,

I appreciate the effort and I agree this is, in many ways, an improvement. But, imho, code samples should always focus on one thing and make everything else as simple to understand as possible. Your new version tackles two things at once: a game sample, and a Bloc sample.

I think it's great that we have this: you should definitely put this sample up on your own github and advertise it as "game sample using bloc". I bet there's a large intersection of people who want to build games and who are familiar with bloc, and for these people, your version of the sample is perfect. I just don't think it's a good fit for flutter/games.

I'll leave this up for a while in case someone else has a different opinion. cc @domesticmouse

@DanKheadies
Copy link
Author

Thanks for the feedback and insights Filip!

No worries on keeping this separate from the current code sample. I've been using a lot of bloc and originally was just adapting y'alls implementation to my needs and style. I definitely got a lot out of converting and following y'alls best practices.

If it's helpful as another sample or template, e.g. Basic w/ Bloc, awesome. Seeing all the variants and ways we can implement Flutter/Dart, I'm sure the conversion will be helpful for other people. Otherwise, y'all are welcomed to close this PR out, and like you said, I'll just keep a personal branch up to help others.

Thanks again!

@@ -32,7 +32,7 @@ Fixes and necessary improvements to the existing samples, mostly.

If you see a bug or have an idea for a feature that you feel would improve one
of the samples already in the repo, **please
[file an issue](https://github.com/flutter/games/issues/new) before you begin
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious as to why this change. The issues/new URL leads to the UI for raising an issue, the pulls URL is an indirect path.

Copy link
Author

Choose a reason for hiding this comment

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

Ahh sure, I meant to come back and comment this. The issues/new URL goes to a 404. Going to issues redirects to pulls, so I meant to ask y'all what the best option would be for reaching out with new issues.

Screenshot 2024-07-25 at 11 51 53 PM

@domesticmouse
Copy link
Contributor

While I respect people who use Bloc to build their Flutter apps, I personally find the Bloc pattern to feel over engineered. It was built with async support so it was usable with AngularDart, but I don't know of anyone using Bloc who is still using AngularDart.

This sample needs the CLA signed for all identifiers, but given the presence of pa****co​@PapaDaco.local as the failing identity, I suspect this PR needs to be remanufactured to be compliant.

The tests need to pass.

Also, as the bunny responsible for maintaining these samples, I'd prefer not to have the additional complexity in the game samples.

@DanKheadies
Copy link
Author

Yup, totally understand on keeping these samples simple and clean. Again, thanks for putting these out to help the rest of us down here in the code mines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants