yabs.io

Yet Another Bookmarks Service

Search

Results

[https://stackoverflow.com/questions/55004302/how-do-you-pass-arguments-from-command-line-to-main-in-flutter-dart] - - public:mzimmerm
command, dart, main, parameter - 4 | id:1420580 -

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

Follow Tags


Export:

JSONXMLRSS