flame-engine / flame

A Flutter based game engine.
https://flame-engine.org
MIT License
8.98k stars 879 forks source link

FlameBlocReader doesn't call super.onLoad() #3164

Closed imaNNeo closed 1 month ago

imaNNeo commented 1 month ago

What happened?

I need to be able to chain multiple mixins in my component, but when I add FlameBlocReader, it doesn't call super.onLoad()

Take a look at the below code: https://github.com/flame-engine/flame/blob/6d7eeee3983ae2d9c169ab05a9674b6c30c40f6a/packages/flame_bloc/lib/src/flame_bloc_reader.dart#L18-L29

What do you expect?

I expect it to call super.onLoad(), then I am able to chain multiple mixins in my flame component.

How can we reproduce this?

You can chain multiple mixins and put the FlameBlocReader as the last mixin, so previous mixins onLoad() will never call.

What steps should take to fix this?

No response

Do have an example of where the bug occurs?

No response

Relevant log output

No response

Execute in a terminal and put output into the code block below

Output of: flutter doctor -v

Affected platforms

All

Other information

No response

Are you interested in working on a PR for this?

spydon commented 1 month ago

@imaNNeo can you create a PR for this?

imaNNeo commented 1 month ago

Sorry for my late response. And thanks for fixing it!

spydon commented 1 month ago

It's now released in flame_bloc v1.12.0 :)

imaNNeo commented 1 month ago

Oh, nice! Let's update the dependency 🥳🥳🥳🥳🥳

imaNNeo commented 1 month ago

It's now released in flame_bloc v1.12.0 :)

1.18.0 you mean

spydon commented 1 month ago

1.18.0 you mean

No, v1.18.0 is the Flame version, the FlameBlocReader class is in the flame_bloc package which has the version v1.12.0.

imaNNeo commented 1 month ago

No, v1.18.0 is the Flame version, the FlameBlocReader class is in the flame_bloc package which has the version v1.12.0.

Oh, you're right. We have separate versioning for flame_bloc