A dart package which provides a lot of helpers functions for easy development.
- Add this to your packages pubspec.yaml file:
dependencies:
more_functions: <^last-version>
- Install it You could run pub get:
$ dart pub get
- Import it Now in Dart code, you can use:
import 'package:more_functions/more_functions.dart';
List of Helpers type:
//entire string
print('Dart is awesome!'.isUpperCase); // false
print('Dart is awesome!'.isLowerCase); // false
//characters
print('Dart is awesome!'.firstCharIsUpperCase); // true
print('Dart is awesome!'firstCharIsLowerCase); // false
print('Dart is awesome!'.lastCharIsUpperCase); // false
print('Dart is awesome!'.lastCharIsLowerCase); // true
print('Dart is awesome!'.charAtIsUpperCase(1)); // ['a'] false
print('Dart is awesome!'.charAtIsLowerCase(1)); // ['a'] true
//words
print('Dart is awesome!'.firstWordIsUpperCase); // false
print('Dart is awesome!'firstWordIsLowerCase); // false
print('Dart is awesome!'.lastWordIsUpperCase); // false
print('Dart is awesome!'.lastWordIsLowerCase); // true
print('Dart is awesome!'.wordAtIsUpperCase(1)); // ['is'] false
print('Dart is awesome!'.wordAtIsLowerCase(1)); // ['is'] true
print('dart'.firstCharToUpperCase()); // 'Dart'
print('dart'.firstCharToLowerCase()); // 'darT'
print('upper camel case'.toUpperCamelCase()); // 'Upper Camel Case'
print('upper underscore case'.toUpperSnakeCase()); // 'UPPER_UNDERSCORE_CASE'
print('upper kebab case'.toUpperKebabCase()); // 'UPPER-KEBAB-CASE'
print('DART'.firstCharToLowerCase()); // 'dART'
print('DART'.firstCharToLowerCase()); // 'DARt'
print('LOWER CAMEL CASE'.toLowerCamelCase()); // 'lower Camel Case'
print('LOWER SNAKE CASE'.toLowerSnakeCase()); // 'lower_underscore_case'
print('LOWER KEBAB CASE'.toLowerKebabCase()); // 'lower-kebab-case'
print('Dart is awesome!'.hasChars); // true
print('Dart is awesome!'.hasOnlyChars); // false
print('Dart is awesome!'.hasOnlyUpperChars); // false
print('Dart is awesome!'.hasOnlyLowerChars); // false
print('dart'.firstChar); // returns 'd'
print('dart'.lastChar); // returns 't'
print('dart'.charAt(1)); // returns 'a'
print('dart'.lastCharIndex); // returns 3
print('dart'.indexOfChar('a')); // returns 1
print('dart'.toChars()); // returns ['d','a','r','t']
print('Dart is awesome!'.firstWord); // 'Dart'
print('Dart is awesome!'.lastWord); // 'awesome!'
print('Dart is awesome!'.wordAt(1)); // 'is'
print('Dart is awesome!'.indexOfWord('Dart')); // returns 0
print('Dart is awesome!'.toWords()); // ['Dart','is','awesome!']
print('Dart is awesome!'.countChar()); // 16
print('Dart is awesome!'.countWord()); // 3
Not implemented yet.
print('Dart Is Awesome!'.removeAllSymbols); // 'Dart Is Awesome'
print('Dart is awesome!'.hasSymbols); // true
print('Dart is awesome!'.hasOnlySymbols); // false
Not implemented yet.
print('Dart Is Awesome!'.removeAllWhitespaces); // 'DartIsAwesome!'
print('Dart is awesome!'.hasWhitespaces); // true
print('Dart is awesome!'.hasOnlyWhitespaces); // false