0 purchases
more functions
more_functions #
A dart package which provides a lot of helpers functions for easy development.
Installation #
Add this to your packages pubspec.yaml file:
dependencies:
more_functions: <^last-version>
copied to clipboard
Install it You could run pub get:
$ dart pub get
copied to clipboard
Import it Now in Dart code, you can use:
import 'package:more_functions/more_functions.dart';
copied to clipboard
Overview #
List of Helpers type:
String
String #
Case
Case Assertions
Upper Case
Lower Case
Char
Char Assertions
Char Getters
Char Position
Char Transformation
Word
Word Getters
Word Position
Word Transformation
Generic Utils
Counters
Symbol
Add Symbol
Remove Symbol
Assertion Symbol
Whitespace
Add Whitespace
Remove Whitespace
Assertion Whitespace
CASE #
Case Assertions
//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
copied to clipboard
Upper Case
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'
copied to clipboard
Lower 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'
copied to clipboard
Char #
Char Assertions
print('Dart is awesome!'.hasChars); // true
print('Dart is awesome!'.hasOnlyChars); // false
print('Dart is awesome!'.hasOnlyUpperChars); // false
print('Dart is awesome!'.hasOnlyLowerChars); // false
copied to clipboard
Char Getters
print('dart'.firstChar); // returns 'd'
print('dart'.lastChar); // returns 't'
print('dart'.charAt(1)); // returns 'a'
copied to clipboard
Char Position
print('dart'.lastCharIndex); // returns 3
print('dart'.indexOfChar('a')); // returns 1
copied to clipboard
Char Transformation
print('dart'.toChars()); // returns ['d','a','r','t']
copied to clipboard
Word #
Word Getters
print('Dart is awesome!'.firstWord); // 'Dart'
print('Dart is awesome!'.lastWord); // 'awesome!'
print('Dart is awesome!'.wordAt(1)); // 'is'
copied to clipboard
Word Position
print('Dart is awesome!'.indexOfWord('Dart')); // returns 0
copied to clipboard
Word Transformation
print('Dart is awesome!'.toWords()); // ['Dart','is','awesome!']
copied to clipboard
Generic Utils #
Counters
print('Dart is awesome!'.countChar()); // 16
print('Dart is awesome!'.countWord()); // 3
copied to clipboard
Symbol
Add Symbol
Not implemented yet.
Remove Symbol
print('Dart Is Awesome!'.removeAllSymbols); // 'Dart Is Awesome'
copied to clipboard
Assertion Symbol
print('Dart is awesome!'.hasSymbols); // true
print('Dart is awesome!'.hasOnlySymbols); // false
copied to clipboard
Whitespace
Add Whitespace
Not implemented yet.
Remove Whitespace
print('Dart Is Awesome!'.removeAllWhitespaces); // 'DartIsAwesome!'
copied to clipboard
Assertion Whitespace
print('Dart is awesome!'.hasWhitespaces); // true
print('Dart is awesome!'.hasOnlyWhitespaces); // false
copied to clipboard
return up
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.