SelectBloc class

A ready to use select bloc

Provides a stream with the rows corresponding to the query. This stream, accssible via items, will send new data if something changes in the database if the reactive parameter is true

Join queries are possible.

Important: you must provide either a table or a query argument

Constructors

SelectBloc({required Db database, String? query, String? table, int? offset, int? limit, String? where, String columns = "*", String? joinTable, String? joinOn, String? orderBy, bool reactive = false, bool verbose = false})
Create a select bloc with the specified options. The select bloc will fire a query on creation

Properties

columns String
Select sql statement
getter/setter pair
database Db
The database
final
hashCode int
The hash code for this object.
no setterinherited
items Stream<List<Map<String, dynamic>>?>
A stream of rows returned by the query. Will return new items if something changes in the database when the reactive parameter is true
no setter
joinOn String?
The on sql statement
getter/setter pair
joinTable String?
The join sql statement
getter/setter pair
limit int?
Limit sql statement
getter/setter pair
offset int?
Offset sql statement
getter/setter pair
orderBy String?
Order by sql statement
getter/setter pair
query String?
The query, which if used, will ignore all else statements
final
reactive bool
The reactivity of the bloc. Will send new values in items when something changes in the database if set to true
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
table String?
The table name
final
verbose bool
The verbosity
getter/setter pair
where String?
Where sql statement
getter/setter pair

Methods

dispose() → void
Cancel the changefeed subscription
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reload() Future<void>
toString() String
A string representation of this object.
inherited
update(List<Map<String, dynamic>> _items) → void
A convenience method to update the bloc items if needed by adding to the sink

Operators

operator ==(Object other) bool
The equality operator.
inherited