'how can I get variable from another function

I imported the main function from another dart file but how can I get the variables inside the main function.

import "dartbegin/test.dart" as testt;
// Import the test package

void main() {
  // Define the test
  int l = testt.main().a;
  print(l);
}```

this is test.dart file

void main() { int a = 5; }```



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source