Skip to content
pubscout

file_icon

1.0.0, released 6 years ago by an unverified publisher

Widget that shows an icon based on a file name

WASM-ready
$ flutter pub add file_icon
Source repository

What it does

FileIcon renders an icon representing the file type inferred from the file name. It supports multiple platforms and is null‑safe.

AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a quick visual indicator of file types in a list
  • You want a lightweight, cross‑platform solution without custom icon assets

Skip it when

  • You require highly custom icons or theming beyond the provided set
  • You need to support dynamic icon sets that change at runtime

Strengths

  • Simple API, no build_runner or code generation
  • Null‑safe, works on all Flutter platforms
  • Small dependency footprint

Weaknesses

  • Limited to Seti UI icon set, no custom icons
  • No support for color or style overrides beyond size
  • Not a full icon library

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:flutter/material.dart';
import 'package:file_icon/file_icon.dart';

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return FileIcon(
      'main.dart',
      size: 32,
    );
  }
}

Alternatives

Packages that do the same job and could replace file_icon.