apiverve_filesizeformatter 1.2.3
apiverve_filesizeformatter: ^1.2.3 copied to clipboard
File Size Formatter converts raw byte counts into human-readable file size strings. Send a byte count with optional precision and unit settings to receive formatted labels, unit names, and scaled nume [...]
File Size Formatter API - Dart/Flutter Client #
File Size Formatter converts raw byte counts into human-readable file size strings. Send a byte count with optional precision and unit settings to receive formatted labels, unit names, and scaled numeric values.
This is the Dart/Flutter client for the File Size Formatter API.
Installation #
Add this to your pubspec.yaml:
dependencies:
apiverve_filesizeformatter: ^1.2.3
Then run:
dart pub get
# or for Flutter
flutter pub get
Usage #
import 'package:apiverve_filesizeformatter/apiverve_filesizeformatter.dart';
void main() async {
final client = FilesizeformatterClient('YOUR_API_KEY');
try {
final response = await client.execute({
'bytes': 1073741824,
'unit': 'GB',
'precision': 2,
'standard': 'binary'
});
print('Status: ${response.status}');
print('Data: ${response.data}');
} catch (e) {
print('Error: $e');
}
}
Response #
{
"status": "ok",
"error": null,
"data": {
"bytes": 1073741824,
"formatted": "1 GiB",
"value": 1,
"unit": "GiB",
"standard": "binary",
"precision": 2,
"conversions": {
"B": 1073741824,
"KiB": 1048576,
"MiB": 1024,
"GiB": 1,
"TiB": 0,
"PiB": 0,
"EiB": 0,
"ZiB": 0,
"YiB": 0
}
}
}
API Reference #
- API Home: File Size Formatter API
- Documentation: docs.apiverve.com/ref/filesizeformatter
Authentication #
All requests require an API key. Get yours at apiverve.com.
License #
MIT License - see LICENSE for details.
Built with Dart for APIVerve