Skip to content

Commit 354e281

Browse files
committed
Version 0.9.7
1 parent fdd8c29 commit 354e281

File tree

4 files changed

+34
-33
lines changed

4 files changed

+34
-33
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
## [0.9.7] - March 26, 2019:
1+
## [0.9.7] - May 13, 2019:
22

33
* Added onImageError callback
4+
* Added custom textstyle and edgeinsets callback ([#72](https://github.com/Sub6Resources/flutter_html/pull/72))
5+
* Update dependency versions ([#84](https://github.com/Sub6Resources/flutter_html/issues/84))
6+
* Fixes #82 and #86
47

58
## [0.9.6] - March 11, 2019:
69

lib/html_parser.dart

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import 'package:html/dom.dart' as dom;
66
import 'package:html/parser.dart' as parser;
77

88
typedef CustomRender = Widget Function(dom.Node node, List<Widget> children);
9-
typedef CustomTextStyle = TextStyle Function(dom.Node node, TextStyle baseStyle);
9+
typedef CustomTextStyle = TextStyle Function(
10+
dom.Node node,
11+
TextStyle baseStyle,
12+
);
1013
typedef CustomEdgeInsets = EdgeInsets Function(dom.Node node);
1114
typedef OnLinkTap = void Function(String url);
1215

@@ -150,9 +153,9 @@ class HtmlRichTextParser extends StatelessWidget {
150153
this.customEdgeInsets,
151154
this.onImageError,
152155
this.linkStyle = const TextStyle(
153-
decoration: TextDecoration.underline,
154-
color: Colors.blueAccent,
155-
decorationColor: Colors.blueAccent,
156+
decoration: TextDecoration.underline,
157+
color: Colors.blueAccent,
158+
decorationColor: Colors.blueAccent,
156159
),
157160
});
158161

@@ -274,10 +277,8 @@ class HtmlRichTextParser extends StatelessWidget {
274277
childStyle: DefaultTextStyle.of(context).style,
275278
);
276279

277-
// ignore the top level "body"
278-
body.nodes
279-
.forEach((dom.Node node) => _parseNode(node, parseContext, context));
280-
// _parseNode(body, parseContext);
280+
// don't ignore the top level "body"
281+
_parseNode(body, parseContext, context);
281282

282283
// filter out empty widgets
283284
List<Widget> children = [];
@@ -425,12 +426,6 @@ class HtmlRichTextParser extends StatelessWidget {
425426

426427
// OTHER ELEMENT NODES
427428
else if (node is dom.Element) {
428-
assert(() {
429-
// debugPrint("Found ${node.localName}");
430-
// debugPrint(node.outerHtml);
431-
return true;
432-
}());
433-
434429
if (!_supportedElements.contains(node.localName)) {
435430
return;
436431
}
@@ -759,7 +754,10 @@ class HtmlRichTextParser extends StatelessWidget {
759754
}
760755
BlockText blockText = BlockText(
761756
margin: _customEdgeInsets ??
762-
EdgeInsets.only(top: 8.0, bottom: 8.0, left: parseContext.indentLevel * indentSize),
757+
EdgeInsets.only(
758+
top: 8.0,
759+
bottom: 8.0,
760+
left: parseContext.indentLevel * indentSize),
763761
padding: EdgeInsets.all(2.0),
764762
decoration: decoration,
765763
child: RichText(

pubspec.lock

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ packages:
1414
name: async
1515
url: "https://pub.dartlang.org"
1616
source: hosted
17-
version: "2.0.8"
17+
version: "2.2.0"
1818
boolean_selector:
1919
dependency: transitive
2020
description:
@@ -59,7 +59,7 @@ packages:
5959
name: html
6060
url: "https://pub.dartlang.org"
6161
source: hosted
62-
version: "0.13.3+3"
62+
version: "0.14.0+2"
6363
logging:
6464
dependency: transitive
6565
description:
@@ -73,7 +73,7 @@ packages:
7373
name: matcher
7474
url: "https://pub.dartlang.org"
7575
source: hosted
76-
version: "0.12.3+1"
76+
version: "0.12.5"
7777
meta:
7878
dependency: transitive
7979
description:
@@ -88,13 +88,20 @@ packages:
8888
url: "https://pub.dartlang.org"
8989
source: hosted
9090
version: "1.6.2"
91+
pedantic:
92+
dependency: transitive
93+
description:
94+
name: pedantic
95+
url: "https://pub.dartlang.org"
96+
source: hosted
97+
version: "1.5.0"
9198
quiver:
9299
dependency: transitive
93100
description:
94101
name: quiver
95102
url: "https://pub.dartlang.org"
96103
source: hosted
97-
version: "2.0.1"
104+
version: "2.0.3"
98105
sky_engine:
99106
dependency: transitive
100107
description: flutter
@@ -106,7 +113,7 @@ packages:
106113
name: source_span
107114
url: "https://pub.dartlang.org"
108115
source: hosted
109-
version: "1.4.1"
116+
version: "1.5.5"
110117
stack_trace:
111118
dependency: transitive
112119
description:
@@ -120,7 +127,7 @@ packages:
120127
name: stream_channel
121128
url: "https://pub.dartlang.org"
122129
source: hosted
123-
version: "1.6.8"
130+
version: "2.0.0"
124131
string_scanner:
125132
dependency: transitive
126133
description:
@@ -134,28 +141,21 @@ packages:
134141
name: term_glyph
135142
url: "https://pub.dartlang.org"
136143
source: hosted
137-
version: "1.0.1"
144+
version: "1.1.0"
138145
test_api:
139146
dependency: transitive
140147
description:
141148
name: test_api
142149
url: "https://pub.dartlang.org"
143150
source: hosted
144-
version: "0.2.1"
151+
version: "0.2.5"
145152
typed_data:
146153
dependency: transitive
147154
description:
148155
name: typed_data
149156
url: "https://pub.dartlang.org"
150157
source: hosted
151158
version: "1.1.6"
152-
utf:
153-
dependency: transitive
154-
description:
155-
name: utf
156-
url: "https://pub.dartlang.org"
157-
source: hosted
158-
version: "0.9.0+5"
159159
vector_math:
160160
dependency: transitive
161161
description:
@@ -164,5 +164,5 @@ packages:
164164
source: hosted
165165
version: "2.0.8"
166166
sdks:
167-
dart: ">=2.0.0 <3.0.0"
167+
dart: ">=2.2.0 <3.0.0"
168168
flutter: ">=0.5.0"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ environment:
99
flutter: '>=0.5.0'
1010

1111
dependencies:
12-
html: ^0.13.3
12+
html: ^0.14.0
1313
flutter:
1414
sdk: flutter
1515

0 commit comments

Comments
 (0)