first implementation finished

This commit is contained in:
Fabian Freund
2024-04-22 11:21:01 +02:00
parent 1a13ca0795
commit 0e1972242a
102 changed files with 7192 additions and 55 deletions
@@ -0,0 +1,23 @@
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
Favicon? choseFavicon(Iterable<Favicon>? favicons, [Favicon? currentIcon]) {
var selectedIcon = currentIcon;
if (favicons != null) {
for (final icon in favicons) {
if (selectedIcon == null) {
selectedIcon = icon;
} else {
if ((selectedIcon.width == null &&
!selectedIcon.url.toString().endsWith("favicon.ico")) ||
(icon.width != null &&
selectedIcon.width != null &&
icon.width! > selectedIcon.width!)) {
selectedIcon = icon;
}
}
}
}
return selectedIcon;
}