This package provides a set of pixel art icons as font for Flutter, it can be used in the same way we use Icons class.
- See all available icons at https://pixelarticons.com/free/.
- Get the Figma file at https://www.figma.com/community/file/952542622393317653.
Icon set created by @halfmage, if you like this free icon set you will also like the premium ones.
You can check the latest version on pub.dev/pixelarticons.
dependencies:
# ...
pixelarticons: <latest-version>
# ...or run:
flutter pub add pixelarticonsImport wherever you want:
import 'package:pixelarticons/pixelarticons.dart';pixelarticons package uses the IconData class, so the usage is pretty much the same of the Icons class but renamed to Pixel.
Be aware:
- Lower-case for all icons and no separators, for example
card-plusis written asPixel.cardplus. - Icons that starts with non-alpha characters, like
4k,4k-box,4gare prefixed withk. - Icons that are Dart keywords, like
switchare prefix withkas well.
So use k4k, k4kbox, kswitch instead.
Icon full list https://pixelarticons.com/free/.
/// 4k icon:
Icon(Pixel.k4k)
/// switch icon:
Icon(Pixel.kswitch)
/// align-left icon:
Icon(Pixel.alignleft);This library automatically syncs with the pixelarticons repository, generates a font, and publishes to pub.dev.
All automation lives in tool/, a standalone Dart CLI:
# Check for upstream changes (dry run)
dart run tool/bin/pixelarticons_tool.dart --dry-run
# Download and process SVGs
dart run tool/bin/pixelarticons_tool.dart
# Force re-download even if up to date
dart run tool/bin/pixelarticons_tool.dart --no-cacheThe tool:
- Fetches the latest commit hash from
halfmage/pixelarticonsmaster branch - Compares it with the
pixelarticons_commitkey inpubspec.yaml - If there's a new commit: downloads the repo zipball, extracts SVGs, applies Dart naming conventions (prefixing keywords and numeric names with
k), and places them inrelease/svg/ - Bumps the package version and updates
CHANGELOG.md
After the tool runs, fontify generates the icon font and Dart class from the SVGs:
dart pub global activate fontify
dart pub global run fontifyThis reads from release/svg/ and generates:
fonts/pixelarticons.otf— the icon fontlib/pixel.dart— the Dart class withIconDataconstants
The fontify configuration is in pubspec.yaml under the fontify: key.
Two GitHub Actions workflows handle the automation:
publish.yml— runs on cron (1st and 15th of each month) or manual dispatch. Checks for upstream changes, downloads SVGs, generates the font, commits, and pushes a version tag.release.yml— triggered by the version tag push, publishes to pub.dev using OIDC automated publishing.
Required: Dart SDK (>= 3.0.0) and Flutter SDK.
# Install tool dependencies
cd tool && dart pub get && cd ..
# Run the tool
dart run tool/bin/pixelarticons_tool.dart --no-cache
# Generate font
dart pub global activate fontify
dart pub global run fontify
# Format
dart format .cd tool && dart pub get && dart testUse the issues tab to discuss new features and bug reports.

