Title: Build broken by html 0.15.7: Method not found: 'matches' in styled_element.dart
Describe the bug:
flutter_html 3.0.0 fails to compile against html 0.15.7 (published 2026-08-28).
styled_element.dart imports package:html's private implementation file and calls its top-level matches():
// ignore: implementation_imports
import 'package:html/src/query_selector.dart' as qs;
...
return qs.matches(element, selector); // line 31
html 0.15.7 removed that top-level matches() function from lib/src/query_selector.dart. Only the SelectorEvaluator.matches method remains, and SelectorEvaluator is not exported publicly either. Because the symbol was private, the removal is not listed as breaking in the html changelog.
flutter_html declares html: ^0.15.5, which admits 0.15.7, so every fresh dependency resolve since 28 August breaks the build. Projects that do not commit pubspec.lock hit this with no change of their own.
HTML to reproduce the issue: n/a - this is a compile-time failure. No HTML or widget is reached.
Html widget configuration: n/a - the app fails to build before any widget is constructed. Reproduce with any project that depends on flutter_html:
flutter pub upgrade html # resolves to 0.15.7
flutter test # or flutter build
Expected behavior:
flutter_html 3.0.0 builds against the versions its own constraint allows.
Device details and Flutter/Dart/flutter_html versions:
flutter_html 3.0.0
html 0.15.7 (fails) / 0.15.6 (works)
- Flutter 3.38.3 stable, Dart 3.10.1
- macOS - platform independent, it is a compile error
Stacktrace/Logcat
../../../.pub-cache/hosted/pub.dev/flutter_html-3.0.0/lib/src/tree/styled_element.dart:31:17:
Error: Method not found: 'matches'.
return qs.matches(element, selector);
^^^^^^^
Additional info:
Workaround for users: pin the transitive dependency.
dependencies:
html: 0.15.6
Possible fixes, in case they help:
- Tighten the constraint to
html: '>=0.15.5 <0.15.7' as an immediate unblock.
- Replace the implementation import with a local selector-match helper, so
flutter_html no longer depends on html's private API.
- Ask the
html package to expose matches() publicly - there is currently no public equivalent (Node.querySelector / querySelectorAll exist, but nothing answers "does this element match this selector").
Title: Build broken by
html0.15.7:Method not found: 'matches'instyled_element.dartDescribe the bug:
flutter_html3.0.0 fails to compile againsthtml0.15.7 (published 2026-08-28).styled_element.dartimportspackage:html's private implementation file and calls its top-levelmatches():html0.15.7 removed that top-levelmatches()function fromlib/src/query_selector.dart. Only theSelectorEvaluator.matchesmethod remains, andSelectorEvaluatoris not exported publicly either. Because the symbol was private, the removal is not listed as breaking in thehtmlchangelog.flutter_htmldeclareshtml: ^0.15.5, which admits 0.15.7, so every fresh dependency resolve since 28 August breaks the build. Projects that do not commitpubspec.lockhit this with no change of their own.HTML to reproduce the issue: n/a - this is a compile-time failure. No HTML or widget is reached.
Htmlwidget configuration: n/a - the app fails to build before any widget is constructed. Reproduce with any project that depends onflutter_html:Expected behavior:
flutter_html3.0.0 builds against the versions its own constraint allows.Device details and Flutter/Dart/
flutter_htmlversions:flutter_html3.0.0html0.15.7 (fails) / 0.15.6 (works)Stacktrace/Logcat
Additional info:
Workaround for users: pin the transitive dependency.
Possible fixes, in case they help:
html: '>=0.15.5 <0.15.7'as an immediate unblock.flutter_htmlno longer depends onhtml's private API.htmlpackage to exposematches()publicly - there is currently no public equivalent (Node.querySelector/querySelectorAllexist, but nothing answers "does this element match this selector").