getStringFromEnum<T> function Null safety

String? getStringFromEnum<T>(
  1. dynamic T
)

Implementation

String? getStringFromEnum<T>(T) {
  if (T == null) {
    return null;
  }
  return T.toString().split('.').last;
}