encodeTo method

  1. @override
void encodeTo(
  1. ChainType value,
  2. Output output
)
override

Convert self to a slice and append it to the destination.

Implementation

@override
void encodeTo(
  ChainType value,
  Output output,
) {
  switch (value.runtimeType) {
    case Development:
      (value as Development).encodeTo(output);
      break;
    case Local:
      (value as Local).encodeTo(output);
      break;
    case Live:
      (value as Live).encodeTo(output);
      break;
    case Custom:
      (value as Custom).encodeTo(output);
      break;
    default:
      throw Exception(
          'ChainType: Unsupported "$value" of type "${value.runtimeType}"');
  }
}