diff --git a/packages/flutter_html_audio/README.md b/packages/flutter_html_audio/README.md index 81ac741006..16f4f6eeaa 100644 --- a/packages/flutter_html_audio/README.md +++ b/packages/flutter_html_audio/README.md @@ -6,12 +6,12 @@ This package renders audio elements using the [`chewie_audio`](https://pub.dev/p The package considers the attributes `controls`, `loop`, `src`, `autoplay`, `width`, and `muted` when rendering the audio widget. -#### Registering the `CustomRender`: +#### Registering the `AudioHtmlExtension`: ```dart Widget html = Html( - customRenders: { - audioMatcher(): audioRender(), + extensions: { + AudioHtmlExtension(), } ); -``` \ No newline at end of file +``` diff --git a/packages/flutter_html_iframe/README.md b/packages/flutter_html_iframe/README.md index 2c46edc0e7..facb70174e 100644 --- a/packages/flutter_html_iframe/README.md +++ b/packages/flutter_html_iframe/README.md @@ -8,23 +8,23 @@ When rendering iframes, the package considers the width, height, and sandbox att Sandbox controls the JavaScript mode of the webview - a value of `null` or `allow-scripts` will set `javascriptMode: JavascriptMode.unrestricted`, otherwise it will set `javascriptMode: JavascriptMode.disabled`. -#### Registering the `CustomRender`: +#### Registering the `IframeHtmlExtension`: ```dart Widget html = Html( - customRenders: { - iframeMatcher(): iframeRender(), + extensions: { + IframeHtmlExtension(), } ); ``` -You can set the `navigationDelegate` of the webview with the `navigationDelegate` property on `iframeRender`. This allows you to block or allow the loading of certain URLs. +You can set the `navigationDelegate` of the webview with the `navigationDelegate` property on `IframeHtmlExtension`. This allows you to block or allow the loading of certain URLs. #### `NavigationDelegate` example: ```dart Widget html = Html( - customRenders: { - iframeMatcher(): iframeRender(navigationDelegate: (NavigationRequest request) { + extensions: { + IframeHtmlExtension(navigationDelegate: (NavigationRequest request) { if (request.url.contains("google.com/images")) { return NavigationDecision.prevent; } else { diff --git a/packages/flutter_html_math/README.md b/packages/flutter_html_math/README.md index 4dd30c1da1..5f4817a504 100644 --- a/packages/flutter_html_math/README.md +++ b/packages/flutter_html_math/README.md @@ -8,17 +8,17 @@ When rendering MathML, the package takes the MathML data within the `` tag Because this package is parsing MathML to Tex, it may not support some functionalities. The current list of supported tags can be found [above](#currently-supported-html-tags), but some of these only have partial support at the moment. -#### Registering the `CustomRender`: +#### Registering the `MathHtmlExtension`: ```dart Widget html = Html( - customRenders: { - mathMatcher(): mathRender(), + extensions: { + MathHtmlExtension(), } ); ``` -If the parsing errors, you can use the `onMathError` property of `mathRender` to catch the error and potentially fix it on your end. +If the parsing errors, you can use the `onMathError` property of `MathHtmlExtension` to catch the error and potentially fix it on your end. The function exposes the parsed Tex `String`, as well as the error and error with type from `flutter_math_fork` as a `String`. @@ -28,12 +28,12 @@ You can analyze the error and the parsed string, and finally return a new instan ```dart Widget html = Html( - customRenders: { - mathMatcher(): mathRender(onMathError: (tex, exception, exceptionWithType) { + extensions: { + MathHtmlExtension(onMathError: (tex, exception, exceptionWithType) { print(exception); //optionally try and correct the Tex string here return Text(exception); }), } ); -``` \ No newline at end of file +``` diff --git a/packages/flutter_html_svg/README.md b/packages/flutter_html_svg/README.md index 712da67ba7..6610e6e73f 100644 --- a/packages/flutter_html_svg/README.md +++ b/packages/flutter_html_svg/README.md @@ -8,15 +8,12 @@ When rendering SVGs, the package takes the SVG data within the `` tag and p The package also exposes a few ways to render SVGs within an `` tag, specifically base64 SVGs, asset SVGs, and network SVGs. -#### Registering the `CustomRender`: +#### Registering the `SvgHtmlExtension`: ```dart Widget html = Html( - customRenders: { - svgTagMatcher(): svgTagRender(), - svgDataUriMatcher(): svgDataImageRender(), - svgAssetUriMatcher(): svgAssetImageRender(), - svgNetworkSourceMatcher(): svgNetworkImageRender(), + extensions: { + SvgHtmlExtension(), } ); ``` diff --git a/packages/flutter_html_table/README.md b/packages/flutter_html_table/README.md index f2ef51789b..87b21e5539 100644 --- a/packages/flutter_html_table/README.md +++ b/packages/flutter_html_table/README.md @@ -6,12 +6,12 @@ This package renders table elements using the [`flutter_layout_grid`](https://pu When rendering table elements, the package tries to calculate the best fit for each element and size its cell accordingly. `Rowspan`s and `colspan`s are considered in this process, so cells that span across multiple rows and columns are rendered as expected. Heights are determined intrinsically to maintain an optimal aspect ratio for the cell. -#### Registering the `CustomRender`: +#### Registering the `TableHtmlExtension`: ```dart Widget html = Html( - customRenders: { - tableMatcher(): tableRender(), + extensions: { + TableHtmlExtension(), } ); ``` diff --git a/packages/flutter_html_video/README.md b/packages/flutter_html_video/README.md index a4d0644a4c..e48255229d 100644 --- a/packages/flutter_html_video/README.md +++ b/packages/flutter_html_video/README.md @@ -6,12 +6,12 @@ This package renders video elements using the [`chewie`](https://pub.dev/package The package considers the attributes `controls`, `loop`, `src`, `autoplay`, `poster`, `width`, `height`, and `muted` when rendering the video widget. -#### Registering the `CustomRender`: +#### Registering the `VideoHtmlExtension`: ```dart Widget html = Html( - customRenders: { - videoMatcher(): videoRender(), + extensions: { + VideoHtmlExtension(), } ); -``` \ No newline at end of file +```