Superpowers for Dart. Collection of useful static extension methods.

Overview

Dart CI Codecov dartx flutterx

If you miss an extension, please open an issue or pull request

Resources:

On this page you can find some of the extensions. Take a look at the docs to see all of them.

Getting started πŸŽ‰

Add the following to your pubspec.yaml:

dependencies:
  dartx: any

After you import the library, you can use the extensions.

import 'package:dartx/dartx.dart';

final slice = [1, 2, 3, 4, 5].slice(1, -2); // [2, 3, 4]

Iterable

.slice()

Returns elements at indices between start (inclusive) and end (inclusive).

final list = [0, 1, 2, 3, 4, 5];
final last = list.slice(-1); // [5]
final lastHalf = list.slice(3); // [3, 4, 5]
final allButFirstAndLast = list.slice(1, -2); // [1, 2, 3, 4]

.sortedBy() & .thenBy()

Sort lists by multiple properties.

final dogs = [
  Dog(name: "Tom", age: 3),
  Dog(name: "Charlie", age: 7),
  Dog(name: "Bark", age: 1),
  Dog(name: "Cookie", age: 4),
  Dog(name: "Charlie", age: 2),
];

final sorted = dogs
    .sortedBy((dog) => dog.name)
    .thenByDescending((dog) => dog.age);
// Bark, Cookie, Charlie (7), Charlie (2), Tom

.distinctBy()

Get distinct elements from a list.

final list = ['this', 'is', 'a', 'test'];
final distinctByLength = list.distinctBy((it) => it.length); // ['this', 'is', 'a']

.flatten()

Get a new lazy Iterable of all elements from all collections in a collection.

final nestedList = [[1, 2, 3], [4, 5, 6]];
final flattened = nestedList.flatten(); // [1, 2, 3, 4, 5, 6]

.chunkWhile() & .splitWhen()

Chunk entries as long as long as two elements match a predicate:

final list = [1, 2, 4, 9, 10, 11, 12, 15, 16, 19, 20, 21];
final increasingSubSequences = list.chunkWhile((a, b) => a + 1 == b);

// increasingSubSequences = [[1, 2], [4], [9], [10, 11, 12], [15, 16], [19, 20, 21]]

splitWhen is the opposite of chunkWhile that starts a new chunk every time the predicate didn't match.

String

.capitalize

Returns a copy of the string having its first letter uppercased, or the original string, if it's empty or already starts with an upper case letter.

final word = 'abcd'.capitalize(); // Abcd
final anotherWord = 'Abcd'.capitalize(); // Abcd

.decapitalize

Returns a copy of the string having its first letter lowercased, or the original string, if it's empty or already starts with a lower case letter.

final word = 'abcd'.decapitalize(); // abcd
final anotherWord = 'Abcd'.decapitalize(); // abcd

.isAscii

Returns true if the string is ASCII encoded.

final isAscii = 'abc123 !,.~'.isAscii; // true
final isNotAscii = 'Β§3'.isAscii; // false

.isBlank

Returns true if this string is empty or consists solely of whitespace characters.

final notBlank = '   .'.isBlank; // false
final blank = '  '.isBlank; // true

.isDouble

Returns true if the string can be parsed as a double.

final a = ''.isDouble; // false
final b = 'a'.isDouble; // false
final c = '1'.isDouble; // true
final d = '1.0'.isDouble; // true
final e = '123456789.987654321'.isDouble; // true
final f = '1,000'.isDouble; // false

.isInt

Returns true if the string can be parsed as an integer.

final a = ''.isInt; // false
final b = 'a'.isInt; // false
final c = '1'.isInt; // true
final d = '1.0'.isInt; // false
final e = '1,000'.isInt; // false

.isLatin1

Returns true if the string is Latin 1 encoded.

final isLatin1 = '§Êü'.isLatin1; // true
final isNotLatin1 = 'Ε‘'.isLatin1; // false

.isLowerCase

Returns true if the entire string is lower case.

final a = 'abc'.isLowerCase; // true
final b = 'abC'.isLowerCase; // false
final c = '   '.isLowerCase; // true
final d = ''.isLowerCase; // false

.isNotBlank

Returns true if this string is not empty and contains characters except whitespace characters.

final blank = '  '.isNotBlank; // false
final notBlank = '   .'.isNotBlank; // true

.isNullOrEmpty

Returns true if the String is either null or empty.

