OnOpen class
Annotation for define OnOpen method for database. Prototype of the function called when the database is open. Post initialization should happen here. This annotation must be applied on a method in the database class. Method syntax is also important. Example:
@DB(
name: 'note_db',
version: 1,
entities: [Note],
)
abstract class NoteDB {
@OnOpen()
Future<void> onOpen(Database db) async {
print('onOpen');
}
}
Constructors
- OnOpen()
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited