5b1e226fc6
The old site supported api.dart.dev/stable/<page in the latest version> links. These currently don't work, but the correct link omits the `/stable/` path component. Even if we add redirects to make the old URLs work, we still want to update sources with the canonical URLs. CoreLibraryReviewExempt: Documentation change only. Fixes: https://github.com/dart-lang/sdk/issues/57110 Change-Id: I0b20bfa875db5ce62362a02e884d7d43b0efc73e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395961 Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com> Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com> Commit-Queue: Alexander Thomas <athom@google.com> Auto-Submit: Alexander Thomas <athom@google.com>
Sample code dart:ffi
This is an illustrative sample for how to use dart:ffi.
Prerequirement
For Windows, Linux, and MacOS, you should make sure, sqlite dev lib installed on your system.
Windows user can download dll from https://www.sqlite.org/download.html
If you do not have any sqlite3.dll or so file, you may found error message:
Unhandled exception:
Invalid argument(s): Failed to load dynamic library (126)
#0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:13:55)
#1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
Building and Running this Sample
Building and running this sample is done through pub.
Running dart run example/main should produce the following output.
$ dart run example/main
1 Chocolade chip cookie Chocolade cookie foo
2 Ginger cookie null 42
3 Cinnamon roll null null
1 Chocolade chip cookie Chocolade cookie foo
2 Ginger cookie null 42
expected exception on accessing result data after close: The result has already been closed.
expected this query to fail: no such column: non_existing_column (Code 1: SQL logic error)
Tutorial
A tutorial walking through the code is available in docs/sqlite-tutorial.md. For information on how to use this package within a Flutter app, see docs/android.md. (Note: iOS is not yet supported).