final isNull = null.isNullOrEmpty; // true
final isEmpty = ''.isNullOrEmpty; // true
final isBlank = ' '.isNullOrEmpty; // false
final isLineBreak = '\n'.isNullOrEmpty; // false

.isNotNullOrEmpty

Returns true if the String is neither null nor empty.

final isNull = null.isNullOrEmpty; // true
final isEmpty = ''.isNullOrEmpty; // true
final isBlank = ' '.isNullOrEmpty; // false
final isLineBreak = '\n'.isNullOrEmpty; // false

.isUpperCase

Returns true if the entire string is upper case.

final a = 'ABC'.isUpperCase; // true
final b = 'ABc'.isUpperCase; // false
final c = '   '.isUpperCase; // true
final d = ''.isUpperCase; // false

.md5

Calculates the MD5 digest and returns the value as a string of hexadecimal digits.

final a = 'abc'.md5; // 900150983cd24fb0d6963f7d28e17f72
final b = 'ΰ΄βŒ›ο€™Π‘πŸ‘¨β€πŸ‘¨β€πŸ‘§β€πŸ‘¦'.md5; // c7834eff7c967101cfb65b8f6d15ad46

.removePrefix(), .removeSuffix() and .removeSurrounding()

Remove a prefix, a suffix, or both from a given string:

final name = 'James Bond'.removePrefix('James '); // Bond
final milliseconds = '100ms'.removeSuffix('ms'); // 100
final text = '<p>Some HTML</p>'
  .removeSurrounding(prefix: '<p>', suffix: '</p>'); // Some HTML

.reversed

Returns a new string with characters in reversed order.

final emptyString = ''.reversed; // ''
final reversed = 'abcπŸ€”'.reversed; // 'πŸ€”cba'

.slice()

Returns a new substring containing all characters including indices [start] and [end]. If [end] is omitted, it is being set to lastIndex.

final sliceOne = 'awesomeString'.slice(0,6)); // awesome
final sliceTwo = 'awesomeString'.slice(7)); // String

.toDoubleOrNull()

Parses the string as a double and returns the result or null if the String is not a valid representation of a number.

final numOne = '1'.toDoubleOrNull(); // 1.0
final numTwo = '1.2'.toDoubleOrNull(); // 1.2
final blank = ''.toDoubleOrNull(); // null

.toInt()

Parses the string as an integer and returns the result. The radix (base) thereby defaults to 10. Throws a FormatException if parsing fails.

final a = '1'.toInt(); // 1
final b = '100'.toInt(radix: 2); // 4
final c = '100'.toInt(radix: 16); // 256
final d = '1.0'.toInt(); // throws FormatException

.toIntOrNull()

Parses the string as an integer or returns null if it is not a number.

final number = '12345'.toIntOrNull(); // 12345
final notANumber = '123-45'.toIntOrNull(); // null

.toUtf8()

Converts String to UTF-8 encoding.

final emptyString = ''.toUtf8(); // []
final hi = 'hi'.toUtf8(); // [104, 105]
final emoji = 'πŸ˜„'.toUtf8(); // [240, 159, 152, 132]

.toUtf16()

Converts String to UTF-16 encoding.

final emptyString = ''.toUtf16(); // []
final hi = 'hi'.toUtf16(); // [104, 105]
final emoji = 'πŸ˜„'.toUtf16(); // [55357, 56836]

Time utils

Dartx exports @jogboms great ⏰ time.dart package so you can do the following:

int secondsInADay = 1.days.inSeconds;

Duration totalTime = [12.5.seconds, 101.milliseconds, 2.5.minutes].sum();

DateTime oneWeekLater = DateTime.now() + 1.week;

Check out ⏰ time.dart for more information and examples.

num

.coerceIn()

Ensures that this value lies in the specified range.

final numberInRange = 123.coerceIn(0, 1000); // 123
final numberOutOfRange = -123.coerceIn(0, 1000); // 0

.toBytes()

Converts this value to binary form.

range

rangeTo

Creates a range between two ints (upwards, downwards and with custom steps)

// upwards with default step size 1
for (final i in 1.rangeTo(5)) {
  print(i); // 1, 2, 3, 4, 5
}
// downwards with custom step
for (final i in 10.rangeTo(2).step(2)) {
  print(i); // 10, 8, 6, 4, 2
}

Function

.partial(), .partial2() ...

