data_format 0.0.4 copy "data_format: ^0.0.4" to clipboard
data_format: ^0.0.4 copied to clipboard

Flutter library to format data into readable form.

example/main.dart

import 'package:data_format/data_format.dart';

void main() {
  // "2022 December, 31 8:50:55 AM";
  DateTime(2022, 12, 31, 8, 50, 55).readable(
      'year month(name), date, hour:minute(zeroPadded):second meridiem');

  // "22/12/31 7:8:9 AM";
  DateTime(2022, 12, 31, 7, 8, 9)
      .readable('year/month/date hour:minute:second meridiem');

  // "31 Dec, 2022 06:08:09 PM";
  DateTime(2022, 12, 31, 18, 8, 9).readable(
      'date month(shortname), year hour(12h,zeroPadded):minute(zeroPadded):second(zeroPadded) meridiem');

  // "10 days 1 hour 23 minutes 43 seconds ago";
  DateTime(2022, 12, 31, 18, 8, 9).readable('ago');

  // "43 seconds ago";
  DateTime(2022, 12, 31, 18, 8, 9).readable('ago(single)');
}
1
likes
140
pub points
58%
popularity

Publisher

verified publisherensorta.com

Flutter library to format data into readable form.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on data_format