Skip to content

[flutter_markdown] Add a way to change the default MarkdownStyleSheet down the widget tree #134776

@nilsreichardt

Description

@nilsreichardt

Is there an existing issue for this?

Use case

Sometimes it's helpful to change the theme for the entire subtree, like you can do with the Theme, DefaultTextStyle or IconTheme widgets. It would be helpful to have the opportunity to do the same for the styles of MarkdownBody (changing MarkdownStyleSheet).

Proposal

DefaultMarkdownStyleSheet(
  style: MarkdownStyleSheet(
    p: TextStyle(color: Colors.orange)
  )
  child: Card(
    child: MarkdownBody(
      data: "My text" // this text is orange
    ),
  ),
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: flutter_markdownflutter/packages flutter_markdownpackageflutter/packages repository. See also p: labels.r: invalidIssue is closed as not validteam-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy