more_functions

Pub Version Github stars License Style

A dart package which provides a lot of helpers functions for easy development.

Installation

  1. Add this to your packages pubspec.yaml file:
dependencies:
  more_functions: <^last-version>
  1. Install it You could run pub get:
$ dart pub get
  1. 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:

  1. String

String

  1. Case Assertions
  2. Upper Case
  3. Upper Case
  4. Char
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'

return up

Libraries

more_functions