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

Add crossAxisAlignment parameter #255

Closed
Closed
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
3 changes: 3 additions & 0 deletions lib/flutter_html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Html extends StatelessWidget {
color: Colors.blueAccent,
decorationColor: Colors.blueAccent),
this.shrinkToFit = false,
this.crossAxisAlignment = CrossAxisAlignment.center,
this.imageProperties,
this.onImageTap,
this.showImages = true,
Expand All @@ -43,6 +44,7 @@ class Html extends StatelessWidget {
final ImageErrorListener onImageError;
final TextStyle linkStyle;
final bool shrinkToFit;
final CrossAxisAlignment crossAxisAlignment;

/// Properties for the Image widget that gets rendered by the rich text parser
final ImageProperties imageProperties;
Expand All @@ -69,6 +71,7 @@ class Html extends StatelessWidget {
child: (useRichText)
? HtmlRichTextParser(
shrinkToFit: shrinkToFit,
crossAxisAlignment: crossAxisAlignment,
onLinkTap: onLinkTap,
renderNewlines: renderNewlines,
customEdgeInsets: customEdgeInsets,
Expand Down
3 changes: 3 additions & 0 deletions lib/rich_text_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class ParseContext {
class HtmlRichTextParser extends StatelessWidget {
HtmlRichTextParser({
this.shrinkToFit,
this.crossAxisAlignment,
this.onLinkTap,
this.renderNewlines = false,
this.html,
Expand All @@ -170,6 +171,7 @@ class HtmlRichTextParser extends StatelessWidget {
final double indentSize = 10.0;

final bool shrinkToFit;
final CrossAxisAlignment crossAxisAlignment;
final onLinkTap;
final bool renderNewlines;
final String html;
Expand Down Expand Up @@ -333,6 +335,7 @@ class HtmlRichTextParser extends StatelessWidget {
});

return Column(
crossAxisAlignment: crossAxisAlignment,
children: children,
);
}
Expand Down