string static method

String string(
  1. DataSource source,
  2. List<Object> key
)

Returns a string from the specified string.

Returns the empty string if it's not a string.

This is useful in situations where null is not acceptable, for example, when providing a decoder to list. Otherwise, prefer using DataSource.v directly.

Implementation

static String string(DataSource source, List<Object> key) {
  return source.v<String>(key) ?? '';
}