Since dart:ffi is available from Dart 2.2.0-dev.2.0
, I've been trying to use that library. The sample app works fine for me and I also tried to use it for my Flutter app but I couldn't call it with import "dart:ffi"
, although Flutter on my machine was HEAD
of master
that used Dart 2.3.0-dev.0.0
.
I checked what happened, then I found that sky_engine didn't contain ffi.dart
while it contained other libraries (e.g. "dart:core"). Also I noticed that the source files of those libraries were copied from $FLUTTER_ROOT/bin/cache/dart-sdk/lib
to $FLUTTER_ROOT/bin/cache/pkg/sky_engine
using BUILD.gn or _embedder.yaml and that seemed to be why I couldn't use the dart:ffi
in my Flutter app.
However, in the first place, why does Flutter need sky_engine, which is "the interface between Dart and the Flutter Engine"? Why not calling them directly without this glue code?