registerInline static method

void registerInline(
  1. Type type,
  2. String name,
  3. bool field,
  4. InlineItemConstructor constructor,
)

Register a constructor method, which is used to convert a attribute data to a Object.

Implementation

static void registerInline(Type type, String name, bool field, InlineItemConstructor constructor) {
  var item = _constructors[type];
  if (item == null) {
    _constructors[type] = item = _InlineItemInfo();
  }
  if (item is _InlineItemInfo) {
    item.dataList.add(_InlineItemData()
        ..name = name
        ..field = field
        ..constructor = constructor
    );
  } else {
    throw "Target is not a inline item";
  }
}