Applies some of the required arguments to a function and returns a function which takes the remaining arguments.

void greet(String firstName, String lastName) {
  print('Hi $firstName $lastName!');
}

final greetStark = greet.partial('Stark');
greetStark('Sansa'); // Hi Sansa Stark!
greetStark('Tony'); // Hi Tony Stark!

File

.name

Get the name and extension of a file.

final file = File('some/path/testFile.dart');
print(file.name); // testFile.dart
print(file.nameWithoutExtension); // testFile

.appendText()

Append text to a file.

await File('someFile.json').appendText('{test: true}');

.isWithin()

Checks if a file is inside a directory.

final dir = Directory('some/path');
File('some/path/file.dart').isWithin(dir); // true

Directory

.file(String)

References a file within a Directory

Directory androidDir = Directory('flutter-app/android');
File manifestFile = androidDir.file("app/src/main/AndroidManifest.xml");

References a directory within a Directory

.directory(String)

Directory androidDir = Directory('flutter-app/android');
Directory mainSrc = androidDir.directory("app/src/main");

.contains(FileSystemEntity entity, {bool recursive = false})

Checks if a Directory contains a FileSystemEntity. This can be a File or a Directory.

Use the recursive argument to include the subdirectories.

final File someFile = File('someFile.txt');
final Directory someDir = Directory('some/dir');

final Directory parentDir = Directory('parent/dir');

parentDir.contains(someFile);
parentDir.contains(someDir);
parentDir.contains(someFile, recursive: true);
parentDir.contains(someDir, recursive: true);

This is the async method, which returns a Future<bool>.

.containsSync(FileSystemEntity entity, {bool recursive = false})

Same as .contains(FileSystemEntity entity, {bool recursive = false}) but synchronous. Returns a bool.

License

