Client-side full-text search (FTS) is available using the SQLite FTS5 extension.
sqlite
package used, as it is an extension that must first be enabled in the package.lists
and todos
tables already created in this demo app. Don’t worry if you already have data in the tables, as it will be copied into the new FTS tables.
To simplify implementation these examples make use of SQLite migrations. The migrations are run in migrations/fts_setup.dart in the Flutter implementation. Here we use the sqlite_async Dart package to generate the migrations.
createFtsMigration
function is key and corresponds to the below (Dart example):
FTS tables and migrations
FTS triggers
lists
or todos
that you have generated.
Example of searching