onOpen method
Executes when opening database. This method should be called before using eloquent.
DB.instance.onOpen([
Future(() {
return (Database db) async {};
}),
]);
//Or
DB.instance.onOpen([UserEloquent.onOpen]);
Implementation
void onOpen(List<Future<Function(Database)>> fn) {
_onOpen.addAll(fn);
}