Unverified Commit f15f69a8 authored by chunhtai's avatar chunhtai Committed by GitHub

Drops detached message until we can handle it properly (#45430)

parent 54aa53ab
......@@ -338,6 +338,11 @@ mixin SchedulerBinding on BindingBase, ServicesBinding {
}
Future<String> _handleLifecycleMessage(String message) async {
// TODO(chunhtai): remove the workaround once the issue is fixed
// https://github.com/flutter/flutter/issues/39832
if (message == 'AppLifecycleState.detached')
return null;
handleAppLifecycleStateChanged(_parseAppLifecycleMessage(message));
return null;
}
......
......@@ -67,6 +67,14 @@ void main() {
message = const StringCodec().encodeMessage('AppLifecycleState.inactive');
await defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
expect(observer.lifecycleState, AppLifecycleState.inactive);
message = const StringCodec().encodeMessage('AppLifecycleState.detached');
await defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
// TODO(chunhtai): this should be detached once the issue is fixed
// https://github.com/flutter/flutter/issues/39832
// The binding drops detached message for now.
expect(observer.lifecycleState, AppLifecycleState.inactive);
});
testWidgets('didPushRoute callback', (WidgetTester tester) async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment