favicon 1.0.13

  • Readme
  • Changelog
  • Example
  • Installing
  • 77

Finds a website's favicons, and orders them by image dimension.

Inspired by https://github.com/scottwernervt/favicon.

1.0.13 #

  • Better validation of ICO file signature, an ico can also contain a PNG.
  • Cleaned up code a bit.

1.0.12 #

  • Validation of ICO file signaturee

1.0.11 #

  • Support for filtering acceptable file extensions
  • Trims query string from URL

1.0.10 #

  • Fix for NPE at content type check

1.0.9 #

  • Always look for a valid HTTP status code, non-zero content and an image response header.

1.0.8 #

  • Trims whitespace before and after URLs

1.0.7 #

  • Double-check content type for predefined URLs

1.0.6 #

  • Fix for URLs with just path

1.0.5 #

  • Fix for failure on multiple link tags
  • Fix for NPE

1.0.4 #

  • Will sort output based on image dimensions
  • Added a getBest methods

1.0.3 #

  • Don't rely on HTTP 200 OK for predefined URLs, but check file size too

1.0.2 #

  • Fix for relative URLs

1.0.1 #

  • Fixed broken example

1.0.0 #

  • Initial version, created by Stagehand

example/favicon_example.dart

import 'package:favicon/favicon.dart';

main() async {
  var urls = [
    'https://www.aftonbladet.se',
    'https://www.braziltravelblog.com',
    'https://www.mashable.com',
    'https://tradevenue.se/miljonarinnan30',
    'https://github.com/',
    'https://www.businessinsider.com/',
    'https://www.mrmoneymustache.com/',
    'https://thedividendstory.com/',
    'http://dailybeast.com',
    'https://www.traveldailynews.com/',
    'https://www.tenable.com/blog-rss',
    'http://blog.tenablesecurity.com/atom.xml', // Should fail and yield null
    'https://hbr.org/',
    'http://benfrain.com/',
    'http://www.alistapart.com',
    'https://fortune.com/',
    'https://tidochpengar.se/'
  ];

  for (var url in urls) {
    print(url);
    print(await Favicon.getBest(url));
    print('');
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  favicon: ^1.0.13

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:favicon/favicon.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
54
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
77
Learn more about scoring.

We analyzed this package on Jul 10, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15

Health issues and suggestions

Document public APIs. (-1 points)

15 out of 15 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
html ^0.14.0+3 0.14.0+3
http ^0.12.0+4 0.12.1
image ^2.1.12 2.1.14
Transitive dependencies
archive 2.0.13
args 1.6.0
charcode 1.1.3
collection 1.14.13 1.15.0-nullsafety
convert 2.1.1
crypto 2.1.5
csslib 0.16.1
http_parser 3.1.4
meta 1.2.2 1.3.0-nullsafety
path 1.7.0
petitparser 3.0.4
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.2.0 1.3.0-nullsafety
xml 4.2.0
Dev dependencies
pedantic ^1.8.0 1.9.2