idFrom method

ID? idFrom(
  1. dynamic value
)

Implementation

ID? idFrom(dynamic value) => switch (ID) {
      String => value?.toString(),
      int => int.tryParse(value.toString()),
      _ => throw UnsupportedError('Type $ID not supported in idFrom')
    } as ID?;