How can I access Dart functions / variables from the Dartium DevTool Console?

In JavaScript, you can access global variables and functions from the DevTool console (for example, to call a function manually).

I tried to do this in Dartium, but always get a reference error.

I tried the following options:

testFunc () { return "test"; } var testFunc2 = () { return "test"; } void main() { var testFunc3 () { return "test"; } } 

but no one can be called through the DevTool Dartium console.

+6
source share
1 answer

You need to select the Dart context.
When you open the devtools> Console tab, <top frame> is selected by default.
You need to switch to the Dart context, for example dart:core .
As far as I remember, it does not matter which Dart context is selected, only one of the Dart contexts.

enter image description here

+7
source

Source: https://habr.com/ru/post/973104/


All Articles