value<T> static method

T? value<T>(
  1. String key
)

接收者可以通过该函数获取消息中的数据

This function allows the receiver to get the data in the message

Implementation

static T? value<T>(String key) {
  if (_textIsEmpty(key)) return null;
  var value = instance()._map[key]?.value;
  if (value == null) return null;
  if (!(value is T)) {
    debugPrintStack(
        label: 'Error: value type [${value.runtimeType}] is not [$T]');
  }
  return value;
}