duple 1.3.0

  • Readme
  • Changelog
  • Installing
  • 68

Duple #

Minimal tuple library for Dart.

Usage #

Simple usage examples as follows. See accompanying tests for more specific examples.

Import duple.

import 'package:duple/duple.dart';

Empty Tuple #

All EmptyTuples are identical.

main() {
  var emptyTuple = EmptyTuple();
  assert(emptyTuple == EmptyTuple());

One-Tuple #

main() {
  var oneTupleWithString = Tuple1<String>('hello world!');
  var oneTupleWithInt = Tuple1<int>(1);
  print("One tuple contains ${oneTupleWithInt.item0}");

Two-Tuple #

main() {
  var twoTupleWithSameTypes = Tuple2<int, int>(1, 2);
  var twoTupleWithDifferentTypes = Tuple2<int, String>(1, 'X');
  print("Two tuple contains ${twoTupleWithSameTypes.item0}, "
  " and ${twoTupleWithSameTypes.item1}");

1.3.0 #

  • Added Tuple3, Tuple4, Tuple5, Tuple6 and Tuple7.

1.2.0 #

  • Added Tuple2.

1.1.1 #

  • Fixed mutable Tuple1.

1.1.0 #

  • Added Tuple1.
  • Refactored tests on EmptyTuple.

1.0.0 #

  • Added EmptyTuple.

Use this package as a library

1. Depend on it

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

  duple: ^1.3.0

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:duple/duple.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.7.0
  • pana: 0.13.4

Health suggestions

Format lib/src/empty_tuple.dart.

Run dartfmt to format lib/src/empty_tuple.dart.

Format lib/src/tuple1.dart.

Run dartfmt to format lib/src/tuple1.dart.

Format lib/src/tuple2.dart.

Run dartfmt to format lib/src/tuple2.dart.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/tuple4.dart (Run dartfmt to format lib/src/tuple4.dart.)
  • lib/src/tuple5.dart (Run dartfmt to format lib/src/tuple5.dart.)
  • lib/src/tuple6.dart (Run dartfmt to format lib/src/tuple6.dart.)
  • lib/src/tuple7.dart (Run dartfmt to format lib/src/tuple7.dart.)

Maintenance suggestions

The package description is too short. (-20 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. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and duple.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is getting outdated. (-7.12 points)

The package was last published 55 weeks ago.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
test ^1.0.0