Add support for onDettached onAttach UnityWidget#729
Add support for onDettached onAttach UnityWidget#729Ortes wants to merge 23 commits intojuicycleff:masterfrom
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