renderPreview static method

Widget renderPreview(
  1. String data, {
  2. double maxHeight = 200,
})

Renders a preview of the Markdown content

Implementation

static Widget renderPreview(String data, {double maxHeight = 200}) {
  return Container(
    constraints: BoxConstraints(maxHeight: maxHeight),
    decoration: BoxDecoration(
      border: Border.all(color: Colors.grey[300]!),
      borderRadius: BorderRadius.circular(4),
    ),
    child: SingleChildScrollView(
      child: Padding(
        padding: const EdgeInsets.all(8),
        child: MarkdownWidget(
          data: data,
          config: MarkdownConfig.defaultConfig,
        ),
      ),
    ),
  );
}