flutter_image_converter
Dart 與 Flutter 圖像之間的轉換:ui、widgets、package image、ImageProvider、原始字節、Base64 字符串。您不再需要撰寫代碼來轉換不同格式的圖像。支援任意方向轉換。
- 星標
- 9
- 分支
- 2
- 最近推送(UTC)
- 2024年9月26日
- 專案狀態
- 未封存
原始 README
以下為英文專案原文快照,最新內容請造訪 GitHub。
Flutter Image Converter
Well-tested and easy-to-use Dart & Flutter image transformer package: ui, widgets, image, ImageProvider, bytes, etc. Works in any direction as an extension. You no longer have to worry about writing code to convert images in different formats. Feel free to use it in your awesome project.
Share some ❤️ and star repo to support the Flutter Image Converter.
If you write an article about FlutterImageConverter or any of these packages, let me know and I'll post the URL of the article in the README 🤝
🚀 Usage
ImageProvider to UI Image
await AssetImage('1.jpg').uiImage
Package Image to Widget Image
Image(...).widgetImage
Any formatted raw bytes to Widget Image
bytes.widgetImage
ImageProvider to PNG raw bytes
AssetImage('nature.webp').pngUint8List
Supports the image providers:
AssetImageFileImageMemoryImageNetworkImage- any providers from pub.dev inherited from
ImageProvider
Can detect all formats from the package image.
See folders example and test for more use cases.
🔄 Available Converters
import 'dart:ui' as ui;
import 'package:flutter/widgets.dart' as widget;
import 'package:image/image.dart' as image;
| extension name | image.Image | ui.Image | widget.Image | ImageProvider | Uint8List | ||
|---|---|---|---|---|---|---|---|
| image.Image | imageImage |
✅ | ✅ | ✅ | ✅ | ||
| ui.Image | uiImage |
✅ | ✅ | ✅ | ✅ | ||
| widget.Image | widgetImage |
✅ | ✅ | ✅ | ✅ | ||
| ImageProvider | imageProvider |
✅ | ✅ | ✅ | ✅ | ||
| Uint8List | uint8List |
✅ | ✅ | ✅ | ✅ |
📸 Screenshots
💛 Thanks
While working on projects, I meet people who make the project better with their outsider and professional view. I want to write down their names here..... and I'd be happy to add your name as well.
⭐ C Davis aka faithoflifedev: Support web platform
⭐ eibaan
✨ What's New
Look at changelog.
👋 Welcome
If you encounter any problems, feel free to open an issue. If you feel the package is missing a feature, please raise a ticket on Github and I'll look into it. Requests and suggestions are warmly welcome. Danke!
Contributions are what make the open-source community such a great place to learn, create, take a new skills, and be inspired.
If this is your first contribution, I'll leave you with some of the best links I've found: they will help you get started or/and become even more efficient.
- Guide to Making a First Contribution. You will find the guide in your native language.
- How to Contribute to Open Source. Longread for deep diving for first-timers and for veterans.
- Summer Guide from Google.
- CodeTriangle. Free community tools for contributing to Open Source projects.
The package FlutterImageConverter is open-source, stable and well-tested. Development happens on GitHub. Feel free to report issues or create a pull-request there.
General questions are best asked on StackOverflow.
And here is a curated list of how you can help:
- Documenting the undocumented. Whenever you come across a class, property, or method within our codebase that you're familiar with and notice it lacks documentation, kindly spare a couple of minutes to jot down some helpful notes for your fellow developers.
- Refining the code. While I'm aware it's primarily my responsibility to refactor the code, I wholeheartedly welcome any contributions you're willing to make in this area. Your insights and improvements are appreciated!
- Constructive code reviews. Should you discover a more efficient approach to achieve something, I'm all ears. Your suggestions for enhancement are invaluable.
- Sharing your examples. If you've experimented with our use cases or have crafted some examples of your own, feel free to add them to the
exampledirectory. Your practical insights can enrich our resource pool. - Fix typos/grammar mistakes.
- Report bugs and scenarios that are difficult to implement.
- Implement new features by making a pull-request.
✅ TODO (perhaps)
Once you start using the FlutterImageConverter, it will become easy to choose the functionality to contribute. But if you already get everything you need from this package but have some free time, let me write here what I have planned:
- Explane
Image,ImageProvider, etc. 1 - DONE Check out the Web platform. THANKS C Davis aka faithoflifedev.
- Detect formats provided
instantiateImageCodec. - SVG?
- IconData?
- Transform images to any formats?
It's just a habit of mine: writing down ideas that come to mind while working on a project. I confess that I rarely return to these notes. But now, hopefully, even if you don't have an idea yet, the above notes will help you choose the suitable "feature" and become a contributor to the open-source community.
Ready for 🪙
Created with ❤️
使用的依賴
依賴清單 5 項
- flutter
{"sdk":"flutter"} - image
^4.2.0 - flutter_lints開發依賴
^5.0.0 - lints開發依賴
^5.0.0 - test開發依賴
^1.25.8
如何選擇適合專案的儲存庫?
先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
- 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
- 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
- 使用前在 GitHub 確認 README、授權條款與 Issues。
來源與維護
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗



