Add level field to the "showMessage" daemon event. (#9889)
Spawned from a discussion in https://github.com/flutter/flutter-intellij/pull/1003
This commit is contained in:
@@ -543,9 +543,12 @@ class DeviceDomain extends Domain {
|
||||
return;
|
||||
|
||||
if (!discoverer.canListAnything) {
|
||||
// This event will affect the client UI. Coordinate changes here
|
||||
// with the Flutter IntelliJ team.
|
||||
sendEvent(
|
||||
'daemon.showMessage',
|
||||
<String, String>{
|
||||
'level': 'warning',
|
||||
'title': 'Unable to list devices',
|
||||
'message':
|
||||
'Unable to discover ${discoverer.name}. Please run '
|
||||
|
||||
@@ -216,6 +216,7 @@ void main() {
|
||||
final Map<String, dynamic> response = await responses.stream.first;
|
||||
expect(response['event'], 'daemon.showMessage');
|
||||
expect(response['params'], isMap);
|
||||
expect(response['params'], containsPair('level', 'warning'));
|
||||
expect(response['params'], containsPair('title', 'Unable to list devices'));
|
||||
expect(response['params'], containsPair('message', contains('Unable to discover Android devices')));
|
||||
}, overrides: <Type, Generator>{
|
||||
|
||||
Reference in New Issue
Block a user