Wanna Contribute in hacktoberfest 2022 ūüôĆ

Follow Simple Rules

1) Fork this repository first

2) Star this repository‚≠ź

3) Create a new issue detailing what you want to add and create a branch from the issue

4) Add your details in the CONTRIBUTING.md file‚≠ź

**5) Add a folder that define the class or method you want to upload and add your code to the folder and create a PULL REQUEST.

Some Code Guidelines

  1. Variable name should be meaningful.
  2. Use comments in your code.
  3. Your Code must be pretty formated.

After a valid pull request your code will be carefully reviewed and if it matches the rule then it will be accepted otherwise you need to generate a new file

Dart pub

About :closed_book:

Dart Extend provides a variety of dart methods and classes so you can write better and clean app functionality

Publisher: Mashood Hussain

Features :electric_plug:

Dart Extend provides a variety of dart methods and classes so you can write better and clean app functionality

:warning: Validators

:construction_worker: Formatters

:recycle: Converter

:hourglass_flowing_sand: Time Stamps

:slot_machine: Generator

Getting started :rocket:


final email = 'mashoodhussain100@gmail.com'.isemail(); // true
final email = "mashood100".isemail(); // false

    "1223ee2".isNum; //false
    bool isDouble = "122".isNum; // true

check string value is number or not

 "1223ee2".isNum; //false
 "122".isNum; // true


// the method will convert any num type value in decimal pattern eg :22000 ===> 22,000

1232123.233.toDecimalPattern() // 1,232,123
// by default the valueAfterpoint is set to 0
32123.123.toDecimalPattern(valueAfterpoint: 1) // 32,123.1

   final test1 = 44.ordinal(); // 44th
   final test2 = 1.ordinal();// 1st

Remove Duplicates from List

    List myArray = ['x', 'w', 'x', 'y', 'o', 'x', 'y', 'y', 'r', 'a'];
    List unique = myArray.removeduplicates(); //[ x, w, y ,o, r, a ]


// convert bytes into readable Memory Units 
11432.convertBytesToMemoryUnit() // 11kb
1142132.convertBytesToMemoryUnit() // 1.1 MB

From Epoch

   final test1 = 1665102617.epochToDate(); // return DateTime  like  2022-10-07 05:41:03.162
   final time = 1665102617.epochToTime();// 5:30 AM

From DateTime

   final date1 = DateTime.now().weekOftheYearFromDate(); // return current week number of the year eg: 12

   final date2 = DateTime(2011, 1, 15).weekOftheYearFromDate(); // 2

   final week = 112398.minToDuration(); // weeks
   final week = 98.minToDuration(); // 1.6 hr

Time Ago Stamps

Screenshot Screenshot2

From Epoch

       String myTimeago = DateTime.now().timeAgoSinceDateTime(dateInNumbers: true); // just now

From DateTime

    String timeagoInString = 1665192814.timeAgoSinceEpochDate(dateInNumbers: false); // return 12 days ago

Generate Random Numbers and IDs

  var generate = Generator();
  // genrate Random number between 2 values
  print(generate.randomNumber(2, 9)); //5

  // genrate alphanumeric key of length 44 character
  // Ideal when you want to produce a large number of IDs.
      .createCryptoRandomString()); //KPVz7OIagov_hsn6Hs65XsvH-x43j0XyMNf6HrWMrcQ=

  // another id genrator genrate alphanumeric key of length 44 character

Generate user names

  var generate = Generator();


  // barley_harryy_1
  // set addspcae parameter false so it will generate username without spaces( _ )
  // by default its true
  print(generate.randomUserName(addSpace: false));
  // barleyharryy1
  // mashood_82

  print(generate.makeUserName('Mashood Hussain'));
  // mashood_Hussain_23
  print(generate.makeUserName('Mashood Hussain'));
  // mashoodHussain23
  // set with number false to make usernames with number
  print(generate.makeUserName('John Doe', withNumber: false));
  // mashood_Hussain

  // you can also set prefix and sufffix so it will apperes on every username that you generates
  print(generate.makeUserName('Mashood Hussain',
      withNumber: false, prefix: 'developer', suffix: 'fultter'));
  // developer_mashood_hussain_flutter

      date: DateTime.parse('2001-06-20')));
  // mashood_01

        firstName: 'mashood',
        lastName: 'hussain',
        adjectives: ['ready', 'happy']),
  // doe_john_10_ready

  print( generate.usernameFromName(firstName: 'Mashood', lastName: 'huss'), );
  // mashood_huss_78
  //set isadjectives true to get a username with adjective word
  print( generate.listOfUserName('Mashood Hussain', length: 4, isadjectives: true) );

  // [
  // 4_mashood_awsome,
  // 20_hussain_great,
  // 7_mashood_fast,
  // hussain_mashood_99
  // ]

  // by default isadjectives is false
    generate.listOfUserName('Mashood Hussain', length: 4),

  // [
  // 4_mashood,
  // 20_hussain,
  // 7_mashood,
  // hussain_mashood_99
  // ]

Additional information :information_source:

For more info or contribution please visit Dart Extend Repo