Copyright 2019 Simon Leier

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Adding time extensions

    Adding time extensions

    Hello!

    I got the code produced by jogboms on https://github.com/jogboms/time.dart and merged his great libraries into dartx.

    This commit introduces all the jogbom's extensions to time types, like producing durations through integers and some other utility methods.

    opened by shinayser 21
  • Null Safety Migration

    Null Safety Migration

    Just wanted to open an issue for this since null safety is now in beta and they are encouraging package authors to migrate.

    A quick check with pub outdated --mode=null-safety shows that crypto and time still need to update before this package probably should.

    Showing dependencies that are currently not opted in to null-safety.
    [βœ—] indicates versions without null safety support.
    [βœ“] indicates versions opting in to null safety.
    
    Package Name  Current  Upgradable  Resolvable             Latest                 
    
    direct dependencies:
    characters    -        βœ—1.0.0      βœ“1.1.0-nullsafety.5    βœ“1.1.0-nullsafety.5    
    collection    -        βœ—1.14.13    βœ“1.15.0-nullsafety.5   βœ“1.15.0-nullsafety.5   
    crypto        -        βœ—2.1.5      βœ—2.1.5                 βœ—2.1.5                 
    meta          -        βœ—1.2.4      βœ“1.3.0-nullsafety.6    βœ“1.3.0-nullsafety.6    
    path          -        βœ—1.7.0      βœ“1.8.0-nullsafety.3    βœ“1.8.0-nullsafety.3    
    time          -        βœ—1.3.0      βœ—1.3.0                 βœ—1.3.0                 
    
    dev_dependencies:
    fake_async    -        βœ—1.1.0      βœ“1.2.0-nullsafety.3    βœ“1.2.0-nullsafety.3    
    pedantic      -        βœ—1.9.2      βœ“1.10.0-nullsafety.3   βœ“1.10.0-nullsafety.3   
    test          -        βœ—1.15.5     βœ“1.16.0-nullsafety.10  βœ“1.16.0-nullsafety.10  
    
    No pubspec.lock found. There are no Current versions.
    Run `pub get` to create a pubspec.lock with versions matching your pubspec.yaml.
    
    7  dependencies are constrained to versions that are older than a resolvable version.
    To update these dependencies, edit pubspec.yaml.
    
    
    opened by TimWhiting 10
  • Add String.toBool

    Add String.toBool

    Original purpose was Object.isTrue:

    extension on Object {
      bool get isTrue => isTrueOrNull ?? false;
    
      bool get isTrueOrNull {
        return this is bool ? this
           : this is String ? this.isTrue // String.isTrue
           : this is int ? this.isTrue // int.isTrue
           : this is double ? this.isTrue // double.isTrue
           : this is Iterable ? this.isTrue // Iterable.isTrue
           : null;
      }
    }
    

    According to the comments, we're going to add String.toBool only for this PR.

    opened by yongjhih 9
  • Do we need `invoke` method?

    Do we need `invoke` method?

    Dart, basically, supports thecall() method for all Functions. So we can already use myFunction?.call(). In addition, call() method can take any number of arguments.

    opened by wurikiji 8
  • Add median to iterable_num

    Add median to iterable_num

    I added a median function to iterable_num.

    I also reformatted the zero argument functions to getters (which improves readability IMO). I also updated the documentation of average to reflect the actual function.

    EDIT: probably shouldn't have changed to getters; it's pretty useless and might break code unnecessarily. Will update PR...

    opened by AKushWarrior 6
  • Add `.indexIntervals()`, `.mode()`, `.variance()`, and `.stdDev()` methods.

    Add `.indexIntervals()`, `.mode()`, `.variance()`, and `.stdDev()` methods.

    The former-most is for the Iterable extension, whereas the latter three are for the Iterable<num> extension. Tests have been provided for all three. I've adhered to the formatting guidelines from analysis_options.yaml, but you're welcome to reformat/tweak my code as necessary.

    opened by AKushWarrior 5
  • Cloud support DateTime.isLeapYear

    Cloud support DateTime.isLeapYear

    Like this

    extension DateTimeExtension on DateTime {
    
      bool get isLeapYear => year % 400 == 0 || year % 100 != 0 && year % 4 == 0;
    
      int get daysInMonth => _calcDaysInMonth();
    
      int _calcDaysInMonth() {
        switch (month) {
          case DateTime.january:
          case DateTime.march:
          case DateTime.may:
          case DateTime.july:
          case DateTime.august:
          case DateTime.october:
          case DateTime.december:
            return 31;
          case DateTime.february:
            return isLeapYear ? 29 : 28;
          case DateTime.april:
          case DateTime.june:
          case DateTime.september:
          case DateTime.november:
          default:
            return 30;
        }
      }
    }
    
    opened by wangbo4020 5
  • path version conflict

    path version conflict

    dartx: 0.4.0 is incompatible with Flutter 1.17 because of path.

    dependencies:
      flutter:
        sdk: flutter
      dartx: ^0.4.0
    
    dev_dependencies:
      flutter_test:
        sdk: flutter
    
    $ flutter packages get
    Because every version of flutter_test from sdk depends on path 1.6.4 and dartx 0.4.0 depends on path ^1.7.0, flutter_test from sdk is incompatible with dartx 0.4.0.
    And because no versions of dartx match >0.4.0 <0.5.0, flutter_test from sdk is incompatible with dartx ^0.4.0.
    So, because spitch depends on both dartx ^0.4.0 and flutter_test any from sdk, version solving failed.
    
    opened by passsy 5
  • About the duplicated methods...

    About the duplicated methods...

    Originally this issue was to discuss the need of the coerceIn method, but before I searched on the issues history and found that this issue already exists https://github.com/leisim/dartx/issues/18. The argument that @leisim used on it is pretty valid as it helps other developers from other languages to find more easily some of their correspondents on dart language.

    But this causes a problem: too many methods on the auto complete window that does the same thing.

    And if you allow me to question: why we are only providing methods for the Kotlin users? Why not provide also duplicated methods for Swift, Javascript, PhP, Python, c++... see my point?

    But I think I have a nice sollution for this problems and would like to hear other collaborators thoughts:

    • Instead of providing methods that does the same thing of the Dart method's, we could add a section to the README file that does a one-to-one correspondency to other languages methods.

    This would resolve the methods overflooding and also help other developers to find correspondents on the Dart language.

    What you ~guys~ folks think?

    opened by shinayser 5
  • Add '.count' method to Lists and maps

    Add '.count' method to Lists and maps

    I'd like to submit a PR for this when I get time unless someone adds it before me. Basically it would take the same parameters as a where function and will return the number of elements in the list or map that satisfy the condition

    opened by ThinkDigitalSoftware 5
  • Added all HttpRequest Extensions from https://github.com/TechSar-dev/…

    Added all HttpRequest Extensions from https://github.com/TechSar-dev/…

    I was recently about to start work on a similar project which aims to simplify the Dart SDK API. It's a huge task and will take time, so I am adding things as I need them. I would like to merge what I have so far and work on this project moving forward.

    Hopefully this pr is acceptable, if not - please let me know if I need to change anything to meet the conventions of this library.

    Thanks.

    opened by g5becks 5
  • `move` methods on `List`

    `move` methods on `List`

    Working with reorderable lists like reorderables or ReorderableListView there often is a callback like void onReorder(int oldIndex, int newIndex)

    Would it make sense to you to add something like it's done here?

    Especially the move and moveAt methods would be nice little helpers in that scenario.

    opened by robiness 1
  • Feature: camel, pascal, snake, kebab and dot case styles for string

    Feature: camel, pascal, snake, kebab and dot case styles for string

    Add new case styles extension for String.

    • camelCase with camel()
    • PascalCase with pascal()
    • snake_case with snake()
    • kebab-case with kebab()
    • dot.case with dot()

    Usage

    'Hello World'.camel(); // helloWorld
    'Hello World'.pascal(); // HelloWorld
    'Hello World'.snake(); // hello_world
    'Hello World'.kebab(); // hello-world
    'Hello World'.dot(); // hello.world
    

    See tests for more examples.

    opened by hugo-pcl 2
  • Add fill parameter to chunked()

    Add fill parameter to chunked()

    Debating whether chuckIndex vs. index (the index that the new element would otherwise be in) is a more logical API. Let me know your thoughts + any changes I should make.

    Thanks :)

    opened by rlch 0
