valueToString method

  1. @override
String valueToString(
  1. Map<String, dynamic> x
)
override

Implementation

@override
String valueToString(Map<String, dynamic> x) {
  for (var fEntry in _fields) {
    var name = fEntry.key, type = fEntry.value;
    // eslint-disable-next-line
    if (x.containsKey(name)) {
      final value = type.valueToString(x[name]);
      if (value == 'null') {
        return "variant {$name}";
      } else {
        return "variant {$name=$value}";
      }
    }
  }
  throw 'Variant has no data: $x';
}