1

I have updated my flutter version and I am getting following errors. Other than that everything is working fine.

The named parameter 'tagsList' isn't defined. The getter 'tags' isn't defined for the type 'Html'. The named parameter 'customRenders' isn't defined. The argument type 'EdgeInsets' can't be assigned to the parameter type 'HtmlPaddings?'. The argument type 'EdgeInsets' can't be assigned to the parameter type 'HtmlPaddings?'.

Here is my code:

Padding(
                            padding: const EdgeInsets.fromLTRB(Dimensions.paddingSizeSmall, 0, Dimensions.paddingSizeDefault, Dimensions.paddingSizeSmall),
                            child: Html(data: widget.productModel!.details,
                              tagsList: Html.tags,
                              customRenders: {
                                tableMatcher(): tableRender(),
                              },
                              style: {
                              "table": Style(
                                  backgroundColor: const Color.fromARGB(0x50, 0xee, 0xee, 0xee),
                                ),
                                "tr": Style(
                                  border: const Border(bottom: BorderSide(color: Colors.grey)),
                                ),
                                "th": Style(
                                  padding: const EdgeInsets.all(6),
                                  backgroundColor: Colors.grey,
                                ),
                                "td": Style(
                                  padding: const EdgeInsets.all(6),
                                  alignment: Alignment.topLeft,
                                ),

Problem Screenshot

Can anyone please help me. I know this is the problem generated by flutter_html. But I am unable to find solution.

I tried all the forums and everyone I know. But I am having this problem after updating dependencies and flutter. So please anyone help me.

Bas H
  • 2,114
  • 10
  • 14
  • 23
Punkkk
  • 43
  • 7

1 Answers1

1

Quoting from official migration guide

customRender has been changed to extensions, and its API is now significantly different. extensions accepts a List<Extension>.

This parameter has been split into two different options: doNotRenderTheseTags and onlyRenderTheseTags. All supported tags are allowed by default, including tags supported by extensions. This allows you to either restrict certain tags from rendering (say you don't want any images rendered), or allow only a certain subset of tags to render (say you only want h1-h6 and p tags to be rendered). Both doNotRenderTheseTags and onlyRenderTheseTags take a Set.

If you were using the style parameter in your Html widget, there are some minor changes to the API that introduce some huge possibilites.

Follow this guide and everything will be correctly working again.

If this doesn't help, please let me know and I'll provide more support to you. Happy coding!

EDIT

Please, update your flutter_html version to Beta 3 and migrate your code following the official migration guide I linked above. The code in the document is the same you posted in your question. Update your code using the Migration Guide and let me know if this solves your problems

ItzDavi
  • 443
  • 4
  • 13
  • I read the whole article but still cant solve please help me. – Punkkk Jul 08 '23 at 09:34
  • What's wrong ? Still having the same errors ? Can you add errors in your question ? – ItzDavi Jul 08 '23 at 09:37
  • Or can you add your most recent code after following the guide ? Can you also add your pubspec.yaml ? @Punkkk – ItzDavi Jul 08 '23 at 09:38
  • Yes sure I am using the following dependencies: – Punkkk Jul 08 '23 at 10:42
  • Can you please add your pubspec.yaml and your updated code in your question ? @Punkkk – ItzDavi Jul 08 '23 at 11:04
  • All details are written in the document please check the end. Thank You https://docs.google.com/document/d/e/2PACX-1vS0jDtAFpG72y1aW9KOsOAaaH63AnTcqDIf8OBhchSTLzKY_LN4meKFYaFNHwh8QQ8K8L0aYuPlhSjl/pub – Punkkk Jul 08 '23 at 11:17
  • Sorry didn't find the link before. Try updating your flutter_html version. Beta 2 is out – ItzDavi Jul 08 '23 at 11:20
  • I am having this problem after I updated the flutter_html. I have edited my questions. You can now see all my errors above. Please help. – Punkkk Jul 08 '23 at 19:15