Skip to content

Added image loader to view loader while image is loading #278

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

Closed
wants to merge 4 commits into from
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
1 change: 1 addition & 0 deletions flutter_html
Submodule flutter_html added at 0d7581
4 changes: 3 additions & 1 deletion lib/flutter_html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Html extends StatelessWidget {
this.onImageTap,
this.blacklistedElements = const [],
this.style,
this.imageLoader = const CircularProgressIndicator(),
}) : super(key: key);

final String data;
Expand All @@ -55,7 +56,7 @@ class Html extends StatelessWidget {
/// Either return a custom widget for specific node types or return null to
/// fallback to the default rendering.
final Map<String, CustomRender> customRender;

final Widget imageLoader;
/// Fancy New Parser parameters
final Map<String, Style> style;

Expand All @@ -74,6 +75,7 @@ class Html extends StatelessWidget {
style: style,
customRender: customRender,
blacklistedElements: blacklistedElements,
imageLoader: imageLoader,
),
);
}
Expand Down
2 changes: 2 additions & 0 deletions lib/html_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class HtmlParser extends StatelessWidget {
final Map<String, Style> style;
final Map<String, CustomRender> customRender;
final List<String> blacklistedElements;
final Widget imageLoader;

HtmlParser({
@required this.htmlData,
Expand All @@ -40,6 +41,7 @@ class HtmlParser extends StatelessWidget {
this.style,
this.customRender,
this.blacklistedElements,
this.imageLoader,
});

@override
Expand Down
Loading