패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.0.3

icon_file

확장자와 함께 파일 아이콘을 표시하는 Flutter 위젯입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
54
좋아요
2
Pub 점수
150

패키지 설치

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 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.