How would you run a command and pass some custom arguments with Flutter/Dart so they can then be accessed in the main()
call such as:
flutter run -device [my custom arg]
So then I can access it with:
void main(List<String> args) {
print(args.toString());
}
Thank you.
The arguments for the main
method can be declared with the parameter --dart-entrypoint-args
(short: -a
), e.g.
flutter run -d linux --dart-entrypoint-args some_file.xml