flutter_js
flutter_js copied to clipboard
How to import INTL or other dependencies?
Hello, i'm playing with Flutter_js and I have a little problem right now:
This is my test.js (from Mozilla Doc) :
function log(count) {
const formattedCount = new Intl.NumberFormat(navigator.languages).format(count);
return formattedCount;
}
My page.dart:
var myMethod = "log(26254.39);";
var flutterJs = getJavascriptRuntime();
var path = await rootBundle.loadString("lib/core/ressources/test.js");
JsEvalResult jsEvalResult = flutterJs.evaluate("$path$myMethod");
var result = jsEvalResult.stringResult;
And this is my error:
I/flutter (16439): ReferenceError: 'Intl' is not defined
I/flutter (16439): at log (
How to import INTL for my javascript process?
Thanks
- I think it's because quickjs has not implement Intl.
- you should evaluate or load module about Intl,
- or modify quickjs c lib(difficulty)