Skip to content

Commit 3e9fbfd

Browse files
committed
Add OnLinkTap typedef for better indication of exact function type
1 parent fe799f3 commit 3e9fbfd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/flutter_html.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Html extends StatelessWidget {
1919
final EdgeInsetsGeometry padding;
2020
final Color backgroundColor;
2121
final TextStyle defaultTextStyle;
22-
final Function onLinkTap;
22+
final OnLinkTap onLinkTap;
2323
final bool renderNewlines;
2424

2525
/// Either return a custom widget for specific node types or return null to

lib/html_parser.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:html/parser.dart' as parser;
33
import 'package:html/dom.dart' as dom;
44

55
typedef CustomRender = Widget Function(dom.Node node, List<Widget> children);
6+
typedef OnLinkTap = void Function(String url);
67

78
class HtmlParser {
89
HtmlParser({
@@ -13,7 +14,7 @@ class HtmlParser {
1314
});
1415

1516
final double width;
16-
final Function onLinkTap;
17+
final OnLinkTap onLinkTap;
1718
final bool renderNewlines;
1819
final CustomRender customRender;
1920

0 commit comments

Comments
 (0)