This monorepo contains two packages:
- supercharged for Flutter projects
- supercharged_dart for Dart web/native projects
Supercharged brings all the comfort features from languages like Kotlin to all Flutter developers.
This monorepo contains two packages:
Dart collections have recently added a bunch of convenient extension methods like firstOrNull. This now causes conflicts in my codebase as both supercharged and dart define the same extension.
Since dart now defines firstOrNull
can this be removed from supercharged?
As far as I understand, implicit-casts: false
will become the default with NNBD (dart-lang/sdk#31410 (comment)).
Currently most extensions fail with this set because the resulting generic types are not casted.
The solution is to also specify the type parameters on the extension functions.
For example change Map<K, List<V>> groupBy
to Map<K, List<V>> groupBy<K, V>
.
extension Iterable_<T, K, V> on Iterable<T> {
Map<K, List<V>> groupBy<K, V>(K Function(T element) keySelector,
{V Function(T element) valueTransform}) {
ArgumentError.checkNotNull(keySelector);
if (valueTransform == null) {
valueTransform = (element) => element as V;
}
Map<K, List<V>> map = {};
this.forEach((element) {
var key = keySelector(element);
if (!map.containsKey(key)) {
map[key] = [];
}
map[key].add(valueTransform(element));
});
return map;
}
}
Hey @felixblaschke,
Was just thinking this would be nice as a contributor. I got this set up recently on one of my repos, and it couldn't be easier:
https://github.com/madewithfelt/flutter_layout_grid/blob/main/.github/workflows/flutter-test.yml
Hi Felix!
I used your package in lots of projects, and it always helped me a lot.
I Just saw that you discontinued this package, and it makes me so sad.
Thanks for your perfect and valuable development.
Good luck, man.
please add extensions for padding, styles, borders etc
In 1.15.0-nullsafety.4
(https://github.com/dart-lang/collection/blob/master/CHANGELOG.md) Dart adopted a lot of supercharged extensions methods. This might result in code conflict. The following extensions are affected:
Iterable
Within that change we can also drop filter
in favour of Dart's native where
.
Instead of using code generation to check whatenever a file is flutter dependant or not you could just move all the files which are pure dart into supercharged_dart (such as Iteratable, List, Strings, etc) and just make supercharged dependent on supercharged_dart. Also, this repo could be transformed into a mono repo (for convenience) with both packages.
Supercharged cool library maybe you can make it independent from flutter or make another library for pure dart.
something like this....
Offset(0.0,0.35).tweenTo(Offset.zero)
Implement RGBA string "#RRGGBBAA" parsing
There are several cases where this would be convenient. For example, to fade a widget in and out, while also moving it from left to right, like this:
MultiTween()
..add('position', 0.0.tweenTo(100.0))
..add('opacity', 0.0.tweenTo(1.0).tweenTo(0.0))
Hi there,
Any objection to the library including Size.tweenTo
and Rect.tweenTo
extension methods?
If not, I'm happy to send a PR.
Thanks!
toInt/toDouble should return 0/0.0 if exception, at lease has a option for it.
current implements are same of 'int.tryParse/double.tryParse'.
after that, the user has to check the result is null or not.
https://github.com/andrewackerman/darq
Seems to offer a lot of the same capabilities, and is focused purely only iterables and yours seems to do both iterables and date time. Would be nice just reference one package instead of two different one.
Hi Felix,
do you mind if I try to add a method "between" for DateTime? (I would like to have such a method in my project)
As before, it takes your time for checking my PRs :)
Any thoughts on the singular aliases, just like in Rails/ActiveSupport?
Duration get days => Duration(days: this);
Duration get day => days; // for grammar, 1.day.ago()
Duration get hours => Duration(hours: this);
Duration get hour => hours;
Thanks for this awesome package.
I found one small issues:
The example shows the usage of pickOne and pickSome as follows:
[1, 2, 3].pickOne(); // Get a random item
[1, 2, 3].pickSome(2); // or multiple random items
But this is not possible, because both methods contains a ArgumentError.checkNotNull
for the optional random parameter.
Therefore the random parameter is currently required, which can confuse someone who is not looking into the package code.
It would be nice if both methods internally creates an instance of Random if no instance is provided.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.