Skip to main content

flutter_solo 1.0.0 copy "flutter_solo: ^1.0.0" to clipboard
flutter_solo: ^1.0.0 copied to clipboard

State management for Flutter: sequential jobs, exclusive state ownership, cooperative cancellation, rebuilds through SoloBuilder or ValueListenable.

1.0.0 #

This package re-exports solo and, through it, async_job, so their changes are its own: see the solo changelog and the async_job changelog.

Breaking changes #

  • ctx.wait of async_job, deprecated in favour of ctx.abandonable in 0.3.0, is removed.
  • Policy.replace of solo is renamed Policy.keepLatest.
  • HandlerCancelReason of async_job is renamed BodyCancelReason, and its name is body instead of handler.
  • SoloContext.each of solo returns SoloJob<void>, as SoloContext.child does.

Documentation #

  • The README says what each kind of change comes in from 1.0.0 on: a fix in a patch release, an addition in a minor one, a break in a major one.
  • The README names the analyzer plugin solo_lints in Install, and says to run dart analyze for it: from Flutter 3.44 on, flutter analyze shows none of its diagnostics.
  • The README says that a new value of an enum or a new subclass of a sealed class comes in a major release, and that on close() a running job made with cancellable: false runs to its end while a queued one is dropped.
  • The mixins page says that an await for over the stream holds close() with SoloStream, with SoloListenable or without it.

0.6.0 #

Breaking changes #

  • Flutter 3.38.1 with Dart 3.10.0 is the lowest SDK the package supports, up from Flutter 3.27.0 with Dart 3.6.0.

Documentation #

  • The README names the errors load expects, and the button no longer calls ignoreFailure().

0.5.0 #

This package re-exports solo and, through it, async_job, so their changes are its own: see the solo changelog and the async_job changelog.

0.4.0 #

This package re-exports solo and, through it, async_job, so their changes are its own: see the solo changelog and the async_job changelog.

0.3.0 #

This package re-exports solo and, through it, async_job, so their changes are its own: see the solo changelog and the async_job changelog.

Breaking changes #

  • Solo.onError is a notice in solo, and the new Solo.onUnanswered answers for an error nobody else has: one no outcome carries, and a Failed nobody observes. Setting Solo.observer, or overriding onError without calling super, no longer keeps such an error out of the zone: see the same entry of the solo changelog.
  • Job.ignore() is renamed to Job.ignoreFailure() in async_job.
  • In solo, Solo.run is renamed to enqueue, and Solo.add to enqueueJob. See the same entry of the solo changelog.
  • The state handlers of enqueue and job are renamed in solo: onError to ifFailed, onCancel to ifCancelled.
  • ctx.run and ctx.runAll take a ChildJob in async_job, and solo's SoloJob is one: a helper that returns job(...) for ctx.run is declared SoloJob<T>, not Job<T>.
  • SoloListenable is a mixin on Solo, the way solo's SoloStream is: extends SoloListenable<S> becomes extends Solo<S> with SoloListenable. See The controller as a ValueListenable.
  • SoloListenable no longer carries a stream. A controller whose stream somebody reads mixes in both, with SoloStream, SoloListenable. See A controller with both deliveries.
  • In solo, the controller's synchronous read is currentState, not state.
  • ValueListenable is no longer re-exported. A file that names the type imports package:flutter/foundation.dart.
  • close takes solo's new SoloCloseMode.
  • publish is no longer a public member of a controller with SoloListenable.
  • The listeners are dropped when the engine finishes closing, right after the observer's onClose and the controller's own. Write the last state synchronously, in the controller's onClose.

Deprecated #

  • ctx.wait in async_job is deprecated in favour of ctx.abandonable and goes away in the next release.

Changes you will see on upgrade #

  • A listener that throws is reported through FlutterError.reportError, the way ChangeNotifier reports one, and no longer throws out of the emit or the externalSetState that made the change: the job whose emit it was ends Done where it used to end Failed.
  • Errors that 0.2.0 kept to the hooks reach Solo.unansweredHandler or the zone: see the same heading of the solo changelog.

Added #

  • SoloBuilder: what ValueListenableBuilder is, for a controller that is not a ValueListenable. See Usage.
  • SoloSelection<S, T>: a ValueListenable of one value picked out of another, notifying only when that value changes. For a controller that is not a ValueListenable, SoloSelection.from makes one. See Selecting one value.
  • SoloSelector, the widget that picks for you: a controller, a selector and a builder.
  • select and listen as methods, with SoloSubscription and SoloSubscriptions, in an import of their own, package:flutter_solo/listenable.dart. See Listening without keeping the callback and Methods from a second import.

Fixed #

  • A listener that throws no longer cuts off the listeners behind it, and no longer lets a job go on running against a state its keepWhile forbids.
  • A listener added after the controller had finished closing is ignored: it is neither registered nor kept, and nothing is thrown. It used to be kept in memory for good.
  • One pass of notifying is linear in the number of listeners; it was quadratic.

Documentation #

  • The README's examples compile, and the page gained the sections on the controller as a ValueListenable, on selections and on listen.
  • The package has guides of its own, Mixins and Testing.
  • The example no longer sticks on a failed load.

0.2.0 #

The first published release. 0.1.0 never left the tree.

  • SoloListenable<S>: a Solo<S> that is also a ValueListenable<S>, for ValueListenableBuilder, ListenableBuilder, AnimatedBuilder and Listenable.merge. Listeners are called synchronously, in subscription order, on every state change; the stream of Solo still works and arrives a microtask later.
  • Read-only on purpose: value and state are the same object, and there is no setter — the state belongs to the jobs.
  • close() cancels what is running, drops every listener and stops notifying for good; nothing else closes the controller for you.
  • Re-exports package:solo/solo.dart, which re-exports package:async_job/async_job.dart, so flutter_solo is the only dependency an app adds and the only import it writes.
  • Floor: solo: ^0.2.0, whose job kernel is async_job: ^0.2.0 with synchronous job.whenCancelled(callback) registration.

0.1.0 #

Never published.

0
likes
160
points
993
downloads

Documentation

API reference

Publisher

verified publisheryet-another.dev

Weekly Downloads

State management for Flutter: sequential jobs, exclusive state ownership, cooperative cancellation, rebuilds through SoloBuilder or ValueListenable.

Repository (GitHub)
View/report issues

Topics

#state-management #async #cancellation #concurrency

License

BSD-3-Clause (license)

Dependencies

flutter, solo

More

Packages that depend on flutter_solo