kt_utils 2.2.1 copy "kt_utils: ^2.2.1" to clipboard
kt_utils: ^2.2.1 copied to clipboard

Useful extension methods such as forEachIndexed, roundDouble with precision etc.

example/main.dart

import 'package:kt_utils/kt_utils.dart';

void main(List<String> args) {
  // String
  print('lorem'.toCapitalize());

  print('Lorem'.plus(' Ipsum'));

  print('Lorem Ipsum'.reversed());

  print('10'.toInt());

  print('10.3'.toDouble());

  print('lorem ipsum dolor'.toTitleCase());

  print('123abc'.containsDigit());

  print('abc@abc.test'.isEmailValid());

  print('hello world'.encodeBase64());

  print('aGVsbG8gd29ybGQ='.decodeBase64());

  print('10'.isDigit());

  print('lorem ipsum'.isLowerCase());

  print('LOREM IPSUM'.isUpperCase());

  print('ŹŻŚĄ å abcd'.isAlpha());

  print('LorEM IpsUM'.swapCase());

  print('example'.last());

  // Double
  print(5.432.roundDouble(1));

  print(7.6.roundDouble(0));

  // List
  List<String> ls = ['A', 'B', 'C', 'D', 'A', 'D', 'A'];

  ls.forEachIndexed((index, element) {
    print('Index $index - Element $element');
  });

  print(ls.random());

  print(ls.lastIndex);

  print(ls.count((e) => e == 'A'));
}
5
likes
150
pub points
29%
popularity

Publisher

unverified uploader

Useful extension methods such as forEachIndexed, roundDouble with precision etc.

Repository (GitHub)
View/report issues

Topics

#utils

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on kt_utils