@@ -198,8 +198,10 @@ class ServeHandler implements BuildState {
198198/// build updates
199199class BuildUpdatesWebSocketHandler {
200200 final connectionsByRootDir = < String , List <WebSocketChannel >> {};
201- final shelf.Handler Function (Function , {Iterable <String > protocols})
202- _handlerFactory;
201+ final shelf.Handler Function (
202+ void Function (WebSocketChannel webSocket, String ? subprotocol), {
203+ Iterable <String > protocols,
204+ }) _handlerFactory;
203205 final _internalHandlers = < String , shelf.Handler > {};
204206 final WatchImpl _state;
205207
@@ -208,7 +210,7 @@ class BuildUpdatesWebSocketHandler {
208210
209211 shelf.Handler createHandlerByRootDir (String rootDir) {
210212 if (! _internalHandlers.containsKey (rootDir)) {
211- void closureForRootDir (WebSocketChannel webSocket, String protocol) =>
213+ void closureForRootDir (WebSocketChannel webSocket, String ? protocol) =>
212214 _handleConnection (webSocket, protocol, rootDir);
213215 _internalHandlers[rootDir] = _handlerFactory (closureForRootDir,
214216 protocols: [_buildUpdatesProtocol]);
@@ -239,7 +241,7 @@ class BuildUpdatesWebSocketHandler {
239241 }
240242
241243 void _handleConnection (
242- WebSocketChannel webSocket, String protocol, String rootDir) async {
244+ WebSocketChannel webSocket, String ? protocol, String rootDir) async {
243245 var connections = connectionsByRootDir.putIfAbsent (rootDir, () => [])
244246 ..add (webSocket);
245247 await webSocket.stream.drain <void >();
0 commit comments