JsonKey class
Annotation to use on column getters inside of a Table to define the name of the column in the json used by DataClass.toJson.
Example:
class Users extends Table {
IntColumn get id => integer().autoIncrement()();
@JsonKey('user_name')
TextColumn get name => text().nullable()();
}
When calling DataClass.toJson on a User
object, the output will be a map
with the keys "id" and "user_name". The output would be "id" and "name" if
the JsonKey annotation was omitted.
Constructors
Properties
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