diff --git a/packages/devtools_app/lib/src/shared/profiler_utils.dart b/packages/devtools_app/lib/src/shared/profiler_utils.dart index c6ad9784a7b..6f858ce740d 100644 --- a/packages/devtools_app/lib/src/shared/profiler_utils.dart +++ b/packages/devtools_app/lib/src/shared/profiler_utils.dart @@ -277,7 +277,8 @@ class MethodAndSourceDisplay extends StatelessWidget { final sourceDisplay = '($packageUriWithSourceLine)'; final script = scriptManager.scriptRefForUri(packageUri); - final showSourceAsLink = script != null; + final showSourceAsLink = + script != null && !offlineController.offlineMode.value; if (showSourceAsLink) { sourceTextSpans.add( VmServiceObjectLink( diff --git a/packages/devtools_app/test/cpu_profiler/method_table/method_table_test.dart b/packages/devtools_app/test/cpu_profiler/method_table/method_table_test.dart index 6a385c23b4a..55f214436fe 100644 --- a/packages/devtools_app/test/cpu_profiler/method_table/method_table_test.dart +++ b/packages/devtools_app/test/cpu_profiler/method_table/method_table_test.dart @@ -30,6 +30,7 @@ void main() { createMockServiceConnectionWithDefaults(), ); setGlobal(IdeTheme, IdeTheme()); + setGlobal(OfflineModeController, OfflineModeController()); final mockScriptManager = MockScriptManager(); when(mockScriptManager.sortedScripts).thenReturn( ValueNotifier>([]),