Unit class
数据库表列
name Text not null defalut 'admin' PRIMARY KEY autoincrement
|___| |__| |______| |_____________| |_______________________|
| | | | |
⌵ ⌵ ⌵ ⌵ ⌵
name type nullable defayltValue condition
Constructors
-
Unit(String name, {UnitType type = UnitType.TEXT, List<
Constraints> constraints = const <Constraints>[], dynamic defaultValue, bool nullable = false}) -
const
-
Unit.bool({required String uName, List<
Constraints> ? constraints, bool? defaultValue}) -
创建Boolean类型的字段
factory
-
Unit.enumerated({required String uName, List<
Constraints> ? constraints, required Enum defaultValue}) -
创建枚举类型的字段
factory
-
Unit.int({required String uName, List<
Constraints> ? constraints, int? defaultValue}) -
创建Integer类型的字段
factory
-
Unit.list({required String uName, List<
Constraints> ? constraints, List defaultValue = const <String>[]}) -
创建List类型字段
factory
-
Unit.map({required String uName, List<
Constraints> ? constraints, Map<String, String?> defaultValue = const <String, String?>{}}) -
创建Map类型字段
factory
-
Unit.num({required String uName, List<
Constraints> ? constraints, num? defaultValue}) -
创建num类型的字段。
factory
- Unit.primaryKeyId({String? uName})
-
常用字段 -- ID字段,作为主键且不为空,自增长。
factory
-
Unit.string({required String uName, List<
Constraints> ? constraints, String? defaultValue}) -
创建String类型的字段
factory
Properties
-
constraints
→ List<
Constraints> -
条件,唯一,自增
final
- defaultValue → dynamic
-
默认值
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
单元名
final
- nullable → bool
-
Constraints.notNull
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → UnitType
-
int, bigint, b, text
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited