I am attempting to test out the SQFlite API by just creating a simple CLI. I can run the default sample app out of the same directory with both Android Studio and VS Code just fine and I can run other simple CLI programs just fine. Here is the contents of lib/cli.dart:
import 'package:sqflite/sqflite.dart';
void main() {
print('SQFlite Test');
}
When I run the code:
brianbuck$ dart --preview-dart-2 lib/cli.dart
I get the following error:
dart:ui: Error: Not found: dart:ui.
Here is the pub.spec file:
name: sqflite-test
description: SQFlite Test
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.0
http: any
sqflite: any
Is there a way to let the DartVM know that I have dart:ui installed?
sqflite is for Flutter.
dart --preview-dart-2 lib/cli.dart is plain Dart entirely unrelated to Flutter.
If you have a dependency on dart:ui you can use dart ...., you have to use flutter run ...
Flutter has a customized SDK where dart:html and dart:mirrors are missing but has dart:ui missing in the Dart SDK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With