dart_unit_converter 0.0.3+1 copy "dart_unit_converter: ^0.0.3+1" to clipboard
dart_unit_converter: ^0.0.3+1 copied to clipboard

A data unit converter package.

Dart Unit Converter #

This package is for flexible data converting on Dart.

🎖 Installing #

dependencies:
  dart_unit_converter: ^0.0.3 + 1

⚡️ Import #

import 'package:dart_unit_converter/dart_unit_converter.dart';

🎮 How To Use #

  • Data Convert

// FROM EXTENSION
dataValueController.text = parsedDataValue.convertDataToString(); // From Integer

// FROM FUNCTION
dataValueController.text = converter.continousDataConvert(parsedDataValue);  // From Integer

// CUSTOM CONVERT
final converter = DataConverter();

dataValueController.text = converter
    .convert(parsedDataValue, TypeDataConvert.bit, TypeDataConvert.megaByte)
    .toString();

  • Time Convert
import 'package:intl/date_symbol_data_local.dart';
import 'package:dart_unit_converter/dart_unit_converter.dart';

void main() {
  runApp(const MyApp());
  initializeDateFormatting();
  setDefaultMessage(MessageLocalType.id); // Default = en
}

// ...
// ...
// ...

void useConverterFromSeconds() {
  final parsedTimeValue = timeInputController.text;
  timeValueController.text = parsedTimeValue.toStringTimeDiff(); // From String extension

  final dateTime = DateTime.parse(parsedTimeValue);
  timeValueController.text = dateTime.toStringTimeDiff(); // From DateTime extension
}

🐛 Bugs/Requests #

❗️ Note #

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

✨ Credits #

2
likes
130
points
12
downloads

Publisher

verified publishervarx.id

Weekly Downloads

A data unit converter package.

Repository (GitLab)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, intl

More

Packages that depend on dart_unit_converter