Giter VIP home page Giter VIP logo

supercharged's People

Contributors

ascenio avatar awaik avatar felixblaschke avatar hawkbee1 avatar herveguigoz avatar jascodes avatar jodinathan avatar kirillartemenko avatar mjstel avatar shyndman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

supercharged's Issues

Iterable.pickOne and Iterable.pickSome throws ArgumentError for optional Random parameter

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.

Most Iterable extensions don't work with implicit-casts: false

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;
  }
}

Thanks!

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.

firstOrNull conflict with dart IterableExtensions

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?

[Suggestion] About maintaining supercharged_dart

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.

Missing ability to tween more than two values per tween

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))

Independent from Flutter

Supercharged cool library maybe you can make it independent from flutter or make another library for pure dart.

add between for DateTime

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 :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.