selectTag method

Future<void> selectTag(
  1. MenuElement tagElement,
  2. TagRenderer<Widget> tagRenderer
)

Implementation

Future<void> selectTag(MenuElement tagElement, TagRenderer tagRenderer) async {
  emit(state.copyWith(
    activeElement: tagElement,
    activeTagRenderer: tagRenderer,
    canChangeContentType: tagRenderer.availableNuiWidget.isAny,
  ));
  final String example = tagRenderer.example.replaceAll(_prettyCodeRegExp, '>\n').trim();
  await initFromModel(
    ScreenContentModel(
      content: example,
      contentType: tagRenderer.availableNuiWidget.isScrollable ? ScreenContentType.scrollable : ScreenContentType.stack,
    ),
  );
}