dart_dice_parser 0.2.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 46

dart_dice_parser #

A library for parsing dice notation

Usage #

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

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Changelog #

0.2.0 #

  • upgrade to dart 2

0.1.2 #

  • move args to dev_dependency, since it's just for the example

0.1.1 #

  • added contributing/code-of-conduct docs

0.1.0 #

  • change DiceRoller to output information about individual rolls, instead of just returning the sum.

0.0.6 #

  • remove dependency on quiver, since not heavily using it

0.0.5 #

  • various fixes as I figure out what I'm doing with Dart
  • empty/null checking with quiver.strings

0.0.1 #

  • Initial version, created by Steve Christensen

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dart_dice_parser: ^0.2.0

2. Install it

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.

3. Import it

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 Go to the documentation of dart_dice_parser 0.2.0 Download dart_dice_parser 0.2.0 archive
0.1.2 Dec 1, 2017 Go to the documentation of dart_dice_parser 0.1.2 Download dart_dice_parser 0.1.2 archive
0.1.1 Dec 1, 2017 Go to the documentation of dart_dice_parser 0.1.1 Download dart_dice_parser 0.1.1 archive
0.1.0 Dec 1, 2017 Go to the documentation of dart_dice_parser 0.1.0 Download dart_dice_parser 0.1.0 archive
0.0.6 Dec 1, 2017 Go to the documentation of dart_dice_parser 0.0.6 Download dart_dice_parser 0.0.6 archive
0.0.5 Nov 28, 2017 Go to the documentation of dart_dice_parser 0.0.5 Download dart_dice_parser 0.0.5 archive
0.0.4 Nov 28, 2017 Go to the documentation of dart_dice_parser 0.0.4 Download dart_dice_parser 0.0.4 archive
0.0.3 Nov 28, 2017 Go to the documentation of dart_dice_parser 0.0.3 Download dart_dice_parser 0.0.3 archive
0.0.2 Nov 28, 2017 Go to the documentation of dart_dice_parser 0.0.2 Download dart_dice_parser 0.0.2 archive
0.0.1 Nov 28, 2017 Go to the documentation of dart_dice_parser 0.0.1 Download dart_dice_parser 0.0.1 archive
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
Learn more about scoring.

We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:dart_dice_parser/dart_dice_parser.dart.

Health suggestions

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.

Maintenance suggestions

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.

Dependencies

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