fieldPathOrNull static method

List<String>? fieldPathOrNull(
  1. dynamic unknown
)

Assumes unknown is a TFieldRecord or FieldModel and tries to get the fieldPath property, or returns null.

Implementation

static List<String>? fieldPathOrNull(dynamic unknown) {
  try {
    return (unknown.fieldPath as List<String>);
  } catch (_) {
    try {
      return unknown.$1 as List<String>;
    } catch (_) {
      return null;
    }
  }
}