FLUTTER ECOSYSTEM

ammaratef45/dart_stack

스택 데이터 구조용 Dart 패키지

dart_stack 프로젝트 이미지
Stars
18
Forks
13
최근 푸시(UTC)
2023. 12. 9.
프로젝트 상태
활성
Ammar GitHub avatar
GITHUB User

Ammar ↗

The internet has degraded, let's revive it somehow

언어Dart

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 1 개
  • test개발 의존성^1.16.8

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

dart_stack

A dart package for stack datastructure

pub 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;
// see if the stack has a certain object
stack.contains("abc");
// print the complete stack
stack.print();
// get size of current stack
stack.size() || var s = stack.size()

Exceptions

Trying to use top() or pop() on an empty stack throws IllegalOperationException. use size(), isEmpty, or isNotEmpty to check before using these operations.

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