OfflineFirstWithRestAdapter<_Model extends OfflineFirstWithRestModel> class
abstract
This adapter holds logic necessary to work with SqliteProvider
and RestProvider
.
Constructors
- OfflineFirstWithRestAdapter()
-
This adapter holds logic necessary to work with
SqliteProvider
andRestProvider
.
Properties
-
fieldsToOfflineFirstRuntimeDefinition
→ Map<
String, RuntimeOfflineFirstDefinition> -
Keyed by Dart field name. See
RuntimeOfflineFirstDefinition
no setterinherited -
fieldsToSqliteColumns
→ Map<
String, RuntimeSqliteColumnDefinition> -
A dictionary that connects field names to SQLite column properties.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- restRequest → RestRequestTransformer Function(Query?, _Model?)?
-
The endpoint path to access provided a query. Must include a leading slash.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tableName → String
-
Defaults to pluralized model name from the generator.
If this property is changed after the table has been inserted,
a
RenameTable
MigrationCommand
must be included in the nextMigration
.no setterinherited
Methods
-
afterSave(
_Model instance, {required SqliteProvider< SqliteModel> provider, ModelRepository<SqliteModel> ? repository}) → Future<void> -
Hook invoked after the model is successfully entered in the SQLite database.
Useful to update or save associations. This is invoked before
SqliteModel#afterSave
.inherited -
beforeSave(
_Model instance, {required SqliteProvider< SqliteModel> provider, ModelRepository<SqliteModel> ? repository}) → Future<void> -
Hook invoked before the model is successfully entered in the SQLite database.
Useful to update or save associations. This is invoked before
SqliteModel#beforeSave
.inherited -
fromRest(
Map< String, dynamic> input, {required RestProvider provider, ModelRepository<RestModel> ? repository}) → Future<_Model> -
Deserialize data from a REST response
inherited
-
fromSqlite(
Map< String, dynamic> input, {required SqliteProvider<SqliteModel> provider, ModelRepository<SqliteModel> ? repository}) → Future<_Model> -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
primaryKeyByUniqueColumns(
_Model instance, DatabaseExecutor executor) → Future< int?> -
Find a record based on the existence of all contained fields annotated with
@Sqlite(unique: true)
. The Brick-defined primary key of the table is not included in the query. Returns the Brick-defined primary key of the discovered record.inherited -
toRest(
_Model input, {required RestProvider provider, ModelRepository< RestModel> ? repository}) → Future<Map< String, dynamic> > -
Serialize data to a REST endpoint
inherited
-
toSqlite(
_Model input, {required SqliteProvider< SqliteModel> provider, ModelRepository<SqliteModel> ? repository}) → Future<Map< String, dynamic> > -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited