stack 0.1.0

dart_stack #

A dart package for stack datastructure

codecov CircleCI

Usage #

Add dev dependency to your pubspec.yaml:

dev_dependencies:
  stack: ^0.0.1

Run pub get to install.

How it works #

Import

import 'package:stack/stack.dart';

Example

// Initialize
Stack<String> stack = Stack();
// Push
stack.push('abc');
// See the top
stack.top();
// Pop the top
stack.pop();
// Check for empty
stack.isEmpty;
// Check for non-enpty
stack.isNotEmpty;

Feel free to file feature requests and bug reports at the issue tracker.

0.1.0 #

Fixed format Improved description Added an example

0.0.2 #

Enhanced documentation

0.0.1 #

Initial version

example/main.dart

import 'package:stack/stack.dart';

void main() {
  Stack<String> stack = Stack<String>();
  stack.push('abc');
  stack.push('edf');
  print(stack.pop()); // prints 'edf'
  print(stack.top()); // prints 'abc'
  for (var i = 0; i < 10; i++) {
    stack.push(i.toString());
  }
  while (stack.isNotEmpty) {
    stack.pop();
  }
  print(stack.isEmpty); // prints true
}

Use this package as a library

1. Depend on it

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


dependencies:
  stack: ^0.1.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:stack/stack.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
43
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]
71
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

Format lib/stack.dart.

Run dartfmt to format lib/stack.dart.

Dependencies

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