Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.5.0 #12

Merged
merged 1 commit into from
Aug 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [0.5.0] - August 23, 2018:

* Major refactor that makes entire tree a Widget and eliminates the need to distinguish between inline and block elements.
* Fixed #7, #9, #10, and #11.

## [0.4.1] - August 15, 2018:

* Fixed issue with images not loading when inside of `p` tag (#6)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A Flutter widget for rendering static html tags as Flutter widgets. (Will render
Add the following to your `pubspec.yaml` file:

dependencies:
flutter_html: ^0.4.1
flutter_html: ^0.5.0

## Currently Supported HTML Tags:

Expand Down Expand Up @@ -174,5 +174,5 @@ until official support is added.
//Optional parameters:
padding: EdgeInsets.all(8.0),
backgroundColor: Colors.white70,
defaultTextStyle: TextStyle(color: Colors.black),
defaultTextStyle: TextStyle(fontFamily: 'serif'),
)
2 changes: 1 addition & 1 deletion example/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void main() {
//Optional parameters:
padding: EdgeInsets.all(8.0),
backgroundColor: Colors.white70,
defaultTextStyle: TextStyle(color: Colors.black),
defaultTextStyle: TextStyle(fontFamily: 'serif'),
),
),
),
Expand Down
12 changes: 9 additions & 3 deletions lib/flutter_html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ class Html extends StatelessWidget {

@override
Widget build(BuildContext context) {
final double width = MediaQuery.of(context).size.width;

return Container(
padding: padding,
color: backgroundColor,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: HtmlParser(defaultTextStyle: defaultTextStyle).parse(data),
width: width,
child: DefaultTextStyle.merge(
style: defaultTextStyle,
child: Wrap(
alignment: WrapAlignment.start,
children: HtmlParser(width: width).parse(data),
),
),
);
}
Expand Down
Loading