File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import 'package:flutter_html/src/style.dart';
44import 'package:html/dom.dart' as dom;
55//TODO(Sub6Resources): don't use the internal code of the html package as it may change unexpectedly.
66//ignore: implementation_imports
7- import 'package:html/src/query_selector.dart' ;
7+ import 'package:html/src/query_selector.dart' as qs ;
88import 'package:list_counter/list_counter.dart' ;
99
1010/// A [StyledElement] applies a style to all of its children.
@@ -26,6 +26,14 @@ class StyledElement {
2626 required this .node,
2727 });
2828
29+ bool matches (dom.Element element, String selector) {
30+ try {
31+ return qs.matches (element, selector);
32+ } catch (_) {
33+ return false ;
34+ }
35+ }
36+
2937 bool matchesSelector (String selector) {
3038 return (element != null && matches (element! , selector)) || name == selector;
3139 }
You can’t perform that action at this time.
0 commit comments