FxDart 101
Um curso prático. Cada aula é uma explicação curta com demos ao vivo e um playground — o código compila com o compilador Dart de verdade e roda no seu navegador. Percorra as seções em ordem ou pule para qualquer função abaixo.
fx →
map →
filter →
take →
toList,
e então
concurrent.
Trabalhos:
busca com debounce
·
fetch concorrente limitado.
📖 Teoria da programação funcional — o livro-texto por trás do curso →
📒 Veja em ação: Daily Ledger — um app completo feito com FxDart →
Seção 1 · Primeiros passos
O modelo de pipeline: construa de forma preguiçosa, execute com um operador terminal.
Seção 2 · Gerando sequências
Fontes a partir das quais você pode encadear.
Seção 3 · Transformando
Remodele cada elemento — de forma preguiçosa.
Seção 4 · Filtragem & deduplicação
Mantenha só o que você precisa.
- where
- whereNot
- nonNulls
- distinct
- distinctBy
- uniqStrict
- uniqAdjacent
- takeUniqBy
- difference
- differenceBy
- intersection
- intersectionBy
- compress
Seção 5 · Fatiamento
Janelas, prefixos, sufixos e blocos.
- take
- takeLast
- takeWhile
- takeWhileRight
- takeUntilInclusive
- skip
- dropRight
- skipWhile
- dropWhileRight
- dropUntil
- slice
- chunk
- windowed
- pairwise
- split
Seção 6 · Combinando
Várias sequências na entrada, uma na saída.
- append
- prepend
- concat
- zip
- zip3
- zipWith
- indexed
- …WithIndex (map, filter, fold)
- transpose
- reverse
- fork
- tee
- tee3
- ifEmpty
Seção 7 · Agregando
Operadores terminais que puxam o pipeline e produzem um valor.
- reduce
- fold
- foldRight
- reduceLazy
- sum
- sumBy
- average
- averageBy
- min
- max
- maxBy
- minBy
- count
- join
- groupBy
- groupedBy
- indexBy
- countBy
- foldBy
- foldByOrSkip
- countWhere
- sort
- sortBy
- sortByDesc
- partition
Seção 8 · Acesso & predicados
Obtenha valores individuais e teste elementos.
- firstOrNull
- lastOrNull
- elementAtOrNull
- firstWhereOrNull
- indexWhere
- contains
- isEmpty
- every
- any
- predicates (isNull, isString, …)
Seção 9 · Funções de objeto (Map)
Utilitários de objeto do FxTS, portados para Maps do Dart.
- fromEntries
- omit
- pick
- omitBy
- pickBy
- prop
- props
- mapValues
- evolve
- compactObject
- resolveProps
- isMatch
- matches
Seção 10 · Utilitários de função
Combinadores e auxiliares.
- identity
- always
- tap
- apply
- juxt
- fxPipe
- memoize
- negate
- not
- predicate combinators
- when
- unless
- throwError
- throwIf
- cases
- add
- gt · gte · lt · lte
- delay & sleep
- unicodeToList
- curried & uncurried
Seção 11 · Async & concorrência
O modelo FxAsyncIterable — o superpoder do FxDart.
- toAsync
- async variants (mapAsync, …)
- Stream bridges
- concurrent
- mapConcurrent
- concurrentPool
- retry
- timeout
- using
- concurrent or parallel
- parallel
Seção 12 · Util
Rate limiting e aleatoriedade.
Seção 13 · Typed errors
The Kotlin Arrow approach, ported: either, Raise, bind, ensure, error accumulation with Nel, and pipeline-fused validation. Straight-line code, typed failures, no wrapper tower.
- typed errors — full guide
- Either
- Either combinators
- either & Raise scope
- nullable
- NonEmptyList (Nel)
- accumulation (zipOrAccumulate, …)
- Either × pipelines
Seção 14 · Event streams (push)
FxDart's push side — Rx-style operators over plain Dart Streams, bridging into the pull pipelines.
- fxEvents
- constructors
- peek · whenComplete
- sampleOn
- combineLatest
- withLatestFrom
- switchMap
- mergeMap
- switchLatest
- mergeScan
- race
- waitAll
- combine
- stopOn
- chunkOn
- windowOn
- groupsBy
- spaceBy
- debounceOn
- retryOn
- onErrorResume
- attempt
- mapEither
- separated
- share
- shareReplay
- LiveValue
- FxSubscriptions
- materialize
Seção 15 · Jobs
Cross-surface programs — the reason to import one package rather than three.