zeba_academy_units 0.0.1
zeba_academy_units: ^0.0.1 copied to clipboard
A simple and powerful Flutter unit conversion package supporting length, weight, temperature, speed, area, volume and time conversions.
zeba_academy_units #
A simple, lightweight, and dependency-free Flutter unit conversion package.
zeba_academy_units provides easy-to-use conversion utilities for common measurement categories including:
- Length
- Weight
- Temperature
- Speed
- Area
- Volume
- Time
Built with ❤️ by Zeba Academy for Flutter developers.
Features #
✅ Length conversion ✅ Weight conversion ✅ Temperature conversion ✅ Speed conversion ✅ Area conversion ✅ Volume conversion ✅ Time conversion ✅ Type-safe unit enums ✅ Simple and clean API ✅ No external dependencies ✅ Null-safe ✅ Production-ready Flutter package
Installation #
Add this package to your pubspec.yaml:
dependencies:
zeba_academy_units: ^1.0.0
Then run:
flutter pub get
Import #
import 'package:zeba_academy_units/zeba_academy_units.dart';
Usage #
Length Conversion #
Convert between different length measurements.
final result = LengthConverter.convert(
5,
LengthUnit.kilometer,
LengthUnit.meter,
);
print(result);
// Output:
// 5000
Supported units:
- Meter
- Kilometer
- Centimeter
- Millimeter
- Mile
- Yard
- Foot
- Inch
Weight Conversion #
final result = WeightConverter.convert(
2,
WeightUnit.kilogram,
WeightUnit.gram,
);
print(result);
// Output:
// 2000
Supported units:
- Kilogram
- Gram
- Milligram
- Pound
- Ounce
Temperature Conversion #
final result = TemperatureConverter.convert(
100,
TemperatureUnit.celsius,
TemperatureUnit.fahrenheit,
);
print(result);
// Output:
// 212
Supported units:
- Celsius
- Fahrenheit
- Kelvin
Speed Conversion #
final result = SpeedConverter.convert(
36,
SpeedUnit.kilometerPerHour,
SpeedUnit.meterPerSecond,
);
print(result);
// Output:
// 10
Supported units:
- Meter per second
- Kilometer per hour
- Mile per hour
Area Conversion #
final result = AreaConverter.convert(
1,
AreaUnit.squareKilometer,
AreaUnit.squareMeter,
);
print(result);
// Output:
// 1000000
Supported units:
- Square Meter
- Square Kilometer
- Square Foot
- Acre
Volume Conversion #
final result = VolumeConverter.convert(
1,
VolumeUnit.liter,
VolumeUnit.milliliter,
);
print(result);
// Output:
// 1000
Supported units:
- Liter
- Milliliter
- Gallon
- Cubic Meter
Time Conversion #
final result = TimeConverter.convert(
2,
TimeUnit.hour,
TimeUnit.minute,
);
print(result);
// Output:
// 120
Supported units:
- Second
- Minute
- Hour
- Day
API #
All converters follow the same simple structure:
Converter.convert(
value,
fromUnit,
toUnit,
);
Example:
LengthConverter.convert(
10,
LengthUnit.meter,
LengthUnit.centimeter,
);
Testing #
Run tests:
flutter test
Analyze package:
flutter analyze
Check publishing:
flutter pub publish --dry-run
Roadmap #
Future improvements:
- Unit formatting helpers
- Unit symbols support
- Decimal precision options
- Rounding configuration
- Extension methods
- Custom unit creation
- Scientific unit support
Contributing #
Contributions are welcome.
Steps:
-
Fork the repository
-
Create a feature branch:
git checkout -b feature/new-feature
- Commit changes:
git commit -m "Add new feature"
- Push changes:
git push origin feature/new-feature
- Create a Pull Request
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:
Connect with me:
💼 https://www.linkedin.com/in/sufyanism
Your all-in-one learning hub! #
🚀 Explore courses and resources in coding, technology, and development at:
Empower yourself with practical skills through curated tutorials, real-world projects, and hands-on experience.
Level up your tech game today! 💻✨
Zeba Academy #
Zeba Academy is a learning platform dedicated to coding, technology, and development.
➡ Main website:
➡ Courses and resources:
➡ YouTube tutorials:
https://www.youtube.com/@zeba.academy
➡ Instagram:
https://www.instagram.com/zeba.academy/
License #
This project is licensed under the:
GNU General Public License v3.0 (GPL-3.0) #
You are free to:
✅ Use the software ✅ Modify the source code ✅ Share copies ✅ Distribute improvements
Under the conditions of the GPL-3.0 license.
See the LICENSE file for complete details.
Thank You ❤️ #
Thank you for using zeba_academy_units.
Built with Flutter and open-source passion by:
Zeba Academy