Releases(v1.1.0)
  • v1.1.0(Apr 12, 2022)

    • PR-151 New: String?.isNullOrBlank, String?.isNotNullOrBlank
    • PR-149 Fix type of extension: IterableForthItem -> IterableFourthItem
    • PR-147 New: int.toChar(): String
    • PR-147 New: String?.orEmpty: bool
    • PR-147 New: String.matches(RexExp): bool
    • PR-147 New: String.urlEncode and String.urlDecode
    • PR-147 New: buildString to build a StringBuffer an immediately return it
    • PR-156 Fix: Iterable.takeFirst(n) and Iterable.takeLast(n) crashed when n > length
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Dec 10, 2021)

  • v0.8.0(Nov 1, 2021)

    • PR-136 New: Multiple extensions for Map. all(), any(), count(), filter(), filterKeys(), filterNot, filterValues, getOrElse(), mapEntries(), mapKeys(), mapValues(), maxBy(), maxWith(), minBy(), minWith, none(), toList(), toMap(), orEmpty()
    • PR-127 Improve: sumBy is now generic and works equally for num/int/double
    • PR-131 Fix: min()/max() which returned the wrong item for reversed ordered lists
    • PR-133 New: plus()/minus() and plusOrNull/minusOrNull to num which handle null
    • PR-138 Improve: Iterable.second returns T instead of T?. Analog to first
    • PR-142 Fix: isUpperCase/isLowerCase now threat only [a-zA-Z] chars as being uppercase

    Also, all linting issues have been fixed and the README has been drastically improved. Thanks @minhqdao

    Source code(tar.gz)
    Source code(zip)
  • v0.7.1(Mar 22, 2021)

  • v0.7.0(Mar 14, 2021)

    • All extensions methods now have their own extension which can be imported explicitly with show/hide. This allows the usage of package:collection and dartx in the same file.
    • Undeprecate firstOrNullWhere until dartx can export package:collection itself
    • New Directory.file and Directory.directory extensions to quickly create file/directory references
    • Update time package
    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Mar 1, 2021)

  • v0.5.0(Jul 21, 2020)

    • PR-94 Breaking: Iterable<T>.zip(other, transform) now supports zipping iterables of other types the T. This is a breaking change because it is now required to add types in the transform function.
      final amounts = [2, 3, 4];
      final animals = ['dogs', 'birds', 'cats'];
      final all = amounts.zip(animals, (int amount, String animal) => '$amount $animal');
      // lambda types are now required:  ⇧           ⇧
      // all: ['2 dogs', '3 birds', '4 cats']
      
    • PR-90 New String extensions
      • String removePrefix(String prefix)
      • String removeSuffix(String suffix)
      • String removeSurrounding({String prefix, String suffix})
      final name = 'James Bond'.removePrefix('James '); // Bond
      final milliseconds = '100ms'.removeSuffix('ms'); // 100
      final text = '<p>Some HTML</p>'.removeSurrounding(prefix: '<p>', suffix: '</p>'); // Some HTML
      
    • PR-88 New List extension void swap(int, int) which swaps the elements in the indices provided.
      final list = [1, 2, 3, 4];
      list.swap(0, 2); // [3, 2, 1, 4]
      
    • PR-100 Relax the upper version constraint of collection to support Flutter 1.20 (which uses collection: 1.3.0-nullsafety)
    • PR-101 Relax the upper version constraint of crypto
    Source code(tar.gz)
    Source code(zip)
  • v0.4.2(Jun 17, 2020)

    • Increase dependency range of characters to include 1.0.0. Fixes #87
    • Raise min sdk version to 2.6.0 to prevent pub publishing warning for pre-release versions
    Source code(tar.gz)
    Source code(zip)
  • v0.4.1(May 14, 2020)

  • v0.4.0(May 3, 2020)

    Iterable

    • PR-41 New Iterable<T>.containsAny(Iterable<T>) extension
    • PR-46 New Iterable<num>.median() extension
    • PR-53 New Iterable<T>.asStream() extension converts any Iterable to a Stream
    • PR-59 New Iterable<T>.cached extension creates a cached Iterable preventing lazy operators such as .map to execute again
    • PR-56 Make Iterable<Iterable<T>>.flatten() typesafe and return Iterable<T> instead of Iterable<dynamic>
    • PR-62 New Iterable<T>.chunkWhile(bool Function(T, T) predicate): Iterable<List<E>> extension splits a collection into a lazy Iterables of chunks, where chunks are created as long as predicate is true for a pair of entries.
    • PR-62 New Iterable<T>.splitWhen(bool Function(E, E) predicate): Iterable<List<E>> extension splits a collection into a lazy Iterable, where each split will be make if predicate returns true for a pair of entries.
    • PR-54 New Iterable<Future<T>>.asStreamAwaited(): Stream<T> extension to create a stream from a group of futures.

    String

    • PR-72 New String.isNullOrEmpty extension
    • PR-43 New String.toInt({int radix}) extension as alias for int.parse(String, {int radix}) (also String.toIntOrNull({int radix}))
    • PR-75 Deprecate String.chars in favour of String.characters from the official characters package.

    Ranges

    • PR-74 New Comparable<T>.rangeTo(Comparable<T> end) extension to create ranges of DateTime or String.
    • PR-45 New num.between(num first, num endInclusive): bool extension
    • PR-45 New num.inRange(Range<num> range): bool extension
    • PR-45 New Comparable<T>.between(T first, T endInclusive): bool extension
    • PR-45 New Comparable<T>.inRange(ComparableRange<T> range): bool extension

    Thanks to our external contributors @ThinkDigitalSoftware, @shinayser, @yongjhih, @AKushWarrior, @rrousselGit, @simolus3 and @MohiuddinM!

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Jan 17, 2020)

    • PR-14 New int.rangeTo(int) extension
    • PR-24 Default implementations for Comparable <, <=, >= and > operators.
    • PR-13 Removed quiver dependency
    • PR-21 New String.md5 to calculate a MD5 digest
    • PR-25 New FileSystemEntity.withName(String newName) to get a File with a different name
    • PR-25 New FileSystemEntity.extension to get the file extension
    • PR-17 Callable.invoke() is now marked as Deprecated in favour of darts call() method. It will not be removed though, until darts .call() methods gets auto-completion.
    • PR-30 New Comparable.coerceIn(), Comparable.coerceAtLeast() and Comparable.coerceAtMost()
    • PR-31 Fixed num.toBytes()
    • PR-33 Fixed .thenBy() and .thenWith() extensions for Lists
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Jan 4, 2020)

  • v0.1.2(Oct 27, 2019)

    • Fixed docs
    • Added Function.curry(), Function.invoke(), Function.partial() and Function.flip()
    • 'string'.reversed now correctly handles grapheme clusters (like emoji)
    • Breaking: 'string'.chars now returns the grapheme clusters instead of Runes
    Source code(tar.gz)
    Source code(zip)
  • v0.1.1(Oct 26, 2019)

  • v0.1.0(Oct 24, 2019)

