Can we style html tags with flutter_widget_from_html package

26 Views Asked by At

I am getting html code and showing like below image using flutter_widget_from_html package. mobile view

But now I need to style like it on the website. website view

I tried to find a guide to do this but had no luck.

I just need to do something like this,

if it's a tag I need to set to like text Style to bodyLarge or text color to blue like that.

This is my simple flutter code.

    class ArticleScreen extends StatelessWidget {
  final String? id;

  const ArticleScreen({
    Key? key,
    this.id,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final args = ModalRoute.of(context)?.settings.arguments;
    return Scaffold(
      appBar: AppBar(
        title: const Text('Article'),
      ),
      body: Center(
        child: SingleChildScrollView(
          child: HtmlWidget(
            args.toString(),
            textStyle: Theme.of(context).textTheme.displaySmall,
          ),
        ),
      ),
    );
  }
}

If you guys can help me with this, that would be a huge help for me.

Thank you.

0

There are 0 best solutions below