Commit a2958529 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Add level field to the "showMessage" daemon event. (#9889)

Spawned from a discussion in https://github.com/flutter/flutter-intellij/pull/1003
parent a625d3e1
......@@ -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>{
......
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