flutter_solo 2.0.1
flutter_solo: ^2.0.1 copied to clipboard
State management for Flutter: sequential jobs over one state, in one queue or in each of several lanes, cooperative cancellation, rebuilds through SoloBuilder or ValueListenable.
2.0.1 #
Documentation #
- The README asks for
solo_lints: ^0.3.0, which brings the warninglane_outside_constructorand the lintstale_emitfor the lanes ofSoloLanes.
2.0.0 #
This package re-exports solo, and this release comes with solo 2.0.0:
SoloLanes, a controller with several queues over one state, and the base
SoloController arrive with the same import. See
the solo changelog
for what they bring and what breaks there.
Breaking changes #
- The field
soloofSoloBuilder,SoloSelectorandSoloListener, and the controllerSoloSelection.fromtakes, are aSoloController<S>instead of aSolo<S>. ASologoes there as before, and so does aSoloLanes; what breaks is code that readsbuilder.solointo a variable of typeSolo<S>. SoloListenableis a mixin onSoloController, no longer a subtype ofSolo. It mixes into aSoloLanesas well, and a value of typeSoloListenabledoes not go where aSolois expected.
Documentation #
- The README says that the root jobs of a
Solorun one at a time, and so do those of each lane of aSoloLanes, and lists both withSoloControlleramong what arrives with the import. pubspec.yamland the dartdoc of the library say the same in place of exclusive ownership.doc/mixins.mdadds "A base for both kinds": the shared base as a mixin onSoloController, for aSoloand aSoloLanesalike, and the order ofwiththat decides whether its report of a listener's failure runs.- A new guide, A device app: a camera app on the
cameraplugin, with its code in the repository, a section for each situation of the phone, tests, and the same screen on bloc.
1.1.0 #
Added #
SoloListener, a widget that runs a reaction, a job of the core, on every change of a controller thatlistenWhenlets through, with the state of that change, andSoloListenerMode, what a change does while an earlier reaction runs:concurrent,sequential,droppable,keepLatestorrestart. Leaving the tree, or a new controller, cancels the reactions, and a failure goes toFlutterError. The README takes it apart in "Reacting to a change" and "A reaction the next change replaces".solo1.1.0 is required, forSolo.addChangeListener.
Documentation #
- The README asks for
solo_lints: ^0.2.0, which brings the warningsdiscarded_outcomeandoutcome_after_awaiton the outcome of a job. pubspec.yamlnames the documentation site, and pub.dev links to it.
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.waitofasync_job, deprecated in favour ofctx.abandonablein 0.3.0, is removed.Policy.replaceofsolois renamedPolicy.keepLatest.HandlerCancelReasonofasync_jobis renamedBodyCancelReason, and itsnameisbodyinstead ofhandler.SoloContext.eachofsoloreturnsSoloJob<void>, asSoloContext.childdoes.
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_lintsinInstall, and says to rundart analyzefor it: from Flutter 3.44 on,flutter analyzeshows 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 withcancellable: falseruns to its end while a queued one is dropped. - The mixins page says that an
await forover thestreamholdsclose()withSoloStream, withSoloListenableor without it.
0.6.0 #
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.onErroris a notice insolo, and the newSolo.onUnansweredanswers for an error nobody else has: one no outcome carries, and aFailednobody observes. SettingSolo.observer, or overridingonErrorwithout callingsuper, no longer keeps such an error out of the zone: see the same entry of thesolochangelog.Job.ignore()is renamed toJob.ignoreFailure()inasync_job.- In
solo,Solo.runis renamed toenqueue, andSolo.addtoenqueueJob. See the same entry of thesolochangelog. - The state handlers of
enqueueandjobare renamed insolo:onErrortoifFailed,onCanceltoifCancelled. ctx.runandctx.runAlltake aChildJobinasync_job, andsolo'sSoloJobis one: a helper that returnsjob(...)forctx.runis declaredSoloJob<T>, notJob<T>.SoloListenableis a mixin onSolo, the waysolo'sSoloStreamis:extends SoloListenable<S>becomesextends Solo<S> with SoloListenable. See The controller as aValueListenable.SoloListenableno longer carries a stream. A controller whosestreamsomebody reads mixes in both,with SoloStream, SoloListenable. See A controller with both deliveries.- In
solo, the controller's synchronous read iscurrentState, notstate. ValueListenableis no longer re-exported. A file that names the type importspackage:flutter/foundation.dart.closetakessolo's newSoloCloseMode.publishis no longer a public member of a controller withSoloListenable.- The listeners are dropped when the engine finishes closing, right after the
observer's
onCloseand the controller's own. Write the last state synchronously, in the controller'sonClose.
Deprecated #
ctx.waitinasync_jobis deprecated in favour ofctx.abandonableand goes away in the next release.
Changes you will see on upgrade #
- A listener that throws is reported through
FlutterError.reportError, the wayChangeNotifierreports one, and no longer throws out of theemitor theexternalSetStatethat made the change: the job whoseemitit was endsDonewhere it used to endFailed. - Errors that
0.2.0kept to the hooks reachSolo.unansweredHandleror the zone: see the same heading of thesolochangelog.
Added #
SoloBuilder: whatValueListenableBuilderis, for a controller that is not aValueListenable. See Usage.SoloSelection<S, T>: aValueListenableof one value picked out of another, notifying only when that value changes. For a controller that is not aValueListenable,SoloSelection.frommakes one. See Selecting one value.SoloSelector, the widget that picks for you: a controller, aselectorand abuilder.selectandlistenas methods, withSoloSubscriptionandSoloSubscriptions, 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
keepWhileforbids. - 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 #
0.2.0 #
The first published release. 0.1.0 never left the tree.
SoloListenable<S>: aSolo<S>that is also aValueListenable<S>, forValueListenableBuilder,ListenableBuilder,AnimatedBuilderandListenable.merge. Listeners are called synchronously, in subscription order, on every state change; thestreamofSolostill works and arrives a microtask later.- Read-only on purpose:
valueandstateare 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-exportspackage:async_job/async_job.dart, soflutter_solois the only dependency an app adds and the only import it writes. - Floor:
solo: ^0.2.0, whose job kernel isasync_job: ^0.2.0with synchronousjob.whenCancelled(callback)registration.
0.1.0 #
Never published.