picons 3.0.1
picons: ^3.0.1 copied to clipboard
1512 Phosphor icons for Flutter — thin, light, regular, bold, fill, and duotone styles.
Picons #
1512 icons for Flutter — thin, light, regular, bold, fill, and duotone styles. Based on Phosphor Icons.
Requirements #
- Dart ≥ 3.3
- Flutter ≥ 3.10
Installation #
flutter pub add picons
Usage #
import 'package:picons/picons.dart';
Default style #
Set a global style once in main.dart and access any icon without repeating it:
Picons.defaultStyle = PiconsStyle.bold;
Icon(Picons.pencil)
Icon(Picons.house)
Icon(Picons.star)
Specific style #
Use a style class directly — always explicit, unaffected by defaultStyle:
Icon(PiconsRegular.pencil)
Icon(PiconsFill.pencil)
Icon(PiconsBold.pencil)
Icon(PiconsThin.pencil)
Icon(PiconsLight.pencil)
Duotone #
Use Picon instead of Icon to render the duotone stack:
Picon(PiconsDuotone.pencil)
When using
Picons.defaultStyle = PiconsStyle.duotone,Picons.xreturns the primary layer as a flatPiconData. For full duotone rendering always usePiconsDuotonedirectly.
Custom secondary color:
Picon(
PiconsDuotone.pencil,
color: Colors.blue,
duoColor: Colors.yellow,
duoOpacity: 0.5,
)
Piconworks exactly like the nativeIconwidget for all non-duotone icons.
Theme integration #
Configure duotone defaults globally via PiconsTheme:
MaterialApp(
theme: ThemeData(
extensions: [
PiconsTheme(color: Colors.grey, duoColor: Colors.grey, duoOpacity: 0.2),
],
),
darkTheme: ThemeData(
extensions: [
PiconsTheme(color: Colors.white, duoColor: Colors.white, duoOpacity: 0.15),
],
),
)
Colors resolve in this order: explicit value on the widget → PiconsTheme → IconTheme.
Migrating from v2 #
PiconDuotoneData constructor changed — it no longer extends IconData.
Old: PiconDuotoneData(int codePoint, PiconData secondary)
New: PiconDuotoneData(PiconData primary, PiconData secondary)
Use PiconsDuotone.x to get a fully-typed PiconDuotoneData, and render it
with Picon() instead of Icon():
// v2
Icon(PiconsDuotone.pencil)
// v3
Picon(PiconsDuotone.pencil)
Picon no longer extends Icon — it is now a plain StatelessWidget.
All visual parameters (size, color, shadows, etc.) are identical.
Picons.x with defaultStyle = duotone now returns the primary layer as
PiconData. For full duotone rendering use PiconsDuotone.x directly.
Example App #
cd example
flutter pub get
flutter run
License #
MIT © Liontude, LLC
This project is a fork of phosphor-icons/phosphor-flutter by Phosphor Icons, licensed under MIT.