helpers_plethora 2.1.0 copy "helpers_plethora: ^2.1.0" to clipboard
helpers_plethora: ^2.1.0 copied to clipboard

An helpful variety of extensions.

example/helpers_plethora_example.dart

import 'package:helpers_plethora/helpers_plethora.dart';

void main() async {
  /// DateTimeExtension
  final DateTime dateTime1 = DateTime(2020, 2, 29);
  final DateTime dateTime2 = DateTime(2022, 9, 24, 15, 30);
  final DateTime dateTime3 = DateTime(2020, 7, 21, 7);

  dateTime1.isAfterOrAtSameMomentAs(dateTime2);
  dateTime2.isBeforeOrAtSameMomentAs(dateTime2);

  dateTime3.isBetween(start: dateTime1, end: dateTime2);
  dateTime2.isBetweenOrAtSameMomentAs(start: dateTime1, end: dateTime2);

  final DateTime dateTime4 = dateTime3.onlyYMD;

  final int lastDay = dateTime1.thisMonthLastDay;

  final String weekDayShortName = await dateTime2.toStringE();
  final String weekDayFullName = await dateTime2.toStringEEEE();
  final String time = await dateTime3.toStringHm();
  final String shortMonthName = await dateTime1.toStringMMM();
  final String fullMonthName = await dateTime1.toStringMMMM();
  final String yyyyMmDd = dateTime2.toStringyMMd();
  final String yearShortMonthName = await dateTime3.toStringyMMM();
  final String yearShortMonthNameDayNumber = await dateTime1.toStringyMMMd();
  final String yearShortMonthNameShortDayNameDayNumber =
      await dateTime4.toStringyMMMEd();
  final String yearFullMonthName = await dateTime1.toStringyMMMM();
  final String yearFullMonthNameFullDayNameDayNumber =
      await dateTime2.toStringyMMMMEEEEd();

  /// DoubleExtension
  1357.175.toStringWithThousandsSeparator();
  1357.175.toStringWithThousandsSeparator(decimals: 1, locale: 'it-IT');
  1357.175.toStringWithThousandsSeparator(decimals: 3, maxDecimals: 2);
  1357.175.toStringWithThousandsSeparator(
    decimals: 3,
    locale: 'it-IT',
    maxDecimals: 2,
  );
  1357.175.toStringWithThousandsSeparator(maxDecimals: 2);

  /// IntExtension
  123.toStringWithThousandsSeparator();
  1234.toStringWithThousandsSeparator(locale: 'it-IT');

  /// ListComparableExtension
  [2, 3, 1, 2, 3, 4, 5, 6, 7, 7].distinctSort();

  /// ListNumExtension
  <double>[].progressiveSum();
  [1, 3, 2, 5, 4].progressiveSum();

  /// StringExtension
  'A string with no currency.'.allCurrenciesSymbols();
  r'This is the euro symbol: €. And this is the dollar symbol: $.'
      .allCurrenciesSymbols();
  'A string with no currency.'.firstCurrencySymbol();
  r'This is the euro symbol: €. And this is the dollar symbol: $.'
      .firstCurrencySymbol();
  ' This package is helpers_plethora. '.firstsUpperCase();
  ' This package is helpers_plethora. '
      .firstsUpperCase(splitPattern: '_', trim: false);
  ' this package is helpers_plethora. '.firstUpperCase();
  ' this package is helpers_plethora. '.firstUpperCase(trim: false);
}
4
likes
140
points
24
downloads

Publisher

unverified uploader

Weekly Downloads

An helpful variety of extensions.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

collection, intl, meta

More

Packages that depend on helpers_plethora