パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.0.3

icon_file

拡張子付きのファイルアイコンを表示するためのFlutterウィジェット。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
37
いいね数
2
Pub ポイント
160

パッケージをインストール

flutter pub add icon_file

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

icon_file は、ファイル拡張子に基づいてファイルアイコンを表示するためのウィジェットを提供するFlutterパッケージです。Android、iOS、Web、macOS、Windows、Linuxなど複数のプラットフォームで、さまざまなファイルタイプの視覚的表現を簡単に表示できます。.pdf、.jpg、.txtなどの一般的な拡張子に対して適切なアイコンを自動的に選択し、ファイル関連アプリケーションにおけるユーザーインターフェースの明確性を高めます。軽量で、最小限の設定で簡単に統合可能です。

用途

  • ファイルエクスプローラーでファイルタイプを表示する
  • 視覚的ヒントでドキュメントリストを強化する
  • クラウドストレージアプリのUIを改善する
  • アップロードインターフェース内のファイル形式の表示
  • プロジェクト管理ツールにおけるビジュアルフィードバック

主な機能

  • ファイル拡張子によるアイコンの自動選択
  • 複数プラットフォームのサポート
  • 軽量で簡単に統合可能
  • カスタマイズ可能なアイコンのサイズと色
  • 一般的なファイルタイプ用の事前定義済みアイコン

適している対象

  • ファイル管理アプリ
  • ドキュメント共有プラットフォーム
  • クラウドストレージインターフェース
  • ファイル処理機能を備えた開発ツール
  • 視覚的なファイルタイプのインジケーターを必要とする UI

注意事項

  • 事前に定義されたファイル拡張子に限定
  • カスタムアイコンマッピングのサポートなし
  • 一貫性を保つために追加のスタイル設定が必要になる場合があります
  • 外部のアイコンアセットに依存しています
  • 高度にカスタマイズされたアイコンのニーズには適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

📂 icon_file

A Flutter package to automatically display a file icon (SVG) with a dynamic badge based on the file extension (.pdf, .jpg, .zip, etc.).
Perfect for file explorers, downloads, or file previews in apps.

🧩 Features

  • Automatic detection of the file extension
  • Dynamic colored badge based on file type
  • Customizable style (color, text, etc.)
  • Supports over 30 common extensions
  • Ready for responsive layouts (ScreenUtil)
  • Dark mode friendly

📸 Preview

Default Icons Customized Icons
default_icons custom_icons

🚀 Installation

Add this to your pubspec.yaml:

dependencies:
  icon_file: ^1.0.X

Then run:

flutter pub get

🛠️ Basic Usage

import "package:icon_file/icon_file.dart";
FileIcon("document.pdf");

🎨 Example with Custom Styles

FileIcon(
  "custom.pdf",
  color: Colors.deepPurple,
  extensionStyle: TextStyle(
    fontSize: 12,
    fontWeight: FontWeight.bold,
    color: Colors.yellow,
  ),
)

💡 Available Parameters

Parameter Description
fileName (required) File name with extension (document.pdf)
color Custom background color for the badge (optional)
showExtension Whether to show the badge with the extension (default: true)
extensionStyle Text style for the extension badge
assetIcon Custom path to SVG icon (default: assets/file.svg)
size Size of the icon (default: 80)
roundedLabel Whether the badge has rounded corners (default: true)

🔍 Supported Extensions

This package automatically supports the following file types (and can be extended):

pdf, doc, docx, ppt, pptx, xls, xlsx, csv, txt, png, jpg, jpeg, svg, mp3, wav, aac, mp4, avi, mov, js, css, html, json, xml, zip, rar, 7z, tar, gz, dart


🧪 Full Example (UI)

List<String> files = [
  'document.pdf',
  'notes.docx',
  'image.png',
  'video.mp4',
  'music.mp3',
  'slides.pptx',
  'spreadsheet.xlsx',
  'archive.zip',
  'script.js',
  'style.css',
  'readme.txt',
  'logo.svg',
  'data.json',
  'source.dart',
];

List<Widget> icons = files.map((file) => FileIcon(file)).toList();

👥 Contributing

Contributions are welcome!
Feel free to open an issue, submit a pull request, or simply report a bug.


📄 License

This project is licensed under the MIT License.

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。