more_functions 0.0.1 more_functions: ^0.0.1 copied to clipboard
A dart package which provides a lot of helpers functions for easy development.
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>
- 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';
Overview #
We support two types of Functions: Regular
and extension
.
List of Helpers functions type:
String #
Case Assertions
// Regular functions
bool getIsUpperCase(String string);
bool getIsLowerCase(String string);
bool getFirstIsUpperCase(String string);
bool getLastIsUpperCase(String string);
bool getFirstIsLowerCase(String string);
bool getLastIsLowerCase(String string);
bool getCharAtIsUpperCase(String string, int index);
bool getCharAtIsLowerCase(String string, int index);
// Extension functions
print('Dart'.isUpperCase); // false
print('Dart'.isLowerCase); // false
print('Dart'.firstIsUpperCase); // true
print('Dart'firstIsLowerCase); // false
print('Dart'.lastIsLowerCase); // true
print('Dart'.charAtIsUpperCase(1)); // false
print('Dart'.charAtIsLowerCase(1)); // true
Upper Case
// Regular functions
String getFirstToUpperCase(String string, {bool allWords = false});
String getLastToUpperCase(String string, {bool allWords = false});
String getUpperCamelCase(String string, {bool attached = false, String betweenWords = ''});
String getUpperSnakeCase(String string);
// Extension functions
print('dart'.firstToUpperCase); // 'Dart'
print('dart'.firstToLowerCase); // 'darT'
print('upper camel case'.toLowerCamelCase); // 'Upper Camel Case'
print('upper underscore case'.toLowerSnakeCase); // 'UPPER_UNDERSCORE_CASE'
Lower Case
// Regular functions
String getFirstToLowerCase(String string, {bool allWords = false});
String getLastToLowerCase(String string, {bool allWords = false});
String getLowerCamelCase(String string, {bool attached = false, String betweenWords = ''});
String getLowerSnakeCase(String string);
// Extension functions
print('Dart'.firstToLowerCase); // 'dart'
print('DART'.firstToLowerCase); // 'DARt'
print('LOWER CAMEL CASE'.toLowerCamelCase); // 'lower Camel Case'
print('lower underscore case'.toLowerSnakeCase); // 'lower_underscore_case'
Char
// Regular functions
String getFirstChar(String string);
String getLastChar(String string);
int getLastCharIndex(String string);
String getCharAt(String string, int index);
// Extension functions
print('dart'.firstChar); // returns 'd'
print('dart'.lastChar); // returns 't'
print('dart'.lastCharIndex); // returns 3
print('dart'.charAt(1)); // returns 'a'