intersperse 1.0.1+1

intersperse #

extra_pedantic on pub.dev Travis CI Codecov Pub.dev License Github Stars Twitter Follow GitHub Follow

Insert an element between each element of an Iterable or List.


    final list1 = intersperse(2, <int>[]); // [];
    final list2 = intersperse(2, [0]); // [0];
    final list3 = intersperse(2, [0, 0]); // [0, 2, 0];
    final list1Outer = intersperseOuter(2, <int>[]); // [];
    final list2Outer = intersperseOuter(2, [0]); // [2, 0, 2];
    final list3Outer = intersperseOuter(2, [0, 0]); // [2, 0, 2, 0, 2];

1.0.1+1 #

  • readme update

1.0.1 #

  • folds replaced with synchronous generators

1.0.0 #

  • Initial version, created by Stagehand

example/intersperse_example.dart

import 'package:intersperse/intersperse.dart';

void main() {
  final list1 = intersperse(2, <int>[]); // [];
  final list2 = intersperse(2, [0]); // [0];
  final list3 = intersperse(2, [0, 0]); // [0, 2, 0];
  final list1Outer = intersperseOuter(2, <int>[]); // [];
  final list2Outer = intersperseOuter(2, [0]); // [2, 0, 2];
  final list3Outer = intersperseOuter(2, [0, 0]); // [2, 0, 2, 0, 2];

  print(list1);
  print(list2);
  print(list3);
  print(list1Outer);
  print(list2Outer);
  print(list3Outer);
}

Use this package as a library

1. Depend on it

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


dependencies:
  intersperse: ^1.0.1+1

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:intersperse/intersperse.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]
100
Overall:
Weighted score of the above. [more]
76
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.5

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.4 <3.0.0
Dev dependencies
extra_pedantic ^1.1.1
test ^1.5.0
test_coverage ^0.2.0