buildMarkdownWidget method

Widget buildMarkdownWidget()

Implementation

Widget buildMarkdownWidget() {
  final markdownWidget = NotificationListener<UserScrollNotification>(
    onNotification: (notification) {
      final ScrollDirection direction = notification.direction;
      isForward = direction == ScrollDirection.forward;
      return true;
    },
    child: ListView.builder(
      shrinkWrap: widget.shrinkWrap,
      physics: widget.physics,
      controller: controller,
      itemBuilder: (ctx, index) => wrapByAutoScroll(index,
          wrapByVisibilityDetector(index, _widgets[index]), controller),
      itemCount: _widgets.length,
      padding: widget.padding,
    ),
  );
  return widget.selectable
      ? SelectionArea(child: markdownWidget)
      : markdownWidget;
}