I am new to Flutter and working on build html widget using flutter_html with version flutter_html^3.0.0-beta.2. With the recent version updates I am getting one error for onLinkTap function.
Following is the code:
static Widget getHTMLWidget(String htmlContent, Function onTap) {
return Html(
shrinkWrap: true,
data: htmlContent,
onLinkTap: (
String? url,
RenderContext renderContext,
Map<String, String> attributes, element
) async {
onTapFunction();
},
);
}
Error from IDE is:
The argument type 'void Function(String?, Map<String, String>, Map<String, String>, dynamic)' can't be assigned to the parameter type 'void Function(String?, Map<String, String>, Element?)?'.dartargument_type_not_assignable
This version isn't ready for production. It's probably that the documentation isn't ready yet.
The latest release version of this package is
flutter_html: ^2.2.1according to the docs ondart.pubas you can check hereAnd if this worked before, maybe the arguments of this method were changed and we couldn't know without the docs. If you really need to test this beta version, try to open an Issue on their Github Repository.