handy 1.0.1 copy "handy: ^1.0.1" to clipboard
handy: ^1.0.1 copied to clipboard

outdated

A collection of handy utilities that I found useful while writing my own programs.

This package is a collection of otherwise unrelated utilities that proved to be helpful to while creating Dart programs and Flutter apps.

Features #

Among the utilities implemented as of now, here are some of the notable ones:

  • Get the name of the enum without the preceding enum type name.
  • A range class the encapsulates minimum and maximum values.
  • Generate inclusive random numbers between any range.

Usage #

Here's some example usage of this package.

import 'package:handy/handy.dart';

enum HelloWorld {
  hello,
  world,
  exclamationPoint
}

void main() {
  print(HelloWorld.exclamationPoint.toShortString()); // exclamationPoint
  print(HelloWorld.world.toShortString()); // world

  Range<int> oneTen = Range<int>(1, 10);

  print(oneTen.random()); // *3
  print(oneTen.randomDouble()); // *7.633

  print(oneTen.clamp(0.9)); // 1
  print(oneTen.clamp(100)); // 10
}
2
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A collection of handy utilities that I found useful while writing my own programs.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on handy