Orientação gerada a partir de informações públicas. Apenas para referência.
Flinq aprimora o tratamento de coleções no Dart com um conjunto de métodos de extensão intuitivos que reduzem o código repetitivo. Ele oferece atalhos convenientes para operações comuns como filtrar, mapear e transformar coleções, tornando o trabalho com listas e conjuntos mais conciso e legível. Projetado como uma utilidade leve, o Flinq se integra perfeitamente em projetos Dart existentes sem adicionar complexidade. Seu foco está em aumentar a produtividade do desenvolvedor ao simplificar manipulações repetitivas de coleções.
Casos de uso
Simplificando transformações de lista
Reduzindo código boilerplate no processamento de dados
Simplificação da lógica de filtragem e mapeamento
Melhorar a legibilidade do código
Melhorando operações de coleção com estilo funcional
Acelerando a prototipagem
Principais recursos
Métodos de extensão encadeáveis
sobrecarga mínima de sintaxe
Suporta todos os tipos principais de coleção
Sem dependências externas
Design de API limpo e funcional
Nomenclatura intuitiva de métodos
Indicado para
Desenvolvedores Dart procurando código de coleção mais limpo
Projetos que enfatizam a clareza do código
Padrões de programação funcional em Dart
Desenvolvimento rápido de aplicativos
Equipes que buscam reduzir código repetitivo
Considerações
Limitado à manipulação de coleção
Não adequado para gerenciamento de estado complexo
Requer conhecimento sobre extensões do Dart
Pode aumentar a curva de aprendizado para iniciantes
Melhor usado em conjunto com outras utilidades
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
flinq
Extended capabilities for collections.
It's a bunch of shortcuts to avoid unnecesary boilerplate work with collections.
Getting Started
This package will help you to reduce the amount of boilerplate code by adding folowing extensions for Iterables:
getter firstOrNull and method firstOrNullWhere for getting first value, and if it will not be found returns null
getter lastOrNull and method lastOrNullWhere for getting last value, and if it will not be found returns null
getter singleOrNull and method singleOrNullWhere for getting single value, and if it will not be found returns null, and if there will be too many elements it'll also return null
method mapList, which maps collection and casts it to List
method whereList, which filters collection and casts it to List
method mapWhereList, which maps collection, then filters it and then casts it to List
method whereMapList, which filters collection, then maps collection and then casts it to List
getter notNull for getting only not null values from the collection
method group and groupMap for grouping a collection
getter min/minOrNull and max/maxOrNull for getting minimal or maximal value from collection of Comparables
method minWhere/minOrNullWhere and maxWhere/maxOrNullWhere for getting minimal or maximal value from filtered collection of Comparables
getter sum and average for getting sum and average from collection of nums
method sumWhere and averageWhere for getting sum and average from filtered collection of nums
getter distinct and method distinctWhere which will return List with unique values in collection
method union and unionWhere which will return List with union of two collections with only unique values in resulting collection
method intersection and intersectionWhere which will return List with elements that contains both collections with only unique values in resulting collection
method difference and differenceWhere which will return List with difference between two collections with only unique values in resulting collection