moor_db_viewer
this package allows us to view our database in our development app without the need of exporting your database file. filtering is done at database level.
setup
add dependency to pubspec
dependencies:
moor_db_viewer: <latest-version>
use it
push a new route. the child will be the moordbviewer
and pass your database to this screen.
final db = mydatabase(); //this should be a singleton
navigator.of(context).push(materialpageroute(builder: (context) => moordbviewer(db)));
moor config
using named columns
when using named columns you should add a @jsonkey to the column otherwise we won’t be able to hide this table
class todos extends table {
intcolumn get id => integer().autoincrement()();
textcolumn get title => text().withlength(min: 6, max: 32)();
@jsonkey('body') //this is required for the moor_db_viewer.
textcolumn get content => text().named('body')();
intcolumn get category => integer().nullable()();
}
Comments are closed.