gcc_currency
A lightweight Flutter package that provides GCC currency symbols (SAR, AED, QAR, OMR, KWD, BHD) as a custom icon font.
This package is designed for POS systems, invoicing, receipts, financial apps, and anywhere you need clean, scalable currency symbols that behave like icons or text.
โจ Features
- Custom font-based currency symbols (sharp at any size)
- Works with
Icon,Text,RichText, andTextSpan - Colorable & scalable
- No SVG or image assets at runtime
- Optimized for Flutter packages (uses
fontPackage) - ISO-style currency naming
๐ฆ Supported Currencies
| Currency | Code |
|---|---|
| Saudi Riyal | SAR |
| UAE Dirham | AED |
| Qatari Riyal | QAR |
| Omani Rial | OMR |
| Kuwaiti Dinar | KWD |
| Bahraini Dinar | BHD |
๐ Installation
Add this to your pubspec.yaml:
dependencies:
gcc_currency: ^0.0.1
Then run:
flutter pub get
๐งฑ How It Works
This package ships a custom icon font (GCCCurrency) internally. Each currency symbol is mapped to a Unicode value in the Private Use Area and exposed via Dart constants.
This is the same technique used by Material Icons and Font Awesome.
๐งฉ Usage
1. Using as an Icon (Recommended)
import 'package:flutter/material.dart';
import 'package:gcc_currency/gcc_currency.dart';
Icon(
GCCCurrencyIcon.sar,
size: 24,
color: Colors.green,
)
2. Inside Text (RichText / Invoice Style)
RichText(
text: TextSpan(
children: [
GCCCurrencyText.span(
GCCCurrency.aed,
size: 18,
color: Colors.black,
),
const TextSpan(
text: '1,250.00',
style: TextStyle(color: Colors.black),
),
],
),
)
3. With Enum-Based API
GCCCurrency currency = GCCCurrency.omr;
Icon(GCCCurrencyText.icon(currency))
๐ง API Reference
GCCCurrencyIcon
Provides static IconData constants.
GCCCurrencyIcon.sar
GCCCurrencyIcon.aed
GCCCurrencyIcon.qar
GCCCurrencyIcon.omr
GCCCurrencyIcon.kwd
GCCCurrencyIcon.bhd
GCCCurrencyText
Get IconData from enum
IconData icon = GCCCurrencyText.icon(GCCCurrency.kwd);
Create a TextSpan
TextSpan span = GCCCurrencyText.span(
GCCCurrency.bhd,
size: 16,
color: Colors.blue,
);
๐จ๏ธ Printing & PDF Support
Because this uses a font:
- Works perfectly in PDF generation (e.g.
printing,pdfpackages) - Ideal for thermal receipts and invoices
- No rasterization issues
Ensure the font is registered in your PDF engine if required.
๐ง Technical Notes
- Font family:
GCCCurrency - Unicode range: Private Use Area (
0xE001โ0xE006) - Font package name is correctly set to
gcc_currency - All symbols are monochrome by design
๐งช Example
See the example/ folder for a runnable demo app.
๐ค Contributing
Pull requests are welcome. Please ensure:
- Proper Unicode mapping
- Consistent naming
- No breaking API changes
๐ License
MIT License
๐ Author
Developed for real-world GCC fintech, POS, and invoicing systems.
For Custom ERP & POS Solutions connect me
If you find this useful, consider giving it a โญ on GitHub.