Skip to content

Commit a51d0c9

Browse files
committed
Update README
1 parent db30797 commit a51d0c9

File tree

1 file changed

+9
-33
lines changed

1 file changed

+9
-33
lines changed

README.md

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ A Flutter widget for rendering HTML and CSS as Flutter widgets.
3131

3232
- [Why flutter_html?](#why-this-package)
3333

34-
- [Recommended Usage](#recommended-usage)
35-
3634
- [API Reference](#api-reference)
3735

3836
- [Constructors](#constructors)
@@ -141,36 +139,6 @@ This package is designed with simplicity in mind. Originally created to allow ba
141139
this project has expanded to include support for basic styling as well!
142140
If you need something more robust and customizable, the package also provides a number of optional custom APIs for extremely granular control over widget rendering!
143141

144-
## Recommended Usage
145-
146-
```dart
147-
late final Html htmlWidget;
148-
final String htmlData = '<p>html data</p>';
149-
150-
//dispose is especially important when using <video> or <audio> in your HTML code
151-
@override
152-
void dispose() {
153-
htmlWidget.dispose();
154-
super.dispose();
155-
}
156-
157-
@override
158-
Widget build(BuildContext context) {
159-
return new Scaffold(
160-
appBar: AppBar(
161-
title: Text('flutter_html Usage'),
162-
centerTitle: true,
163-
),
164-
body: SingleChildScrollView(
165-
child: htmlWidget = Html(
166-
data: htmlData, //required
167-
//other parameters here
168-
),
169-
),
170-
);
171-
}
172-
```
173-
174142
## API Reference:
175143

176144
For the full API reference, see [here](https://pub.dev/documentation/flutter_html/latest/).
@@ -225,14 +193,22 @@ Once the above issue is resolved, the aforementioned compromises will go away. C
225193

226194
| Methods | Description |
227195
|--------------|-----------------|
228-
| `dispose()` | Disposes all `ChewieController`s, `ChewieAudioController`s, and `VideoPlayerController`s. |
196+
| `disposeAll()` | Disposes all `ChewieController`s, `ChewieAudioController`s, and `VideoPlayerController`s being used by every `Html` widget. (Note: `Html` widgets automatically dispose their controllers, this method is only provided in case you need other behavior) |
229197

230198
### Getters:
231199

232200
1. `Html.tags`. This provides a list of all the tags the package renders. The main use case is to assist in excluding elements using `tagsList`. See an [example](#example-usage---tagslist---excluding-tags) below.
233201

234202
2. `SelectableHtml.tags`. This provides a list of all the tags that can be rendered in selectable mode.
235203

204+
3. `Html.chewieAudioControllers`. This provides a list of all `ChewieAudioController`s being used by `Html` widgets.
205+
206+
4. `Html.chewieControllers`. This provides a list of all `ChewieController`s being used by `Html` widgets.
207+
208+
5. `Html.videoPlayerControllers`. This provides a list of all `VideoPlayerController`s being used for video widgets by `Html` widgets.
209+
210+
6. `Html.audioPlayerControllers`. This provides a list of all `VideoPlayerController`s being used for audio widgets by `Html` widgets.
211+
236212
### Data:
237213

238214
The HTML data passed to the `Html` widget as a `String`. This is required and cannot be null when using `Html`.

0 commit comments

Comments
 (0)