Drops detached message until we can handle it properly (#45430)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user