SelectBloc class Null safety

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
read / write
database Db
The database
final
hashCode int
The hash code for this object.
read-only, inherited
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
read-only
joinOn String?
The on sql statement
read / write
joinTable String?
The join sql statement
read / write
limit int?
Limit sql statement
read / write
offset int?
Offset sql statement
read / write
orderBy String?
Order by sql statement
read / write
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
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
table String?
The table name
final
verbose bool
The verbosity
read / write
where String?
Where sql statement
read / write

Methods

dispose() → void
Cancel the changefeed subscription
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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