You cannot use static in a function.
Global variables in Dart are not code smells because they are only library global.
JavaScript global variables are ugly because they can conflict with global variables from third-party libraries.
This does not happen in Darth.
Dart , (, ), - ,
import 'my_globals.dart' as gl;
print(gl.myGlobalValue);
.
,
class MyGlobals {
static myVal = 12345;
}
Dart , .