dartx 1.2.0
dartx: ^1.2.0 copied to clipboard
Superpowers for Dart. Collection of useful static extension methods.
1.2.0 #
- Official Dart 3.0 release
- General cleanup and CI update
1.1.0 #
- 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.urlEncodeandString.urlDecode - PR-147 New:
buildStringto build aStringBufferan immediately return it - PR-156 Fix:
Iterable.takeFirst(n)andIterable.takeLast(n)crashed when n > length
1.0.0 #
- Promote to stable version
- Remove deprecated extensions
0.8.0 #
- 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:
sumByis now generic and works equally fornum/int/double - PR-131 Fix:
min()/max()which returned the wrong item for reversed ordered lists - PR-133 New:
plus()/minus()andplusOrNull/minusOrNulltonumwhich handlenull - PR-138 Improve:
Iterable.secondreturnsTinstead ofT?. Analog tofirst - PR-142 Fix:
isUpperCase/isLowerCasenow 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
0.7.1 #
0.7.0 #
- All extensions methods now have their own extension which can be imported explicitly with
show/hide. This allows the usage ofpackage:collectionanddartxin the same file. - Undeprecate
firstOrNullWhereuntildartxcan exportpackage:collectionitself - New
Directory.fileandDirectory.directoryextensions to quickly create file/directory references - Update
timepackage
0.6.0 #
0.5.0 #
- PR-94 Breaking:
Iterable<T>.zip(other, transform)now support zipping iterables of other types theT. 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
StringextensionsString 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
Listextensionvoid 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
collectionto support Flutter 1.20 (which usescollection: 1.3.0-nullsafety) - PR-101 Relax the upper version constraint of
crypto
0.4.2 #
- Increase dependency range of
charactersto include1.0.0 - Raise min sdk version to
2.6.0to prevent pub publishing warning for pre-release versions
0.4.1 #
0.4.0 #
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>.cachedextension creates a cachedIterablepreventing lazy operators such as.mapto execute again - PR-56 Make
Iterable<Iterable<T>>.flatten()typesafe and returnIterable<T>instead ofIterable<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 aspredicateis 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 lazyIterable, where each split will be make ifpredicatereturnstruefor 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.isNullOrEmptyextension - PR-43 New
String.toInt({int radix})extension as alias forint.parse(String, {int radix})(alsoString.toIntOrNull({int radix})) - PR-75 Deprecate
String.charsin favour ofString.charactersfrom the officialcharacterspackage.
Ranges #
- PR-74 New
Comparable<T>.rangeTo(Comparable<T> end)extension to create ranges ofDateTimeorString. - PR-45 New
num.between(num first, num endInclusive): boolextension - PR-45 New
num.inRange(Range<num> range): boolextension - PR-45 New
Comparable<T>.between(T first, T endInclusive): boolextension - PR-45 New
Comparable<T>.inRange(ComparableRange<T> range): boolextension
0.3.0+1 #
- Improve package scoring by upgrading dependencies and formatting files
- Change README slightly
0.3.0 #
- PR-14 New
int.rangeTo(int)extension - PR-24 Default implementations for
Comparable<,<=,>=and>operators. - PR-13 Removed
quiverdependency - PR-21 New
String.md5to calculate a MD5 digest - PR-25 New
FileSystemEntity.withName(String newName)to get aFilewith a different name - PR-25 New
FileSystemEntity.extensionto get the file extension - PR-17
Callable.invoke()is now marked asDeprecatedin favour of dartscall()method. It will not be removed though, until darts.call()methods gets auto-completion. - PR-30 New
Comparable.coerceIn(),Comparable.coerceAtLeast()andComparable.coerceAtMost() - PR-31 Fixed
num.toBytes() - PR-33 Fixed
.thenBy()and.thenWith()extensions for Lists
Breaking #
- PR-29
Iterable<E>.windowed- remove the required transform lambda
0.2.0 #
- Moved to
time.dartlibrary for time extensions
0.1.2 #
- Fixed docs
- Added
Function.curry(),Function.invoke(),Function.partial()andFunction.flip() 'string'.reversednow correctly handles grapheme clusters (like emoji)
Breaking #
'string'.charsnow returns the grapheme clusters instead ofRunes
0.1.1 #
- Bugfixes
- More tests
0.1.0+1 #
- Initial release