FLUTTER ECOSYSTEM

appsup-dart/sortedmap

키와 값의 양쪽 모두에서 정렬 및 필터링이 가능한 객체 맵

sortedmap 프로젝트 이미지
Stars
7
Forks
4
최근 푸시(UTC)
2026. 5. 30.
프로젝트 상태
활성
appsup-dart GitHub avatar
GITHUB Organization

appsup-dart ↗

언어Dart

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 5 개
  • test개발 의존성^1.16.5
  • benchmark_test개발 의존성^0.1.1+2
  • lints개발 의존성^6.0.0
  • quiver개발 의존성^3.0.0
  • melos개발 의존성^7.0.0

원본 README

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

README 펼치기 / 접기

Contains a SortedMap and FilteredMap class, which hold a map of objects that can be ordered relative to each other.

Unlike SplayTreeMap the objects can be ordered on both key and value or a combination of both.

The FilteredMap also allows to specify an isValid function on key/value pairs and limit the number of objects allowed in the map.

SortedMap

A simple usage example:

import 'package:sortedmap/sortedmap.dart';

main() {
  var map = new SortedMap(Ordering.byValue());
  
  map.addAll({
    "a": 3,
    "b": 2,
    "c": 4,
    "d": 1
  });
  
  print(map.lastKeyBefore("c")); // a
  print(map.firstKeyAfter("d")); // b
  
}

FilteredMap

A simple usage example:

import 'package:sortedmap/sortedmap.dart';

main() {
  var map = new FilteredMap(new Filter(
    compare: (Pair a, Pair b)=>Comparable.compare(a.value, b.value),
    isValid: (Pair v) => v.key!="b",
    limit: 2));
  
  map.addAll({
    "a": 3,
    "b": 2,
    "c": 4,
    "d": 1
  });
  
  print(map.keys); // (d, a)
  
}

Features and bugs

Please file feature requests and bugs at the issue tracker.