Skip to content

Commit 1a26c86

Browse files
committed
Version 0.5.0
1 parent dce095f commit 1a26c86

File tree

8 files changed

+449
-784
lines changed

8 files changed

+449
-784
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [0.5.0] - August 23, 2018:
2+
3+
* Major refactor that makes entire tree a Widget and eliminates the need to distinguish between inline and block elements.
4+
* Fixed #7, #9, #10, and #11.
5+
16
## [0.4.1] - August 15, 2018:
27

38
* Fixed issue with images not loading when inside of `p` tag (#6)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A Flutter widget for rendering static html tags as Flutter widgets. (Will render
77
Add the following to your `pubspec.yaml` file:
88

99
dependencies:
10-
flutter_html: ^0.4.1
10+
flutter_html: ^0.5.0
1111

1212
## Currently Supported HTML Tags:
1313

@@ -174,5 +174,5 @@ until official support is added.
174174
//Optional parameters:
175175
padding: EdgeInsets.all(8.0),
176176
backgroundColor: Colors.white70,
177-
defaultTextStyle: TextStyle(color: Colors.black),
177+
defaultTextStyle: TextStyle(fontFamily: 'serif'),
178178
)

example/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void main() {
2121
//Optional parameters:
2222
padding: EdgeInsets.all(8.0),
2323
backgroundColor: Colors.white70,
24-
defaultTextStyle: TextStyle(color: Colors.black),
24+
defaultTextStyle: TextStyle(fontFamily: 'serif'),
2525
),
2626
),
2727
),

lib/flutter_html.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,18 @@ class Html extends StatelessWidget {
1919

2020
@override
2121
Widget build(BuildContext context) {
22+
final double width = MediaQuery.of(context).size.width;
23+
2224
return Container(
2325
padding: padding,
2426
color: backgroundColor,
25-
child: Column(
26-
crossAxisAlignment: CrossAxisAlignment.start,
27-
children: HtmlParser(defaultTextStyle: defaultTextStyle).parse(data),
27+
width: width,
28+
child: DefaultTextStyle.merge(
29+
style: defaultTextStyle,
30+
child: Wrap(
31+
alignment: WrapAlignment.start,
32+
children: HtmlParser(width: width).parse(data),
33+
),
2834
),
2935
);
3036
}

0 commit comments

Comments
 (0)