getFieldProperties function

SqfEntityFieldType getFieldProperties(
  1. SqfEntityFieldType field,
  2. DartObject obj
)

get field properties from dartObject

Implementation

SqfEntityFieldType getFieldProperties(
    SqfEntityFieldType field, DartObject obj) {
  final _retVal = field
    ..defaultValue = getDynamicValue(obj, 'defaultValue')
    ..minValue = getDynamicValue(obj, 'minValue')
    ..maxValue = getDynamicValue(obj, 'maxValue')
    ..isPrimaryKeyField = getBoolValue(obj, 'isPrimaryKeyField')
    ..isNotNull = getBoolValue(obj, 'isNotNull')
    ..isUnique = getBoolValue(obj, 'isUnique')
    ..isIndex = getBoolValue(obj, 'isIndex')
    ..isIndexGroup = getIntValue(obj, 'isIndexGroup')
    ..checkCondition = getStringValue(obj, 'checkCondition')
    ..collate = getTypeValue(obj, 'collate') as Collate?
    ..sequencedBy =
        obj.getField('sequencedBy').toString().contains('SqfEntitySequence')
            ? toSequence(obj.getField('sequencedBy')!)
            : null;
  return _retVal;
}