codeBlock function

String codeBlock(
  1. String code, [
  2. String language = ''
])

Wraps the code in a code block with the specified language, if any.

Implementation

String codeBlock(String code, [String language = '']) => '```$language\n$code\n```';