diff --git a/packages/devtools_app/lib/src/debugger/debugger_controller.dart b/packages/devtools_app/lib/src/debugger/debugger_controller.dart index 978344a47be..c219a9520ef 100644 --- a/packages/devtools_app/lib/src/debugger/debugger_controller.dart +++ b/packages/devtools_app/lib/src/debugger/debugger_controller.dart @@ -690,6 +690,20 @@ class DebuggerController extends DisposableController return; } + // Collecting frames for Dart web applications can be slow. At the potential + // cost of a flicker in the stack view, display only the top frame + // initially. + if (await serviceManager.connectedApp.isDartWebApp) { + _populateFrameInfo( + [ + await _createStackFrameWithLocation(pauseEvent.topFrame), + ], + truncated: true, + ); + unawaited(_getFullStack()); + return; + } + // We populate the first 12 frames; this ~roughly corresponds to the number // of visible stack frames. const initialFrameRequestCount = 12;