Skip to content

Default style should default to Theme.of(context).textTheme.bodyMedium #86

@JCKodel

Description

@JCKodel

Currently, the default text style doesn't reflect the current app theme.

The idea is to exchange Text("something") with MarkdownViewer("something") and have the exact same output.

In my projects, I had to create a wrapper for it:

class Markdown extends StatelessWidget {
  const Markdown(this.text, {this.style, super.key});

  final String text;
  final TextStyle? style;

  @override
  Widget build(BuildContext context) {
    return MarkdownViewer(
      text,
      selectable: false,
      styleSheet: MarkdownStyle(
        textStyle: style ?? Theme.of(context).textTheme.bodyMedium,
      ),
    );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions