The correct way: flutter run -d linux --dart-entrypoint-args 'arg1 arg2' file_with_main.dart => main(List args) => args[0]=arg1, args[1]=arg2
The workaround: flutter run -d linux --dart-define=PSEUDO_ARGS='arg1 arg2' file_with_main.dart => In main, use args=String.fromEnvironment('PSEUDO_ARGS').split(' ') => args[0]=arg1, args[1]=arg2
extension CurryFunction on R Function(S, T) {
/// Curry a binary function with its first argument.
R Function(T) curry(S first) => (T second) => this(first, second);
}
Instance methods are the only ones (except for constructors) that can access this. Conceptually methods are part of the class description and not the object That is, when you do a method call o.foo() Dart first extracts the class-type of o. Then it searches for foo in the class description (recursively going through the super classes, if necessary). Finally it applies the found method with this set to o.
In addition to being able to invoke methods on objects (o.foo()) it is also possible to get a bound closure: o.foo (without the parenthesis for the invocation). However, and this is crucial, this form is just syntactic sugar for () => o.foo(). That is, this just creates a fresh closure that captures o and redirects calls to it to the instance method.