QuoteData.fromBodies constructor

QuoteData.fromBodies(
  1. String quoteBody,
  2. String body
)

Takes the body of the message we want to quote quoteBody and the content of the reply body and computes the fallback body and its length.

Implementation

factory QuoteData.fromBodies(String quoteBody, String body) {
  final fallback = quoteBody.split('\n').map((line) => '> $line\n').join();

  return QuoteData(
    '$fallback$body',
    fallback.length,
  );
}