We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Back Button on App Bar is not working in Iphones. I tried everything but it didn't work
My Code
class CustomUnityArScreen extends StatefulWidget { const CustomUnityArScreen({ super.key, }); @override State<CustomUnityArScreen> createState() => _CustomUnityArScreenState(); } class _CustomUnityArScreenState extends State<CustomUnityArScreen> { late UnityWidgetController _unityWidgetController; void _sendMessageToUnity() async { await _unityWidgetController.postMessage( 'MainOrigin', 'OnMessage', 'Hello From Flutter with token', ); } @override void dispose() { super.dispose(); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( // leading: IconButton( // icon: const Icon(Icons.arrow_back), // onPressed: () async { // if (await _unityWidgetController.isReady() ?? false) { // _unityWidgetController.unload(); // _unityWidgetController.dispose(); // } // Get.back(); // }, // ), ), body: UnityWidget( onUnityCreated: _onUnityCreated, onUnityMessage: onUnityMessage, onUnitySceneLoaded: onUnitySceneLoaded, useAndroidViewSurface: true, fullscreen: false, hideStatus: false, uiLevel: 0, gestureRecognizers: {}, borderRadius: const BorderRadius.all(Radius.circular(70)), ), ); } void onUnityMessage(message) { print('Received message from unity: ${message.toString()}'); } void onUnitySceneLoaded(SceneLoaded? scene) { if (scene != null) { print('Received scene loaded from unity: ${scene.name}'); print('Received scene loaded from unity buildIndex: ${scene.buildIndex}'); } else { print('Received scene loaded from unity: null'); } } // Callback that connects the created controller to the unity controller void _onUnityCreated(UnityWidgetController controller) async { _unityWidgetController = controller; await Future.delayed(const Duration(milliseconds: 2000)); await _unityWidgetController.resume(); } // void _onUnityCreated(controller) async { // controller.resume(); // _unityWidgetController = await controller; // // if (widget.isInit) { // Future.delayed( // const Duration(milliseconds: 300), // () async { // await _unityWidgetController.unload(); // Get.back(); // Future.delayed( // const Duration(milliseconds: 500), // ).then( // (value) => widget.initCallback(), // ); // }, // ); // } // } }
Screenshots If applicable, add screenshots to help explain your problem.
Unity (please complete the following information):
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Back Button on App Bar is not working in Iphones. I tried everything but it didn't work
My Code
Screenshots
If applicable, add screenshots to help explain your problem.
Unity (please complete the following information):
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: