speed_up 0.5.6 copy "speed_up: ^0.5.6" to clipboard
speed_up: ^0.5.6 copied to clipboard

outdated

Package to speed up your productivity.

speed_up #

pub package likes codecov style: lint Dart

Package to speed up your productivity.

Usage #

String extensions #

Collection extension #

Sum

final sum = [1,2,3,4,5,6].sum();
print(sum); // Prints 21
final sum = [Product(price: 100.99), Product(price: 49.99)].sum((p) => p.price);
print(sum); // Prints 150.98

Next After

Random

Check String is null or empty

isStringNullOrEmpty('Some String');
isStringNullOrEmpty('');
isStringNullOrEmpty(null);

Get enum title

enum AccountType {
  general,
  owner,
}

debugPrint('Account type: ' + getEnumTitle(UserType.general)); // prints Account type: general

Get image file size


const fileSize = 1024 * 1024;

// Get file size in closest size suffix
final sizeInMb = FileSizeInfo.getSize(bytes);
log(sizeInKb.getTitle())); // prints '1.oo MB'
log(sizeInKb.getTitle(decimals: 0))); // prints '1 MB'

// Convert to desired suffix
final sizeInKb = sizeInMb.asSuffix(FileSizeSuffix.KB);
log(sizeInKb.getTitle())); // prints '1024 KB'

log();

RangeValue type

final numRange = RangeValue(1, 10);
print(numRange.isValid); // true

final start = DateTime.now();
final end = DateTime.now().add(Duration(days: 1));
final dateTimeRange = RangeValue(end, start);

print(dateTimeRange.isValid); // false

Contributing #

We accept the following contributions:

  • Improving documentation
  • Reporting issues
  • Fixing bugs

Maintainers #