import of dart:mirrors is not supported in the current Dart runtime
I am trying to execute below code:
import 'dart:io';
import 'package:safe_config/safe_config.dart';
class ApplicationConfiguration extends Configuration {
ApplicationConfiguration(String fileName) : super.fromFile(File(fileName));
String password;
}
void main() {
var config = new ApplicationConfiguration("config.yaml");
print("${config.password}");
}
config.yaml is having:
password: pwd123
I am not sure why i am getting import error
import of dart:mirrors is not supported in the current Dart runtime
dart:mirrors is the reflection library in Dart. Not sure what environment you are running on, but it is available on the Dart JIT VM. Work is currently in progress to provide a source-generated solution that does not depend on mirrors.
I am having the same issue. I am trying to use the config file to build an application in android studio using flutter.
Me too, my IDE is Intellij and I have the same issue.
I have the same problem. I want to use the new dart2native to compile my CLI tool to a single binary, but dart2native does not support dart:mirrors. (source: https://medium.com/dartlang/dart2native-a76c815e6baf)
Is there an ETA when the transition to the source-generated solution will be available?
safe_config is really useful. Especially with something like dart2native.
In progress with: https://github.com/stablekernel/aqueduct/issues/669