Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@loongliu
Copy link
Contributor

When use flutter with add2app, Flutter's lifecycle is not same with application's lifecycle. When FlutterViewController is cover by another native UIViewController using add2app, Flutter's rendering pipeline is stopped by FlutterViewController's viewWillDisappear. When application resigned active and then becomes active, FlutterViewController will notify engine to resume rendering pipeline, while FlutterView is not visible.

To correct this, we should make Flutter's lifecycle same as FlutterViewController's lifecycle.

… in iOS.

When use flutter with `add2app`, Flutter's lifecycle is not same with application's lifecycle. When FlutterViewController is cover by another native UIViewController using `add2app`, Flutter's rendering pipeline is stopped by FlutterViewController's `viewWillDisappear`. When application resigned active and then becomes active, FlutterViewController will notify engine to resume rendering pipeline, while FlutterView is not visible.

To correct this, we should make Flutter's lifecycle same as FlutterViewController's lifecycle.
Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break "regular flutter apps, and will need some tests.

This is a challenging problem too. I'm not sure of the best way to resolve it. May e some parameter or property on the viewcontoller about whether it needs these hooks?

@cbracken
Copy link
Member

Thanks for your contribution! Given that a fair bit of functionality/existing apps depend on these, this would be a significant breaking change. Since we don't plan to merge this change; I'll close this PR.

The good news is that @gaaclarke is working on resolving the lifecycle issues for add2app, which should resolved the underlying issue either way.

@cbracken cbracken closed this Aug 12, 2019
@nghiaiosdev
Copy link

nghiaiosdev commented Aug 21, 2019

I have the same issue, when i open another native controller in flutter app, the application change to AppLifecycleState.inactive then AppLifecycleState.paused. My flutter app using WebSocket and i will disconnect when application enter background (paused triggered), but when i open native controller flutter call AppLifecycleState.paused and i expect socket keeping connection but websocket was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants