8000 Merge branch 'master' into feature/auto-margins · Sub6Resources/flutter_html@bb3be56 · GitHub
[go: up one dir, main page]

Skip to content 10000

Commit bb3be56

Browse files
authored
Merge branch 'master' into feature/auto-margins
2 parents c5f396d + 9bf0662 commit bb3be56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1451
-979
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [3.0.0-alpha.5] - June 9, 2022:
2+
* Fixed hot reloads, thanks @arjenmels
3+
* Fixed link taps not working
4+
* Improvements in README
5+
6+
## [3.0.0-alpha.3] - April 14, 2022:
7+
* Fixed styling not being applied to list item markers
8+
* [video] Fixed crash when iframe or video tags used unsupported/incorrect height or width
9+
110
## [3.0.0-alpha.2] - January 5, 2022:
211
* **BREAKING** Full modularization using split packages; see our upgrade guide or use flutter_html_all
312

README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ A Flutter widget for rendering HTML and CSS as Flutter widgets.
9090
Add the following to your `pubspec.yaml` file:
9191

9292
dependencies:
93-
flutter_html: ^3.0.0-alpha.2
93+
flutter_html: ^3.0.0-alpha.5
94+
// Or flutter_html_all: ^3.0.0-alpha.5 to include table, video, audio, iframe...
9495

9596
## Currently Supported HTML Tags:
9697
| | | | | | | | | | | |
@@ -497,7 +498,7 @@ Widget html = Html(
497498
</thead>
498499
<tbody>
499500
<tr>
500-
<td rowspan='2'>Rowspan\nRowspan\nRowspan\nRowspan\nRowspan\nRowspan\nRowspan\nRowspan\nRowspan\nRowspan</td><td>Data</td><td>Data</td>
501+
<td rowspan='2'>Rowspan<br>Rowspan<br>Rowspan<br>Rowspan<br>Rowspan<br>Rowspan<br>Rowspan<br>Rowspan<br>Rowspan<br>Rowspan</td><td>Data</td><td>Data</td>
501502
</tr>
502503
<tr>
503504
<td colspan="2"><img alt='Google' src='https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png' /></td>
@@ -566,6 +567,11 @@ The package considers the attributes `controls`, `loop`, `src`, `autoplay`, `wid
566567

567568
#### Registering the `CustomRender`:
568569

570+
Add the dependency to your pubspec.yaml:
571+
572+
dependencies:
573+
flutter_html_audio: ^3.0.0-alpha.3
574+
569575
```dart
570576
Widget html = Html(
571577
customRenders: {
@@ -584,6 +590,11 @@ Sandbox controls the JavaScript mode of the webview - a value of `null` or `allo
584590

585591
#### Registering the `CustomRender`:
586592

593+
Add the dependency to your pubspec.yaml:
594+
595+
dependencies:
596+
flutter_html_iframe: ^3.0.0-alpha.3
597+
587598
```dart
588599
Widget html = Html(
589600
customRenders: {
@@ -620,6 +631,11 @@ Because this package is parsing MathML to Tex, it may not support some functiona
620631

621632
#### Registering the `CustomRender`:
622633

634+
Add the dependency to your pubspec.yaml:
635+
636+
dependencies:
637+
flutter_html_math: ^3.0.0-alpha.3
638+
623639
```dart
624640
Widget html = Html(
625641
customRenders: {
@@ -688,6 +704,11 @@ The package also exposes a few ways to render SVGs within an `<img>` tag, specif
688704

689705
#### Registering the `CustomRender`:
690706

707+
Add the dependency to your pubspec.yaml:
708+
709+
dependencies:
710+
flutter_html_svg: ^3.0.0-alpha.3
711+
691712
```dart
692713
Widget html = Html(
693714
customRenders: {
@@ -707,6 +728,11 @@ When rendering table elements, the package tries to calculate the best fit for e
707728

708729
#### Registering the `CustomRender`:
709730

731+
Add the dependency to your pubspec.yaml:
732+
733+
dependencies:
734+
flutter_html_table: ^3.0.0-alpha.3
735+
710736
```dart
711737
Widget html = Html(
712738
customRenders: {
@@ -723,6 +749,11 @@ The package considers the attributes `controls`, `loop`, `src`, `autoplay`, `pos
723749

724750
#### Registering the `CustomRender`:
725751

752+
Add the dependency to your pubspec.yaml:
753+
754+
dependencies:
755+
flutter_html_video: ^3.0.0-alpha.3
756+
726757
```dart
727758
Widget html = Html(
728759
customRenders: {
@@ -750,7 +781,8 @@ Widget row = Row(
750781
```
751782

752783
## Migration Guides
753-
- For Version 1.0 - [Guide](https://github.com/Sub6Resources/flutter_html/wiki/1.0.0-Migration-Guide)
784+
- For Version 1.0/2.0 - [Guide](https://github.com/Sub6Resources/flutter_html/wiki/1.0.0-Migration-Guide)
785+
- For Version 3.0 - **TODO**
754786

755787
## Contribution Guide
756788
> Coming soon!

example/lib/generated_plugin_registrant.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore_for_file: directives_ordering
66
// ignore_for_file: lines_longer_than_80_chars
7+
// ignore_for_file: depend_on_referenced_packages
78

89
import 'package:video_player_web/video_player_web.dart';
910
import 'package:wakelock_web/wakelock_web.dart';

example/lib/main.dart

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const htmlData = r"""
8383
</thead>
8484
<tbody>
8585
<tr>
86-
<td rowspan='2'>Rowspan\nRowspan\nRowspan\nRowspan\nRowspan\nRowspan\nRowspan\nRowspan\nRowspan\nRowspan</td><td>Data</td><td>Data</td>
86+
<td rowspan='2'>Rowspan<br>Rowspan<br>Rowspan<br>Rowspan<br>Rowspan<br>Rowspan<br>Rowspan<br>Rowspan<br>Rowspan<br>Rowspan</td><td>Data</td><td>Data</td>
8787
</tr>
8888
<tr>
8989
<td colspan="2"><img alt='Google' src='https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png' /></td>
@@ -251,6 +251,8 @@ const htmlData = r"""
251251
<p id='bottom'><a href='#top'>Scroll to top</a></p>
252252
""";
253253

254+
final staticAnchorKey = GlobalKey();
255+
254256
class _MyHomePageState extends State<MyHomePage> {
255257
@override
256258
Widget build(BuildContext context) {
@@ -259,8 +261,18 @@ class _MyHomePageState extends State<MyHomePage> {
259261
title: Text('flutter_html Example'),
260262
centerTitle: true,
261263
),
264+
floatingActionButton: FloatingActionButton(
265+
child: Icon(Icons.arrow_downward),
266+
onPressed: () {
267+
final anchorContext = AnchorKey.forId(staticAnchorKey, "bottom")?.currentContext;
268+
if (anchorContext != null) {
269+
Scrollable.ensureVisible(anchorContext);
270+
}
271+
},
272+
),
262273
body: SingleChildScrollView(
263274
child: Html(
275+
anchorKey: staticAnchorKey,
264276
data: htmlData,
265277
style: {
266278
"table": Style(

example/test/widget_test.dart

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0