fromJsonOrNull static method

Field? fromJsonOrNull(
  1. Map<String, dynamic>? otherData
)

Implementation

static Field? fromJsonOrNull(
  Map<String, dynamic>? otherData,
) {
  try {
    final fieldPath0 = otherData?['fieldPath'];
    final fieldPath = letList(fieldPath0)
        ?.map(
          (p0) => p0?.toString().trim().nullIfEmpty,
        )
        .nonNulls
        .nullIfEmpty
        ?.toList();
    final fieldType0 = otherData?['fieldType'];
    final fieldType = fieldType0;
    final nullable0 = otherData?['nullable'];
    final nullable = letBool(nullable0);
    final child0 = otherData?['child'];
    final child = child0;
    return Field(
      fieldPath: fieldPath,
      fieldType: fieldType,
      nullable: nullable,
      child: child,
    );
  } catch (e) {
    return null;
  }
}