zeba_academy_formatter 1.0.0
zeba_academy_formatter: ^1.0.0 copied to clipboard
A lightweight Flutter package for currency, date, number, phone, and localization formatting.
zeba_academy_formatter #
A lightweight, fast, and developer-friendly Flutter formatting package that provides utilities for formatting currencies, dates, numbers, phone numbers, and localized values with a simple API.
⨠Features #
- š° Currency formatting
- š Date formatting with custom patterns
- š¢ Number shortening (1K, 1M, 1B)
- š± Phone number formatting
- š Localization support
- ā” Fast and lightweight
- ā Null-safe
- šÆ Easy-to-use API
- ā¤ļø Production ready
Installation #
Add the dependency to your pubspec.yaml.
dependencies:
zeba_academy_formatter: ^1.0.0
Then run:
flutter pub get
Import #
import 'package:zeba_academy_formatter/zeba_academy_formatter.dart';
Currency Formatting #
CurrencyFormatter.format(
12500.75,
symbol: 'ā¹',
);
Output
ā¹12,500.75
Date Formatting #
DateFormatter.format(
DateTime.now(),
pattern: 'dd MMM yyyy',
);
Output
03 Jul 2026
Number Formatting #
NumberFormatter.compact(1200);
NumberFormatter.compact(2500000);
NumberFormatter.compact(7500000000);
Output
1.2K
2.5M
7.5B
Phone Number Formatting #
Indian
PhoneFormatter.indian("9876543210");
Output
98765 43210
US
PhoneFormatter.us("1234567890");
Output
(123) 456-7890
Localization #
Currency
LocalizationFormatter.currency(
5000,
"en_US",
);
Decimal
LocalizationFormatter.decimal(
123456789,
"de_DE",
);
Example #
import 'package:flutter/material.dart';
import 'package:zeba_academy_formatter/zeba_academy_formatter.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Formatter Demo'),
),
body: Padding(
padding: const EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
CurrencyFormatter.format(
25000,
symbol: 'ā¹',
),
),
Text(
DateFormatter.format(
DateTime.now(),
pattern: 'dd MMM yyyy',
),
),
Text(
NumberFormatter.compact(1500000),
),
Text(
PhoneFormatter.indian(
'9876543210',
),
),
],
),
),
),
);
}
}
API Overview #
| Class | Description |
|---|---|
| CurrencyFormatter | Formats currency values |
| DateFormatter | Formats dates using custom patterns |
| NumberFormatter | Converts numbers to compact notation |
| PhoneFormatter | Formats Indian and US phone numbers |
| LocalizationFormatter | Localized currency and decimal formatting |
Platform Support #
| Platform | Supported |
|---|---|
| Android | ā |
| iOS | ā |
| Web | ā |
| Windows | ā |
| macOS | ā |
| Linux | ā |
Roadmap #
Version 1.1 #
- Relative time formatting
- Percentage formatting
- File size formatting
- Credit card formatter
- Scientific notation
- Ordinal formatter
Version 1.2 #
- Input formatters
- Time formatter
- Duration formatter
- Currency parser
- Date parser
- Time zone formatter
Version 2.0 #
- 100+ locale support
- Extension methods
- Advanced masking
- High-performance formatter engine
- Complete unit test coverage
Contributing #
Contributions, issues, and feature requests are welcome.
If you would like to improve this package, feel free to fork the repository and submit a pull request.
License #
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).
See the LICENSE file for details.
About Me #
⨠Iām Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects.
You can learn more about me and my work at https://sufyanism.com/ or connect with me on LinkedIn:
https://www.linkedin.com/in/sufyanism
Your all-in-one learning hub! #
š Explore courses and resources in coding, technology, and development at Zeba Academy.
Learn through practical tutorials, real-world projects, and hands-on experience.
š Websites #
Main Website
Learning Portal
šŗ YouTube #
https://www.youtube.com/@zeba.academy
šø Instagram #
https://www.instagram.com/zeba.academy/
Thank You #
Thank you for using zeba_academy_formatter.
If you like this package, don't forget to ā the repository and share it with the Flutter community.
Happy Coding! š