-
Notifications
You must be signed in to change notification settings - Fork 525
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
Add support for onDettached onAttach UnityWidget #729
base: master
Are you sure you want to change the base?
Add support for onDettached onAttach UnityWidget #729
Conversation
05dc276
to
d8ede98
Compare
…s outside a widget
This looks handy but I think we could rework the api to match the new stream api for next release #733 |
…s outside a widget
Yes I think this is a good idea I will rebase this on #733 |
…s outside a widget
…ullsafe [feat global_unity_controller] Update examples to null safety
ac66ba0
to
c0173b6
Compare
021d538
to
0ddbba2
Compare
I introduced a small merge conflict by merging the null-safe example. |
@RoyalCoder88 |
Okey just let me know when it's ready I will test it properly, thanks! |
Add support for onDettached onAttach UnityWidget to help setup and dispose Unity without loading a new scene
Description
I use the attached boolean in the FlutterUnityWidgetController to know if it is the the corresponding Widget is attached.
When a UnityWidget is build it handles calling onAttached and onDetached on the Widgets which changed attached state.
The last controller added in UnityPlayerUtils.controllers will be the one to be displayed (which correspond to the last one built).
I needed to change lib/src/io/mobile_unity_widget_controller.dart MobileUnityWidgetController._() constructor because the stream was not initialized before the event was sent so it was not caught.
Only Android is supported for now.
Type of Change