anchor.diff:          );
         }
         await Future.wait(isolateNotifications);
  -    }
  +      final List<Future<void>> futures = <Future<void>>[];
  +      for (final FlutterDevice device in flutterDevices) {
  +        final List<FlutterView> views = await device.vmService.getFlutterViews();
  +        for (final FlutterView view in views) {
  +          futures.add(device.vmService
  +            .flushUIThreadTasks(uiIsolateId: view.uiIsolate.id));
  +        }
  +      }
  +      await Future.wait(futures);
  +    }
  +
       // Toggle the main dill name after successfully uploading.
       _swap =! _swap;
   
  
positive.code:     // Send timing analytics.
      globals.flutterUsage.sendTiming('hot', 'restart', restartTimer.elapsed);
  
      // In benchmark mode, make sure all stream notifications have finished.
      if (benchmarkMode) {
        final List<Future<void>> isolateNotifications = <Future<void>>[];
        for (final FlutterDevice device in flutterDevices) {
  
negative.code:           .catchError((dynamic error, StackTrace stackTrace) {
              // Do nothing on a SentinelException since it means the isolate
              // has already been killed.
              // Error code 105 indicates the isolate is not yet runnable, and might
              // be triggered if the tool is attempting to kill the asset parsing
              // isolate before it has finished starting up.
            }, test: (dynamic error) => error is vm_service.SentinelException
              || (error is vm_service.RPCError && error.code == 105)));
        }
      }
      await Future.wait(operations);
  