ajit_basic_utils 1.0.0+2
ajit_basic_utils: ^1.0.0+2 copied to clipboard
A comprehensive Flutter utility library providing 100+ essential tools including text generators, calculators, converters, image processors, encoders/decoders, network tools, validators, and much more!
Basic Utils Library v2.0.0 ๐ #
A comprehensive Flutter utility library providing 100+ essential tools including text generators, calculators, converters, image processors, encoders/decoders, network tools, validators, timers, QR tools, hash tools, and much more!
โจ What's New in v2.0.0 #
- ๐จ Text Generators: Bubble text, upside down text, glitch text, Lorem Ipsum
- ๐งฎ Advanced Calculators: GPA, interest, compound profit, age, BMI, scientific calculator
- ๐ Unit Converters: Length, speed, temperature, weight, memory/storage, area, volume
- ๐ผ๏ธ Image Tools: OCR, compressor, rotator, converter, resizer, effects
- ๐ Encoders/Decoders: Base64, binary, ROT13, quoted printable, URL, HTML
- ๐ JSON/XML Tools: Beautifier, validator, converter, formatter
- ๐ Network Tools: MX lookup, IP subnet, URL parser, SSL checker, ping
- ๐ Password Tools: Generator, strength checker, bulk generator, bcrypt
- ๐ Text Processors: Cleaner, replacer, case converter, density counter
- โฐ Timers & Widgets: Countdown timer, stopwatch, color picker, date picker
- โ Advanced Validators: Credit card, palindrome, HTTP status, website status
- ๐ฑ QR Tools: Generator, reader, utilities
- ๐ Hash Tools: MD5, SHA, HMAC, hash utilities
๐ฆ Installation #
Add this to your package's pubspec.yaml file:
dependencies:
basic_utils: ^2.0.0
Then run:
flutter pub get
๐ Quick Start #
import 'package:basic_utils/basic_utils.dart';
void main() {
// Text Generators
String bubbleText = TextGenerators.generateBubbleText('Hello');
String upsideDown = TextGenerators.generateUpsideDownText('World');
// Calculators
double gpa = Calculators.calculateGPA([3.5, 4.0, 3.7]);
Map<String, dynamic> bmi = Calculators.calculateBMI(70, 1.75);
// Converters
double meters = LengthConverter.convert(100, 'cm', 'm');
double celsius = TemperatureConverter.convert(32, 'fahrenheit', 'celsius');
// Password Tools
String password = PasswordTools.generatePassword(length: 12);
Map<String, dynamic> strength = PasswordTools.checkPasswordStrength(password);
// Hash Tools
String md5Hash = HashTools.generateMD5('Hello World');
String sha256Hash = HashTools.generateSHA256('Hello World');
// QR Tools
Map<String, dynamic> qrData = QrTools.QrGenerator.generateQrData('Hello QR');
Map<String, dynamic> parsed = QrTools.QrReader.parseQrData('https://example.com');
}
๐ Fun Examples #
Text Generators Fun #
// Create fun text effects
print(TextGenerators.generateBubbleText('123')); // โ โกโข
print(TextGenerators.generateUpsideDownText('123')); // ฦแ
ฦ
print(TextGenerators.generateGlitchText('Hello', intensity: 0.8)); // H#l!o
Calculator Fun #
// Fun calculations
print('Perfect GPA: ${Calculators.calculateGPA([4.0, 4.0, 4.0, 4.0])}'); // 4.0
print('Factorial of 5: ${ScientificCalculator.factorial(5)}'); // 120
print('2^10: ${ScientificCalculator.power(2, 10)}'); // 1024
Converter Fun #
// Fun conversions
print('Speed of light: ${SpeedConverter.convert(299792458, 'm/s', 'km/h')} km/h');
print('Absolute zero: ${TemperatureConverter.convert(0, 'kelvin', 'celsius')}ยฐC');
print('A mile in feet: ${LengthConverter.convert(1, 'mi', 'ft')} ft');
Password Fun #
// Fun password generation
print('Super secure: ${PasswordTools.generatePassword(length: 20)}');
print('Numbers only: ${PasswordTools.generatePassword(length: 6, includeUppercase: false, includeLowercase: false, includeSymbols: false)}');
print('Symbols only: ${PasswordTools.generatePassword(length: 8, includeUppercase: false, includeLowercase: false, includeNumbers: false)}');
๐ Features Overview #
๐จ Text Generators #
Create fun and unique text effects:
- Bubble Text: Convert text to circled Unicode characters
- Upside Down Text: Flip text upside down
- Glitch Text: Add random character substitutions
- Lorem Ipsum: Generate placeholder text
- ASCII Art: Convert text to ASCII art
- Strikethrough/Underline: Add text effects
String bubbleText = TextGenerators.generateBubbleText('Hello');
// Output: โฝโโโโ
String upsideDown = TextGenerators.generateUpsideDownText('Hello');
// Output: oืืวษฅ
String glitch = TextGenerators.generateGlitchText('Hello', intensity: 0.3);
// Output: H#llo (with random symbols)
๐งฎ Calculators #
Comprehensive calculation tools:
- GPA Calculator: Calculate grade point averages
- Interest Calculator: Simple and compound interest
- Compound Profit Calculator: Investment growth calculations
- Age Calculator: Calculate age in years, months, days
- BMI Calculator: Body Mass Index with categories
- Scientific Calculator: Advanced mathematical functions
- EMI Calculator: Loan payment calculations
- Investment Calculator: Return calculations
// GPA Calculation
double gpa = Calculators.calculateGPA([3.5, 4.0, 3.7], credits: [3, 4, 3]);
// BMI Calculation
Map<String, dynamic> bmi = Calculators.calculateBMI(70, 1.75);
print('BMI: ${bmi['bmi']?.toStringAsFixed(1)} (${bmi['category']})');
// Age Calculation
Map<String, int> age = Calculators.calculateAge(DateTime(1990, 5, 15));
print('Age: ${age['years']} years, ${age['months']} months');
// Scientific Calculator
int factorial = Calculators.ScientificCalculator.factorial(5);
double power = Calculators.ScientificCalculator.power(2, 10);
๐ Converters #
Convert between different units:
- Length: mm, cm, m, km, in, ft, yd, mi
- Speed: m/s, km/h, mph, ft/s, knot
- Temperature: Celsius, Fahrenheit, Kelvin
- Weight: mg, g, kg, oz, lb, ton
- Memory/Storage: B, KB, MB, GB, TB, PB
- Area: mmยฒ, cmยฒ, mยฒ, kmยฒ, inยฒ, ftยฒ, acre, hectare
- Volume: ml, l, gal, qt, pt, cup, fl oz
- Time: ms, s, min, h, d, w, mo, y
- Pressure: Pa, kPa, MPa, bar, atm, psi, torr
- Energy: J, kJ, MJ, cal, kcal, Wh, kWh, BTU
- Power: W, kW, MW, hp, BTU/h
// Length Conversion
double meters = Converters.LengthConverter.convert(100, 'cm', 'm');
print('100 cm = $meters m');
// Temperature Conversion
double celsius = Converters.TemperatureConverter.convert(32, 'fahrenheit', 'celsius');
print('32ยฐF = ${celsius.toStringAsFixed(1)}ยฐC');
// Memory Conversion
String formatted = Converters.MemoryConverter.formatBytes(1048576);
print('1048576 bytes = $formatted'); // 1.0 MB
๐ผ๏ธ Image Tools #
Process and manipulate images:
- OCR: Extract text from images (placeholder implementation)
- Compressor: Compress images with quality control
- Rotator: Rotate images (90ยฐ, 180ยฐ, 270ยฐ)
- Converter: Convert between formats (JPG, PNG, WebP)
- Resizer: Resize images with aspect ratio control
- Effects: Apply blur, brightness, contrast, sepia
- Base64: Convert images to/from Base64
// Image Compression
Uint8List compressed = await ImageTools.ImageCompressor.compressImage(
imageBytes,
quality: 85,
format: 'jpeg'
);
// Image Rotation
Uint8List rotated = await ImageTools.ImageRotator.rotateImage(
imageBytes,
angle: 90
);
// Format Conversion
Uint8List converted = await ImageTools.ImageConverter.jpgToPng(jpgBytes);
// Base64 Conversion
String base64 = await ImageTools.ImageToBase64.convertToBase64(
imageBytes,
format: 'png'
);
๐ Encoders/Decoders #
Encode and decode various formats:
- Base64: Encode/decode Base64 strings
- Binary: Convert text to/from binary
- ROT13: Caesar cipher with 13 shifts
- Quoted Printable: Email encoding format
- Punycode: Internationalized domain names
- URL: URL encoding/decoding
- HTML: HTML entity encoding/decoding
- Hex: Hexadecimal encoding/decoding
- Caesar Cipher: Custom shift cipher
- Morse Code: Morse code encoding/decoding
// Base64 Encoding
String encoded = EncodersDecoders.Base64Converter.encode('Hello World');
String decoded = EncodersDecoders.Base64Converter.decode(encoded);
// Binary Conversion
String binary = EncodersDecoders.BinaryConverter.textToBinary('Hi');
String fromBinary = EncodersDecoders.BinaryConverter.binaryToText(binary);
// ROT13
String rot13 = EncodersDecoders.Rot13Converter.encode('Hello World');
// URL Encoding
String urlEncoded = EncodersDecoders.UrlConverter.encode('Hello World!');
๐ JSON/XML Tools #
Process JSON and XML data:
- JSON Beautifier: Format JSON with indentation
- JSON Minifier: Remove unnecessary whitespace
- JSON Validator: Validate JSON syntax
- JSON to XML: Convert JSON to XML format
- XML to JSON: Convert XML to JSON format
- CSV to JSON: Convert CSV to JSON array
- JSON to CSV: Convert JSON array to CSV
- JSON Schema: Generate JSON schema
- JSON Comparison: Compare JSON objects
// JSON Beautification
String prettyJson = JsonXmlTools.JsonTools.beautify(uglyJson);
// JSON Validation
bool isValid = JsonXmlTools.JsonTools.isValid(jsonString);
// JSON to XML
String xml = JsonXmlTools.JsonTools.jsonToXml(jsonString);
// CSV to JSON
String csvToJson = JsonXmlTools.CsvTools.csvToJson(csvString);
๐ Network Tools #
Network-related utilities:
- MX Lookup: Lookup mail exchange records
- IP Subnet Calculator: Calculate subnet information
- URL Parser: Parse and analyze URLs
- SSL Checker: Check SSL certificate validity
- Ping: Ping hosts and measure latency
- HTTP Status Checker: Check HTTP response status
- Website Status Checker: Comprehensive website analysis
- URL Unshortener: Unshorten shortened URLs
- IP Information: Get IP geolocation data
- User Agent Tools: Generate and parse user agents
// URL Parsing
Map<String, dynamic> parsed = NetworkTools.UrlParser.parseUrl(
'https://example.com:8080/path?query=value#fragment'
);
// IP Subnet Calculation
Map<String, String> subnet = NetworkTools.IpSubnetCalculator.calculateSubnet(
'192.168.1.1',
'255.255.255.0'
);
// HTTP Status Check
Map<String, dynamic> status = await NetworkTools.HttpStatusChecker.checkHttpStatus(
'https://example.com'
);
๐ Password Tools #
Password generation and security:
- Password Generator: Generate secure passwords
- Bulk Password Generator: Generate multiple passwords
- Password Strength Checker: Analyze password strength
- bcrypt Generator: Generate bcrypt hashes
- Passphrase Generator: Generate memorable passphrases
- PIN Generator: Generate numeric PINs
- Memorable Password: Generate passwords with patterns
- Custom Password: Generate with custom character sets
// Password Generation
String password = PasswordTools.generatePassword(
length: 12,
includeUppercase: true,
includeLowercase: true,
includeNumbers: true,
includeSymbols: true,
);
// Password Strength Check
Map<String, dynamic> strength = PasswordTools.checkPasswordStrength(password);
print('Strength: ${strength['strength']} (Score: ${strength['score']})');
// Bulk Generation
List<String> passwords = PasswordTools.generateBulkPasswords(count: 5, length: 10);
// Passphrase Generation
String passphrase = PasswordTools.generatePassphrase(wordCount: 4);
๐ Text Processors #
Advanced text processing:
- Text Cleaner: Remove whitespace, special chars, HTML tags
- Text Replacer: Replace text with various options
- Case Converter: Convert between different cases
- Word Density Counter: Analyze word frequency
- Text Separator: Separate text by various delimiters
- Slug Converter: Convert text to URL-friendly slugs
// Text Cleaning
String cleaned = TextProcessors.TextCleaner.cleanWhitespace(' Hello World ');
String noSpecialChars = TextProcessors.TextCleaner.removeSpecialCharacters(text);
// Case Conversion
String camelCase = TextProcessors.CaseConverter.toCamelCase('hello world');
String snakeCase = TextProcessors.CaseConverter.toSnakeCase('Hello World');
// Word Analysis
Map<String, int> frequency = TextProcessors.WordDensityCounter.countWordFrequency(text);
List<MapEntry<String, int>> topWords = TextProcessors.WordDensityCounter.getMostFrequentWords(text);
โฐ Timers & Widgets #
Timing and UI utilities:
- Countdown Timer: Create countdown timers
- Stopwatch: Measure elapsed time
- Color Picker: Generate and manipulate colors
- Date Picker: Work with dates and calendars
- Wheel Tools: Random number/string generation
// Color Generation
String randomColor = TimersWidgets.ColorPicker.generateRandomColor();
Map<String, int> rgb = TimersWidgets.ColorPicker.hexToRgb(randomColor);
Map<String, double> hsl = TimersWidgets.ColorPicker.rgbToHsl(rgb['r']!, rgb['g']!, rgb['b']!);
// Date Operations
DateTime now = TimersWidgets.DatePicker.getCurrentDate();
String formatted = TimersWidgets.DatePicker.formatDate(now, format: 'yyyy-MM-dd HH:mm:ss');
List<DateTime> weekDates = TimersWidgets.DatePicker.getWeekDates(now);
// Random Generation
int randomNumber = TimersWidgets.WheelTools.generateRandomNumber(1, 100);
String randomString = TimersWidgets.WheelTools.generateRandomString(10);
โ Advanced Validators #
Enhanced validation tools:
- Palindrome Checker: Check for palindromes
- HTTP Status Code Checker: Analyze HTTP status codes
- Credit Card Validator: Validate credit card numbers
- Timestamp Validator: Validate timestamps
- IDN Validator: Validate internationalized domain names
// Palindrome Check
bool isPalindrome = AdvancedValidators.PalindromeChecker.isPalindrome('racecar');
// HTTP Status Analysis
Map<String, dynamic> statusInfo = AdvancedValidators.HttpStatusCodeChecker.getStatusCodeInfo(200);
// Credit Card Validation
Map<String, dynamic> cardValidation = AdvancedValidators.CreditCardValidator.validateCreditCard('4111111111111111');
๐ฑ QR Tools #
QR code generation and processing:
- QR Generator: Generate QR codes for various data types
- QR Reader: Parse QR code data
- QR Utilities: Validate and analyze QR codes
// QR Generation
Map<String, dynamic> qrData = QrTools.QrGenerator.generateQrData('Hello QR World!');
Map<String, dynamic> urlQr = QrTools.QrGenerator.generateQrForUrl('https://example.com');
Map<String, dynamic> wifiQr = QrTools.QrGenerator.generateQrForWifi(
ssid: 'MyWiFi',
password: 'password123',
security: 'WPA',
);
// QR Parsing
Map<String, dynamic> parsed = QrTools.QrReader.parseQrData('https://example.com');
๐ Hash Tools #
Cryptographic hash functions:
- MD5: Generate MD5 hashes
- SHA Family: SHA-1, SHA-224, SHA-256, SHA-384, SHA-512
- HMAC: Hash-based message authentication codes
- Hash Utilities: Compare, verify, and analyze hashes
// Hash Generation
String md5Hash = HashTools.generateMD5('Hello World');
String sha256Hash = HashTools.generateSHA256('Hello World');
String hmac = HashTools.generateHMAC('Hello World', 'secret', 'sha256');
// Hash Verification
bool isValid = HashTools.verifyHash('Hello World', md5Hash, 'md5');
๐ Original Utilities (v1.0.0) #
The library also includes all original utilities from v1.0.0:
๐ Date Utils #
- Get current date/time in custom formats
- Convert between string and DateTime objects
- Calculate date differences in various units
- Date arithmetic operations
- Leap year and age calculations
โ Validation Utils #
- Email, URL, and phone number validation
- Indian-specific validations (PAN, GST, Aadhaar, IFSC, UPI)
- Password strength validation
- Credit card validation using Luhn algorithm
๐ค String Utils #
- Case conversions (camelCase, snake_case, kebab-case)
- Text manipulation (capitalize, reverse, truncate)
- String analysis (palindrome, word count)
- Data extraction (emails, URLs, numbers)
๐ข Number Utils #
- Number formatting with commas
- Number to words conversion
- Mathematical operations (factorial, GCD, LCM)
- Interest calculations
๐ File Utils #
- File path operations and validation
- File type detection
- MIME type identification
- File name sanitization
๐ Network Utils #
- IP address validation (IPv4/IPv6)
- MAC address validation
- URL parsing and manipulation
- HTTP status code analysis
๐ฏ Use Cases #
This library is perfect for:
- Mobile Apps: All utilities work seamlessly in Flutter apps
- Web Applications: Server-side utilities for web development
- Data Processing: Text, image, and data manipulation
- Security Applications: Password generation, hashing, validation
- Educational Apps: Calculators, converters, generators
- Utility Apps: All-in-one tool applications
- Developer Tools: Code generation, validation, formatting
๐ค Contributing #
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
๐ License #
This project is licensed under the MIT License - see the LICENSE file for details.
โญ Support #
If you find this package helpful, please consider giving it a โญ on GitHub.
๐ Changelog #
v2.0.0 (Latest) #
- ๐จ Added Text Generators (Bubble text, upside down text, glitch text, Lorem Ipsum)
- ๐งฎ Added Advanced Calculators (GPA, interest, compound profit, age, BMI, scientific)
- ๐ Added Unit Converters (Length, speed, temperature, weight, memory/storage)
- ๐ผ๏ธ Added Image Tools (OCR, compressor, rotator, converter, resizer, effects)
- ๐ Added Encoders/Decoders (Base64, binary, ROT13, quoted printable, URL, HTML)
- ๐ Added JSON/XML Tools (Beautifier, validator, converter, formatter)
- ๐ Added Network Tools (MX lookup, IP subnet, URL parser, SSL checker, ping)
- ๐ Added Password Tools (Generator, strength checker, bulk generator, bcrypt)
- ๐ Added Text Processors (Cleaner, replacer, case converter, density counter)
- โฐ Added Timers & Widgets (Countdown timer, stopwatch, color picker, date picker)
- โ Added Advanced Validators (Credit card, palindrome, HTTP status, website status)
- ๐ฑ Added QR Tools (Generator, reader, utilities)
- ๐ Added Hash Tools (MD5, SHA, HMAC, hash utilities)
- ๐ Updated documentation with comprehensive examples
- ๐ Enhanced performance and error handling
v1.0.0 #
- ๐ Date Utils
- โ Validation Utils
- ๐ค String Utils
- ๐ข Number Utils
- ๐ File Utils
- ๐ Network Utils
๐ Links #
Made with โค๏ธ for the Flutter community