asjqkkkk / markdown_widget

📖Rendering markdown by flutter!Welcome for pr and issue.
MIT License
312 stars 90 forks source link

Can i remove the dividers below Headings and pagragraphs ? #137

Closed Shreedhar73 closed 9 months ago

Shreedhar73 commented 9 months ago

I want to remove those lines above Classical antiquity and the end of each paragraph?

I can see , the divider for h1 here in code . image

image

asjqkkkk commented 9 months ago

Hi @Shreedhar73 , you can custom your HeadingConfig with a null HeadingDivider, and then pass them to MarkdownConfig

Shreedhar73 commented 9 months ago

@asjqkkkk Thanks for the response,

I did that and it is working.

OpenJarvisAI commented 7 months ago

@Shreedhar73 Can u tell me how u add it>

Shreedhar73 commented 7 months ago

@OpenJarvisAI

I made a new class that extended the existing H1Config and then on override the divider getter with desired value , and used that in configs list .

For eg :

 class CustomH1Config extends H1Config {
  const CustomH1Config({
    this.style = const TextStyle(
     ......
    ),
  });
  // @override
  @override
  final TextStyle style;

  static H1Config get darkConfig => const H1Config(
        style: TextStyle(
          fontSize: 32,
          height: 40 / 32,
          color: Colors.white,
          fontWeight: FontWeight.bold,
        ),
      );
  @override
  HeadingDivider? get divider => null;
} 

And on MarkdownWidget


configs : [
       CustomH1Config()
] ```