encodeNumericWith static method

List<int> encodeNumericWith(
  1. String from,
  2. String to,
  3. NumericReply n,
  4. List<String> params,
  5. Encoding encoding, {
  6. String? text,
})

Implementation

static List<int> encodeNumericWith(
  String from,
  String to,
  NumericReply n,
  List<String> params,
  Encoding encoding, {
  String? text,
}) {
  final code = _intToString(n.code);
  final ps = params.isEmpty ? '' : ' ${params.join(' ')}';
  final last = text ?? (n.desc.isNotEmpty ? n.desc : null);
  final trail = last != null ? ' :$last' : '';
  return encoding.encode(':$from $code $to$ps$trail\r\n');
}