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';
4
4
import 'package:html/dom.dart' as dom;
5
5
//TODO(Sub6Resources): don't use the internal code of the html package as it may change unexpectedly.
6
6
//ignore: implementation_imports
7
- import 'package:html/src/query_selector.dart' ;
7
+ import 'package:html/src/query_selector.dart' as qs ;
8
8
import 'package:list_counter/list_counter.dart' ;
9
9
10
10
/// A [StyledElement] applies a style to all of its children.
@@ -26,6 +26,14 @@ class StyledElement {
26
26
required this .node,
27
27
});
28
28
29
+ bool matches (dom.Element element, String selector) {
30
+ try {
31
+ return qs.matches (element, selector);
32
+ } catch (_) {
33
+ return false ;
34
+ }
35
+ }
36
+
29
37
bool matchesSelector (String selector) {
30
38
return (element != null && matches (element! , selector)) || name == selector;
31
39
}
You can’t perform that action at this time.
0 commit comments