pop 0.1.1 pop: ^0.1.1 copied to clipboard
pop.dart's a set of utility methods and classes to make Dart development intuitive, simple, and readable.
pop
#
pop.dart
's a set of utility methods and classes to make Dart development intuitive, simple, and readable.
pop.dart
's goal is to provide data structures, algorithms and utilities (in forms of functions, classes and static extension methods) to make your Dart code more expressive, concise and readable without compromising on performance and type safety.
Disclaimer #
This package is still in its early phase of development: APIs might change, behavior might change, and classes and functions may be removed.
Important links #
- Read the source code and star the repo on GitHub
- Open an issue on GitHub
- See package on pub.dev
- Read the docs on pub.dev
If you enjoy using this package, a thumbs-up on pub.dev would be highly appreciated! 👍💙 Let's get to 100 likes 🚀
Motivation #
As I was writing Dart code, I noticed that I keep re-implementing the same patterns over and over again in various projects. This package tries to implement common data structures and algorithms that make the code more expressive and fast.
Of course, as always, this package is not a silver-bullet, and there are great packages by the Dart team that significantly improve the Dart developer experience and that are actually battle-tested.
Some of these are: dart:collection
, package:collection
, package:quiver
.
The pop
package aims to complement these packages, and only "re-invent the wheel" where I am unhappy with the implementation in those libraries.
Usage #
A detailed, beginner-friendly guide with examples is coming soon.
For now, please refer to the API docs. I am doing my best to provide a great documentation with plenty of examples for every function, class and method of this package.
Here are some examples of what this package provides.
DefaultMap
#
final string = 'mississippi'.split('');
// Without DefaultMap
final counterMap = <String, int>{};
for (final char in string) {
if (!counterMap.containsKey(char)) counterMap[char] = 0;
counterMap[char] = counterMap[char]! + 1;
}
// With DefaultMap
final counterMap = DefaultMap<String, int>(0);
for (final char in string) counterMap[char] += 1;
Contribution #
I'd appreciate you reading the docs. I did my best to provide stellar documentation, but sometimes it's just "not there yet". If you have usage examples, where the package made your code better, feel free to submit a docs improvement PR. If the description is not clear somewhere and you know how to make it better, open a PR. If existing behavior is surprising, please open an issue. We will see if we can make the code less surprising.