Owner
Simon Leier
Electrical engineer, Android & Flutter developer
Simon Leier
A kotlin-style extension collection for dart.

Collection of extensions Dart is good but can be better. Kotlin Style Join QQ Group now: 1003811176 For objects: let run also takeIf takeUnless For st

OpenFlutter 6 Nov 2, 2022
A collection of useful algorithms in Dart with keeping performance and flexibility on mind.

algorithmic A collection of useful algorithms in Dart with keeping performance and flexibility on mind. Usage The following import will give you acces

Sudipto Chandra 7 Jan 1, 2023
βš’οΈ A monorepo containing a collection of packages that provide useful functionality for building CLI applications in Dart.

βš’οΈ Dart CLI Utilities A monorepo containing a collection of packages that provide useful functionality for building CLI applications in Dart. Document

Invertase 14 Oct 17, 2022
A collection of useful scripts for dart or flutter projects

DFS - Dart Flutter Scripts Warning: everything is WIP. A collection of useful scripts for dart or flutter projects. The scripts can be executed in the

null 20 Dec 24, 2022
A personal collection of useful scripts for everyday development, written in Dart.

Suitcase ?? Generated by the Very Good CLI ?? A collection of useful personal scripts and tools. TODO: Improve this README Getting Started ?? If the C

Jeroen Meijer (Jay) 14 Nov 22, 2022
A collection of Flutter apps with some useful tricks

