duple 1.3.0

  • Readme
  • Changelog
  • Installing
  • 70

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:


dependencies:
  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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
53
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

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

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

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

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.

Dependencies

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