Make handleJsonEvent public so that it can be overridden internally. (#139531)

This commit is contained in:
Lau Ching Jun
2023-12-04 23:42:05 -08:00
committed by GitHub
parent 2c61350452
commit 63c58a33d7

View File

@@ -472,7 +472,7 @@ class FlutterDebugAdapter extends FlutterBaseDebugAdapter with VmServiceInfoFile
}
/// Handles incoming JSON events from `flutter run --machine`.
void _handleJsonEvent(String event, Map<String, Object?>? params) {
void handleJsonEvent(String event, Map<String, Object?>? params) {
params ??= <String, Object?>{};
switch (event) {
case 'daemon.connected':
@@ -646,7 +646,7 @@ class FlutterDebugAdapter extends FlutterBaseDebugAdapter with VmServiceInfoFile
final Object? params = payload['params'];
final Object? id = payload['id'];
if (event is String && params is Map<String, Object?>?) {
_handleJsonEvent(event, params);
handleJsonEvent(event, params);
} else if (id != null && method is String && params is Map<String, Object?>?) {
_handleJsonRequest(id, method, params);
} else if (id is int && _flutterRequestCompleters.containsKey(id)) {