Record class
Record is a dynamic DTO that represents a one-dimensional data structure.
For example
import 'package:nimbus4flutter/nimbus4flutter.dart';
Record record = Record(
RecordSchema(
[
FieldSchema<String>("name"),
FieldSchema<int>("age")
]
)
);
record["name"] = "hoge";
record["age"] = 20;
Constructors
- Record(RecordSchema schema)
- Record.empty()
Properties
- dataSet ↔ DataSet?
-
The parent DataSet, which is null if it is an independent record.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setteroverride
- primaryKey → Object?
-
Primary key
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schema → RecordSchema?
-
Schema definition
no setter
-
validated
→ Map<
String, List< String> ?> -
no setter
Methods
-
call<
T> () → _RecordMapAccessOperator< T> -
clear(
) → void - Clear the data. The set schema information will not be cleared.
-
clone(
) → Record - Clone the data.
-
cloneEmpty(
) → Record -
containsName(
String name) → bool - Check if a field with the given name exists.
-
createNestedRecordByIndex(
int index) → Record - Create a nested Record with the specified field index.
-
createNestedRecordByName(
String name) → Record - Create a nested Record with the specified field name.
-
createNestedRecordListByIndex(
int index) → RecordList - Create a nested RecordList with the specified field index.
-
createNestedRecordListByName(
String name) → RecordList - Create a nested RecordList with the specified field name.
-
fromList(
List? list, [Map< String, dynamic> ? recordSchemaMap, Map<String, dynamic> ? schemaMap]) → Record - Copies the value of the specified List to this record.
-
fromMap(
Map< String, Object?> ? map) → Record - Copies the value of the specified Map to this record.
-
fromRecord(
Record? record) → Record - Copies the value of the specified record to this record.
-
getByIndex<
T> (int index) → T? - Get the value of the specified field index.
-
getByName<
T> (String name, {bool isFormat = false}) → T? - Get the value of the specified field name.
-
hasValidateError(
) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setByIndex(
int index, Object? value) → void - Set the value of the specified field index.
-
setByName(
String name, Object? value) → void - Set the value of the specified field name.
-
toList(
{bool toJsonType = false}) → List< Object?> - Output the value of this record to the List
-
toMap(
{bool hasNull = true, bool toJsonType = false}) → Map< String, Object?> - Output the value of this record to the Map
-
toString(
) → String -
A string representation of this object.
override
-
validate(
) → void - Validate the value of all field.
-
validateByIndex(
int index) → List< String> ? - Validate the value of the specified field index.
-
validateByName(
String name) → List< String> ? - Validate the value of the specified field name.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
-
operator [](
String name) → Object? - Get the value of the specified field name.
-
operator []=(
String name, Object? value) → void - Set the value of the specified field name.