tafkeet 1.0.0
tafkeet: ^1.0.0 copied to clipboard
Convert numbers to words in Arabic and English with 90+ currency support. Includes extensions for double, int, and String types.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0 - 2025-12-09 #
π Initial Release #
First stable release of Tafkeet - A comprehensive Flutter package for converting numbers to words in Arabic and English.
β¨ Features #
Core Functionality
- Number to Words Conversion: Convert numbers to words in Arabic and English
- Dual Language Support: Full support for Arabic (
Lang.ar) and English (Lang.en) - Large Number Support: Handle numbers up to trillions
- Decimal Support: Convert decimal numbers with automatic rounding based on currency precision (
partPrecision) - Gender-Aware: Correct masculine/feminine handling based on currency type
Currency Support
- 90+ World Currencies: Support for over 90 currencies from around the world
- 21 Arabic Currencies: SAR, AED, KWD, QAR, OMR, BHD, EGP, SYP, JOD, LBP, IQD, YER, LYD, TND, DZD, MAD, SDG, SOS, MRU, DJF, KMF
- Major World Currencies: USD, EUR, GBP, JPY, CHF, CAD, AUD, NZD, CNY, INR, RUB, BRL, ZAR, SEK, NOK, DKK, PLN, TRY, and more
- Custom Currency Support: Add, update, or remove custom currencies
- Currency Groups:
Currency.arabicCurrenciesandCurrency.majorCurrenciesgetters
API & Extensions
- Simple API:
Tafkeet.convert(number, lang: Lang.ar, currency: Currency.SAR) - Type Extensions: Convert numbers directly with
.tafkeet()methoddoubleextension:120.5.tafkeet(lang: Lang.ar)intextension:250.tafkeet(lang: Lang.en)Stringextension:'75.25'.tafkeet()with automatic number validation
- Configuration:
Tafkeet.configure()for setting default language and currency - Custom Prefix/Suffix: Add custom text before and after converted numbers
Currency Management
CurrencyConfig.addCurrency()- Add custom currenciesCurrencyConfig.updateCurrency()- Update existing currency settingsCurrencyConfig.removeCurrency()- Remove currenciesCurrencyConfig.getCurrency()- Get currency informationCurrencyConfig.hasCurrency()- Check if currency existsCurrencyConfig.getAllCurrencies()- Get all available currenciesCurrencyConfig.reset()- Reset to default configuration
Developer Experience
- Well-Organized Structure: Clean folder structure with separate modules
- Comprehensive Documentation: Full English documentation with examples
- Type Safety: Strong typing with enums for languages and currencies
- Extensible: Easy to add new languages or currencies
- Tested: Full test coverage with 13+ unit tests
π¦ Package Structure #
lib/
βββ tafkeet.dart # Main entry point
βββ tafkeet/
β βββ tafkeet.dart # Core conversion class
β βββ models/
β β βββ language.dart # Language enum (Lang.ar, Lang.en)
β β βββ currency.dart # Currency enum (90+ currencies)
β β βββ currency_info.dart # Currency information model
β βββ config/
β β βββ currency_config.dart # Currency configuration manager
β βββ converters/
β β βββ arabic_converter.dart # Arabic number conversion logic
β β βββ english_converter.dart # English number conversion logic
β βββ extensions/
β β βββ double_extension.dart # Extension on double
β β βββ int_extension.dart # Extension on int
β β βββ string_extension.dart # Extension on String
β βββ utils/
β βββ number_utils.dart # Number utility functions
π§ Technical Details #
- Minimum SDK: Dart 3.0.0
- Flutter: 1.17.0 or higher
- License: MIT
- Code Quality: All code comments in English
- Documentation: Complete README.md with usage examples
π Examples #
// Basic conversion
Tafkeet.convert(120, lang: Lang.ar);
// With currency
Tafkeet.convert(250.50, lang: Lang.ar, currency: Currency.SAR);
// Using extensions
120.tafkeet(lang: Lang.ar);
'75.25'.tafkeet(currency: Currency.USD);
// Configure defaults
Tafkeet.configure(defaultLang: Lang.ar, defaultCurrency: Currency.SAR);
// Decimal rounding (automatic based on partPrecision)
Tafkeet.convert(19002.989, lang: Lang.ar, currency: Currency.SAR);
// 19002.989 β rounded to 19002.99 (2 decimal places)
// Result: ΨͺΨ³ΨΉΨ© ΨΉΨ΄Ψ± Ψ£ΩΩ Ω Ψ§Ψ«ΩΨ§Ω Ψ±ΩΨ§Ω Ψ³ΨΉΩΨ―Ω Ω ΨͺΨ³ΨΉΨ© Ω ΨͺΨ³ΨΉΩΩ ΩΩΩΨ© ΩΩΨ· ΩΨ§ ΨΊΩΨ±
π Supported Languages #
- Arabic (ar) - Ψ§ΩΨΉΨ±Ψ¨ΩΨ©
- English (en)
π° Currency Support #
- Total: 91 currencies
- Arabic: 21 currencies
- Major: 10+ major world currencies
- Custom: Unlimited custom currencies via configuration
Future Plans #
- Add more languages (French, Spanish, etc.)
- Add more currency configurations
- Improve performance for very large numbers
- Add more customization options