DataClassName class

A class to be used as an annotation on Table classes to customize the name for the data class that will be generated for the table class. The data class is a dart object that will be used to represent a row in the table.

By default, drift will attempt to use the singular form of the table name when naming data classes (e.g. a table named "Users" will generate a data class called "User"). However, this doesn't work for irregular plurals and you might want to choose a different name, for which this annotation can be used.

Annotations
  • @Target({TargetKind.classType})

Constructors

DataClassName(String name, {Type? extending})
Customize the data class name for a given table. By default, drift will attempt to use the singular form of the table name when naming data classes (e.g. a table named "Users" will generate a data class called "User"). However, this doesn't work for irregular plurals and you might want to choose a different name, for which this annotation can be used.
const

Properties

extending Type?
The parent type of the data class generated by drift.
final
hashCode int
The hash code for this object.
no setterinherited
name String
The overridden name to use when generating the data class for a table. By default, drift will attempt to use the singular form of the table name when naming data classes (e.g. a table named "Users" will generate a data class called "User"). However, this doesn't work for irregular plurals and you might want to choose a different name, for which this annotation can be used.
final
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