Cow class Null safety Models
소 정보입니다.
- Annotations
Constructors
-
Cow({required String id, required String farmId, required String name, required DateTime? birth, required double birthWeight, Sensor? sensor, required List<
CowGroup> groups, required String sex, required String memo, required String traceNumber, required String managementNumber, required String state, CowStatusType cowStatus = CowStatusType.good, bool isSelected = false}) -
Cow.fromJson(Map<
String, dynamic> json) -
factory
Properties
- birth ↔ DateTime?
-
출생일자
@JsonKey(name: 'birth', fromJson: dateTimeFromJson, toJson: dateTimeToJson), read / write
- birthWeight ↔ double
-
생시체중
@JsonKey(name: 'birth_weight'), read / write
- cowStatus ↔ CowStatusType
-
개체의 상태CowStatusType(양호, 주의, 심각, 경계)를 나타냅니다.
@JsonKey(name: 'cowStatus', fromJson: cowStatusTypeFromIndex, toJson: cowStatusTypeToIndex), read / write
- dayAfterBirthStr → String
-
오늘 기준 일령
read-only
- farmId ↔ String
-
농장 아이디 (FARM-100000, ...)
@JsonKey(name: 'farm_id'), read / write
-
groups
↔ List<
CowGroup> -
개체가 속한 소 그룹의 리스트
@JsonKey(name: 'groups', fromJson: groupsFromJson, toJson: groupsToJson), read / write
- hashCode → int
-
The hash code for this object. [...]
read-only, override
- id ↔ String
-
소 아이디 (COW-10000000, ...)
@JsonKey(name: 'id'), read / write
- isSelected ↔ bool
-
개체설정화면이나 팝업에 있는 리스트뷰에서 개체가 선택되었는지 여부를 나타냅니다.
@JsonKey(ignore: true), read / write
- managementNumber ↔ String
-
개체관리번호
@JsonKey(name: 'management_number'), read / write
- memo ↔ String
-
메모
@JsonKey(name: 'memo'), read / write
- name ↔ String
-
명호
@JsonKey(name: 'name'), read / write
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- sensor ↔ Sensor?
-
착용중인 센서의 정보입니다.
착용중이지 않으면 null입니다.
@JsonKey(name: 'sensor_id', fromJson: sensorFromJson, toJson: sensorToJson), read / write
- sex ↔ String
-
성별
@JsonKey(name: 'sex'), read / write
- sexCodeToStr → String
-
read-only
- state ↔ String
-
상태 ("removed", "dead", ...) 현재 "removed"만 사용되고 그 이외에 정해진 값은 없습니다. 필요하신대로 맞게 넣고 api 함수에서도 대응하여 사용하시면 되겠습니다.
@JsonKey(name: 'state'), read / write
- traceNumber ↔ String
-
개체이력번호
@JsonKey(name: 'trace_number'), read / write
Methods
-
getDayAfterBirthFromDateTime(
DateTime dateTime) → int - 선택된 날짜를 기준으로 일령 계산하고 int로 반환합니다.
-
getDayAfterBirthStrFromDateTime(
DateTime dateTime) → String - 선택된 날짜를 기준으로 일령 계산하고 String으로 반환합니다.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object. [...]
override
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
override