tryParse static method

KalamFileRef? tryParse(
  1. dynamic value
)

Parse from an unknown value — handles JSON string, Map, or null.

This is the recommended entry point when reading FILE column values from query results.

Implementation

static KalamFileRef? tryParse(dynamic value) {
  if (value == null) return null;
  if (value is String) return fromJson(value);
  if (value is Map<String, dynamic>) return _fromMap(value);
  if (value is Map) {
    return _fromMap(Map<String, dynamic>.from(value));
  }
  return null;
}