GithubHelp home page GithubHelp logo

flutter_my_utils's Introduction

Basic Utils

pub package Null Safety

A dart package for many helper methods fitting different situations.

Table of Contents

Preamble

As this package is written in pure Dart, it can be used on all platforms on which dart is currently running. This includes the use of frameworks like Flutter, Angular Dart and many more. This package can also be used for command line tools or rest services compiled with dart2native.

Note: Feel free to contribute by creating pull requests or file an issue for bugs, questions and feature requests.

Install

pubspec.yaml

Update pubspec.yaml and add the following line to your dependencies.

dependencies:
  flutter_my_utils: ^0.0.1

Import

Import the package with :

import 'package:flutter_my_utils/flutter_my_utils.dart';

Util Classes

The package contains different classes. Each class contains methods that provide a solution for certain problems.

UriUtil

Helper class for Uri.

Future<void> makePhoneCall(String phoneNumber);

StringUtil

Helper class for String operations.

String defaultString(String? str, {String defaultStr = ''});
bool isNullOrEmpty(String? s);
bool isNotNullOrEmpty(String? s);
String camelCaseToUpperUnderscore(String s);
String camelCaseToLowerUnderscore(String s);
bool isLowerCase(String s);
bool isUpperCase(String s);
bool isAscii(String s);
String capitalize(String s, {bool allWords = false});
String reverse(String s);
int countChars(String s, String char, {bool caseSensitive = true});
bool isDigit(String s);
bool equalsIgnoreCase(String a, String b);
bool inList(String s, List<String> list, {bool ignoreCase = false});
bool isPalindrome(String s);
String hidePartial(String s, {int begin = 0, int end, String replace = "*"});
String addCharAtPosition(String s, String char, int position,{bool repeat = false});
List<String> chunk(String s, chunkSize);
String pickOnly(value, {int from = 1, int to = -1});
String removeCharAtPosition(String value, int index);
String removeExp(String value, String pattern,{bool repeat = true,bool caseSensitive = true,bool multiLine = false,bool dotAll = false,bool unicode = false});
String truncate(String value, int length, {String symbol = '...'}); 
String generateRandomString(int length,{alphabet = true,numeric = true,special = true,uppercase = true,lowercase = true,String from = ''});
String toPascalCase(String s);
List<String> generateRandomStrings(int amount,int length,{alphabet = true,numeric = true,special = true,uppercase = true,lowercase = true,String from = ''});

DomainUtils

Helper class for operations on domain names.

bool isDomainName(String s);
bool isSubTld(String tld, String? subTld);
bool isSubDomain(String? s);
bool isSubDomainOf(String sub, String domain);
bool isCCTLD(String s);
bool isNGTLD(String s);
bool isTld(String s);
bool isGTLD(String s);
List<String> splitDomainName(String domainName);
Domain? getDomainFromUrl(String url);
Domain? parseDomain(String domainName);
List<String> splitSubdomainInDomains(String name);
String toIDN(String domain);
String fromIDN(String domain)

flutter_my_utils's People

Contributors

592116366 avatar

Watchers

 avatar

Forkers

sbrsubuvga

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.