You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The errors that DartPad returns is:
"Error compiling to JavaScript:
/tmp/dartpadUTEEFM/lib/main.dart:10:18: Error: Constant evaluation error:
return const Text(key: Key('hello'), 'hello');
^
/tmp/dartpadUTEEFM/lib/main.dart:10:28: Context: The variable '(unnamed)' is not a constant, only constant expressions are allowed.
return const Text(key: Key('hello'), 'hello');"
The error can be fixed by changing the line: return const Text(key: Key('hello'), 'hello',); to return const Text('hello', key: Key('hello'),);
The text was updated successfully, but these errors were encountered:
This should be allowed now that this feature has shipped in 2.17: dart-lang/language#1072. Feel free to comment and we will reopen if you're still seeing an issue with this.
What happened?
I expected DartPad to accept positional parameters being placed in any order with named parameters but this is not the case.
Steps to reproduce problem
The minimum case to reproduce the error is:
The errors that DartPad returns is:
"Error compiling to JavaScript:
/tmp/dartpadUTEEFM/lib/main.dart:10:18: Error: Constant evaluation error:
return const Text(key: Key('hello'), 'hello');
^
/tmp/dartpadUTEEFM/lib/main.dart:10:28: Context: The variable '(unnamed)' is not a constant, only constant expressions are allowed.
return const Text(key: Key('hello'), 'hello');"
The error can be fixed by changing the line:
return const Text(key: Key('hello'), 'hello',);
toreturn const Text('hello', key: Key('hello'),);
The text was updated successfully, but these errors were encountered: