SelectBloc constructor
SelectBloc({})
Create a select bloc with the specified options. The select bloc will fire a query on creation
Implementation
SelectBloc(
{required this.database,
this.query,
this.table,
this.offset,
this.limit,
this.where,
this.columns = "*",
this.joinTable,
this.joinOn,
this.orderBy,
this.reactive = false,
this.verbose = false})
: assert(database != null),
assert(database.isReady) {
if ((query == null) && (table == null)) {
throw ArgumentError("Please provide either a table or a query argument");
}
_getItems();
if (reactive) {
_changefeed = database.changefeed.listen((change) {
if ((table != null && change.table == table) ||
(query != null && change.query == query)) {
_getItems();
}
if (verbose) {
print("CHANGE IN THE DATABASE: $change");
}
});
}
}