dice_roller 0.0.2
dice_roller: ^0.0.2 copied to clipboard
Simulate standard and custom dice rolls in Dart/Flutter.
Dice Roller #
A Dart library for simulating dice rolls.
A flexible and extensible Dart library for simulating dice rolls. This package allows you to roll standard dice, or create your own custom dice with any number of sides.
Getting Started #
To use this package, add dice_roller as a dependency in your pubspec.yaml file.
dependencies:
dice_roller: ^0.0.2
Then, run dart pub get (or flutter pub get if using Flutter) to install the package.
Usage #
Here's a simple example of how to use the dice_roller package to roll a standard 6-sided die:
import 'package:dice_roller/dice_roller.dart';
void main() {
// Create a standard 6-sided die.
final d6 = SixSidedDie();
// Roll the die.
final rollResult = DiceRoller().withDie(d6).roll();
// Print the result.
print('You rolled a ${rollResult.totalValue}');
}
License #
This project is licensed under the MIT License - see the LICENSE file for details.