You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-33Lines changed: 9 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,8 +31,6 @@ A Flutter widget for rendering HTML and CSS as Flutter widgets.
31
31
32
32
-[Why flutter_html?](#why-this-package)
33
33
34
-
-[Recommended Usage](#recommended-usage)
35
-
36
34
-[API Reference](#api-reference)
37
35
38
36
-[Constructors](#constructors)
@@ -141,36 +139,6 @@ This package is designed with simplicity in mind. Originally created to allow ba
141
139
this project has expanded to include support for basic styling as well!
142
140
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!
143
141
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
-
174
142
## API Reference:
175
143
176
144
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
225
193
226
194
| Methods | Description |
227
195
|--------------|-----------------|
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)|
229
197
230
198
### Getters:
231
199
232
200
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.
233
201
234
202
2.`SelectableHtml.tags`. This provides a list of all the tags that can be rendered in selectable mode.
235
203
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
+
236
212
### Data:
237
213
238
214
The HTML data passed to the `Html` widget as a `String`. This is required and cannot be null when using `Html`.
0 commit comments