getKey method

Key? getKey(
  1. dynamic key
)

Utility method to return a Key based on a Property's value.

Implementation

Key? getKey(dynamic key) {
  if (key is Key) {
    return key;
  }
  if (key == null || key is! String || key.isEmpty) {
    return null;
  }
  return Key(key);
}