fieldsTypes method

  1. @override
Map<String, TypeInfo> fieldsTypes([
  1. O? o
])
override

Implementation

@override
Map<String, TypeInfo> fieldsTypes([O? o]) {
  if (_fieldsTypes == null) {
    var reflection = reflectionWithObject(o);

    var types = reflection.fieldsNames.map((f) {
      var field = reflection.field(f, o);
      if (field == null || !field.hasSetter) return null;
      var type = TypeInfo.from(field);
      return MapEntry(f, type);
    });

    _fieldsTypes = UnmodifiableMapView<String, TypeInfo>(
        Map<String, TypeInfo>.fromEntries(types.whereNotNull()));
  }
  return _fieldsTypes!;
}