dartlin 0.1.0+1
dartlin: ^0.1.0+1 copied to clipboard

Dartlin is a helper library that provides readable methods with which you can write cleaner looking code.

dartlin #

coverage report pipeline status
plugin version dependencies

Introduction #

What it does #

Dartlin is a helper library that provides readable methods with which you can write cleaner looking code.

  • It allows you to have more control over your code flow. By using the when method for example, to write switch-like expressions.
  • It provides methods to create data sets of certain types, for example the range method.

What does it not do #

The main focus of the library is adding readable methods and readability tends to not equal performance optimization. So is the case for some of the provided methods in this library. The performance hits of these methods is very minimal, but most of them do rely on closures to work.

Common Usage #

Control flow #

The when method replaces the switch statement. And can be used to write expressions:

final result = when(place, {
  1: () => CompetitionPlace.first,
  2: () => CompetitionPlace.second,
  3: () => CompetitionPlace.third,
  [4,5]: () => CompetitionPlace.honourableMentions,
  orElse: () => CompetitionPlace.others
});

See the when docs for more information.

12
likes
100
pub points
50%
popularity

Publisher

wolfenra.in

Dartlin is a helper library that provides readable methods with which you can write cleaner looking code.

Repository (GitLab)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on dartlin