Buscar pacotes, repositórios e categorias de apps

Repositório GitHubappsup-dart/sortedmap

sortedmap

Um mapa de objetos que pode ser ordenado e filtrado tanto pelas suas chaves quanto pelos seus valores

Capa do projeto sortedmap
Estrelas
7
Forks
4
Último push (UTC)
30 de mai. de 2026
Status do projeto
Ativo

README original

Texto original em inglês. Visite o GitHub para a versão atual.

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.

appsup-dart GitHub avatar
Autor no GitHub

appsup-dart ↗

LinguagensDart

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 5 itens

  • testDesenvolvimento^1.16.5
  • benchmark_testDesenvolvimento^0.1.1+2
  • lintsDesenvolvimento^6.0.0
  • quiverDesenvolvimento^3.0.0
  • melosDesenvolvimento^7.0.0

Como escolher um repositório para seu projeto?

Filtre pelo caso de uso, compare a atividade e confira o projeto original antes de adotá-lo.

  1. Busque por nome, autor ou descrição e filtre por tema.
  2. Compare estrelas, forks e envios recentes. Estrelas indicam interesse, mas não garantem qualidade.
  3. Confira o README, a licença e as issues no GitHub antes de usar o projeto.

Fontes e manutenção

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