A library for parsing dice notation
A simple usage example:
import 'package:dart_dice_parser/dart_dice_parser.dart';
main() {
var diceParser = new DiceParser();
var diceExpression = "2d6 + 1 + 3d10";
print("$diceExpression : ${diceParser.roll(diceExpression)}");
}
Please file feature requests and bugs at the issue tracker.
Add this to your package's pubspec.yaml file:
dependencies:
dart_dice_parser: ^0.2.0
You can install packages from the command line:
with pub:
$ pub get
with Flutter:
$ flutter packages get
Alternatively, your editor might support pub get
or flutter packages get
.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:dart_dice_parser/dart_dice_parser.dart';
Version | Uploaded | Documentation | Archive |
---|---|---|---|
0.2.0 | Oct 3, 2018 |
|
|
0.1.2 | Dec 1, 2017 |
|
|
0.1.1 | Dec 1, 2017 |
|
|
0.1.0 | Dec 1, 2017 |
|
|
0.0.6 | Dec 1, 2017 |
|
|
0.0.5 | Nov 28, 2017 |
|
|
0.0.4 | Nov 28, 2017 |
|
|
0.0.3 | Nov 28, 2017 |
|
|
0.0.2 | Nov 28, 2017 |
|
|
0.0.1 | Nov 28, 2017 |
|
|
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
0
|
Health:
Code health derived from static analysis.
[more]
|
100
|
Maintenance:
Reflects how tidy and up-to-date the package is.
[more]
|
81
|
Overall:
Weighted score of the above.
[more]
|
46
|
We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter, web, other
No platform restriction found in primary library
package:dart_dice_parser/dart_dice_parser.dart
.
Fix lib/src/dice_parser.dart
. (-0.50 points)
Analysis of lib/src/dice_parser.dart
reported 1 hint:
line 10 col 29: Use =
to separate a named parameter from its default value.
Format lib/src/dice_roller.dart
.
Run dartfmt
to format lib/src/dice_roller.dart
.
The package description is too short. (-19 points)
Add more detail to the description
field of pubspec.yaml
. Use 60 to 180 characters to describe the package, what it does, and its target use case.
Maintain an example.
None of the files in the package's example/
directory matches known example patterns.
Common filename patterns include main.dart
, example.dart
, and dart_dice_parser.dart
. Packages with multiple examples should provide example/README.md
.
For more information see the pub package layout conventions.
Package | Constraint | Resolved | Available |
---|---|---|---|
Direct dependencies | |||
Dart SDK | >=2.0.0 <3.0.0 | ||
petitparser | ^2.0.2 | 2.1.1 | |
Dev dependencies | |||
args | ^1.5.0 | ||
mockito | ^3.0.0 | ||
test | ^1.3.4 |