inlineCode method

Widget inlineCode()

Implementation

Widget inlineCode() {
  return Builder(builder: (context) {
    final style = DefaultTextStyle.of(context).style;
    final double paddingVertical = style.fontSize! * 0.2;
    final double paddingHorizontal = style.fontSize! * 0.3;
    final ThemeData themeData = Theme.of(context);
    Widget child;
    if (this is WrappedText) {
      child = (this as WrappedText).copyWithStyle(
        (context, theme) => theme.typography.inlineCode,
      );
    } else {
      child = WrappedText(
          style: (context, theme) => theme.typography.inlineCode,
          child: this);
    }
    return Container(
      padding: EdgeInsets.symmetric(
        vertical: paddingVertical,
        horizontal: paddingHorizontal,
      ),
      decoration: BoxDecoration(
        color: Theme.of(context).colorScheme.muted,
        borderRadius: BorderRadius.circular(themeData.radiusSm),
      ),
      child: child,
    );
  });
}