dart_simple_math 0.1.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 20

Dart LCG #

Basic linear congruential generator written in dart to get a feel of the dart programming language.

Inspired by SENG475 assignment 1, I tried to adhere to the api specifications in that assignments.

0.1.3 Adding rational number class

0.1.2 linking to github

0.1.1 updating version

0.1.0 INITIAL RELEASE

example/example.dart

import 'package:dart_lcg/lcg/lcg.dart';
void main() {
  LCG test = new LCG(5,4,3,2);
}

Use this package as a library

1. Depend on it

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


dependencies:
  dart_simple_math: ^0.1.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dart_simple_math/lcg/lcg.dart';
import 'package:dart_simple_math/lcg/lcg_interface.dart';
import 'package:dart_simple_math/main.dart';
import 'package:dart_simple_math/rat/rational.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
20
Learn more about scoring.

We analyzed this package on Jan 16, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Analysis issues and suggestions

Make sure dartfmt successfully runs on your package's source files.

Running dartfmt -n . failed with the following output:

Exception: dartfmt on lib/ failed with exit code 65
Could not format because the source could not be parsed:

line 2, column 8 of lib/main.dart: Expected to find ';'.
  ╷
2 │ export "rat/rational.dart"
  │        ^^^^^^^^^^^^^^^^^^^
  ╵

Health issues and suggestions

Fix lib/rat/rational.dart. (-25.75 points)

Analysis of lib/rat/rational.dart failed with 1 error, 2 hints:

line 38 col 17: 'Rational.==' ('bool Function(Rational)') isn't a valid override of 'Object.==' ('bool Function(dynamic)').

line 98 col 7: DO use curly braces for all flow control structures.

line 100 col 7: DO use curly braces for all flow control structures.

Fix lib/lcg/lcg.dart. (-25.38 points)

Analysis of lib/lcg/lcg.dart failed with 1 error, 1 hint:

line 52 col 16: 'LCG.==' ('bool Function(LCG)') isn't a valid override of 'Object.==' ('bool Function(dynamic)').

line 19 col 3: Avoid return types on setters.

Fix lib/main.dart. (-25 points)

Analysis of lib/main.dart failed with 1 error:

line 2 col 8: Expected to find ';'.

Document public APIs. (-0.33 points)

43 out of 44 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/lcg/lcg_interface.dart. (-0.50 points)

Analysis of lib/lcg/lcg_interface.dart reported 1 hint:

line 16 col 3: Avoid return types on setters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
Dev dependencies
test ^1.9.2