@@ -67,6 +67,8 @@ class Debugger extends Domain {
67
67
68
68
PauseState _pauseState = PauseState .none;
69
69
70
+ bool _pausedOverlayVisible = false ;
71
+
70
72
String get pauseState => _pauseModePauseStates.entries
71
73
.firstWhere ((entry) => entry.value == _pauseState)
72
74
.key;
@@ -392,6 +394,25 @@ class Debugger extends Domain {
392
394
return await inspector.jsCallFunctionOn (receiver, expression, args);
393
395
}
394
396
397
+ // Renders the paused at breakpoint overlay over the application.
398
+ void _showPausedOverlay () async {
399
+ if (_pausedOverlayVisible) return ;
400
+ handleErrorIfPresent (await _remoteDebugger? .sendCommand ('DOM.enable' ));
401
+ handleErrorIfPresent (await _remoteDebugger? .sendCommand ('Overlay.enable' ));
402
+ handleErrorIfPresent (await _remoteDebugger
403
+ ? .sendCommand ('Overlay.setPausedInDebuggerMessage' , params: {
404
+ 'message' : 'Paused in Dart DevTools' ,
405
+ }));
406
+ _pausedOverlayVisible = true ;
407
+ }
408
+
409
+ // Removes the paused at breakpoint overlay from the application.
410
+ void _hidePausedOverlay () async {
411
+ if (! _pausedOverlayVisible) return ;
412
+ handleErrorIfPresent (await _remoteDebugger? .sendCommand ('Overlay.disable' ));
413
+ _pausedOverlayVisible = false ;
414
+ }
415
+
395
416
/// Calls the Chrome Runtime.getProperties API for the object with [objectId] .
396
417
///
397
418
/// Note that the property names are JS names, e.g.
@@ -563,6 +584,7 @@ class Debugger extends Domain {
563
584
logger.warning ('Error calculating Dart frames' , e, s);
564
585
}
565
586
587
+ _showPausedOverlay ();
566
588
isolate.pauseEvent = event;
567
589
_streamNotify ('Debug' , event);
568
590
}
@@ -579,6 +601,8 @@ class Debugger extends Domain {
579
601
kind: EventKind .kResume,
580
602
timestamp: DateTime .now ().millisecondsSinceEpoch,
581
603
isolate: inspector.isolateRef);
604
+
605
+ _hidePausedOverlay ();
582
606
isolate.pauseEvent = event;
583
607
_streamNotify ('Debug' , event);
584
608
}
0 commit comments