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

outdated

Package to speed up your productivity.

SpeedUp #

Package to speed up your productivity

Usage #

String extensions #

Collection extension #

final sum = [1,2,3,4,5,6].sum();
print(sum); // Prints 21

Check String is null or empty

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

will print

false
true
true

Get enum title

enum AccountType {
  general,
  owner,
}

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

will print

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();

Contributing #

We accept the following contributions:

  • Improving documentation
  • Reporting issues
  • Fixing bugs

Maintainers #