flutter-unity-view-widget icon indicating copy to clipboard operation
flutter-unity-view-widget copied to clipboard

Can UnityWidget() work with Hero() component?

Open emileswain opened this issue 11 months ago • 0 comments

I'm using UnityWidget() within a Hero(), the idea being to try and persist the Unity view across views within Flutter routes.

It works, sort of, it essentially flickers a lot. I'm wondering if anyone has done something similar and or if its possible to smoothly transition the Unity view across views without the flickering.

return Hero(
      tag: "avatarHero",
      child: Padding(
          padding: const EdgeInsets.only(bottom: 13),
          child: SizedBox(
              width: double.infinity,
              height: 300,
              child: UnityWidget(
                onUnityCreated: _onUnityCreated,
                onUnityMessage: onUnityMessage,
                onUnitySceneLoaded: onUnitySceneLoaded,
                useAndroidViewSurface: true,
                // borderRadius: const BorderRadius.all(Radius.circular(70)),
              ))));

emileswain avatar Mar 12 '24 19:03 emileswain