Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit e04efe6

Browse files
committed
Turn @staticInterop tear-off into closure
@staticInterop members will start disallowing tear-offs, so this member should turn into a closure. The static check wasn't added in time, so this is modifying the source code again.
1 parent fea7d0a commit e04efe6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/web_ui/lib/src/engine/text/font_collection.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,12 @@ class HtmlFontCollection implements FlutterFontCollection {
130130
}
131131

132132
try {
133-
fontFaces.forEach(domDocument.fonts!.add);
133+
// Since we can't use tear-offs for interop members, this code is faster
134+
// and easier to read with a for loop instead of forEach.
135+
// ignore: prefer_foreach
136+
for (final DomFontFace font in fontFaces) {
137+
domDocument.fonts!.add(font);
138+
}
134139
} catch (e) {
135140
return FontInvalidDataError(asset);
136141
}

0 commit comments

Comments
 (0)