Flutter Apps Collection A simple collection of flutter applications with some common use cases & useful little tricks. The apps have been tested in iO

Anis Benna 5 May 12, 2022
A collection of useful packages maintained by the Flutter team

Flutter Packages This repo is a companion repo to the main flutter repo. It contains the source code for Flutter's first-party packages (i.e., package

Flutter 2.3k Dec 30, 2022
Dart and Flutter sealed class generator and annotations, with match methods and other utilities. There is also super_enum compatible API.

Dart Sealed Class Generator Generate sealed class hierarchy for Dart and Flutter. Features Generate sealed class with abstract super type and data sub

6thSolution 15 Jan 2, 2023
Learn how to use Dart List Utility Methods in Flutter

Flutter Tutorial - List Utility Methods Learn how to use Dart List Utility Metho

Behruz Hurramov 0 Dec 29, 2021
A dart package for many helper methods fitting common situations

Basic Utils A dart package for many helper methods fitting different situations. Table of Contents Basic Utils Table of Contents Preamble Install pubs

null 275 Jan 5, 2023
Ruqe brings the convenient types and methods found in Rust into Dart, such as the Result, Option, pattern-matching, etc.

ruqe Ruqe brings the convenient types and methods found in Rust into Dart, such as the Result, Option, pattern-matching, etc. Additionally, the librar

Alexander Nitiola 12 Dec 28, 2022
JSON formatted API Get, Patch, Put, Post, Delete methods implemented as a dummy.

json_api_handle A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Md. Sabik Alam Rahat 4 Nov 13, 2022
The Integration Test Helper has pre-configured methods that allow for faster test deployment for end to end (e2e) test coverage.

The Integration Test Helper has pre-configured methods that allow for faster test deployment for end to end (e2e) test coverage (using Android and iOS

The Mobile Applications Community 2 Apr 7, 2022
Hive Wait provide a Hive repository to calling methods in the box as async.

Hive Wait provide a Hive repository to calling methods in the box as async.

GiΓ‘o Hα»“ 1 May 10, 2022
Dart library for creating static trees of execution.

Processing tree Dart library for building and executing static trees of execution created in runtime. When to use it The main idea behind usage of thi

The Tosters 1 Dec 20, 2021
How to get the most value from Dart static analysis

This package is deprecated. Before it was deprecated, it was the way to get analysis options matching those used internally at Google. This was useful

Google 324 Nov 4, 2022
How to get the most value from Dart static analysis

This package is deprecated. Before it was deprecated, it was the way to get analysis options matching those used internally at Google. This was useful

Google 324 Nov 4, 2022
Flutter-Apps-Collection: a collection of apps made in flutter for learning purpose

Flutter-Apps-Collection This is a repository of a collection of apps made in flutter for learning purpose Some Screenshots . . . Apps build in Flutter

Himanshu Singh 96 May 27, 2022
A Flutter widget to create an iOS settings-table (static TableView).

flutter_cupertino_settings A Flutter widget to create an iOS settings-table (static TableView). import 'package:flutter_cupertino_settings/flutter_cup

Matthias Rupp 234 Dec 28, 2022