fetcher 5.3.0
fetcher: ^5.3.0 copied to clipboard
Flutter package to Fetch and display asynchronous data easily
5.3.0 #
- New
EditingValueBuilderwidget (inextra.dart), that recreates its subtree on each new value, except while an element is being edited in it: the displayed value is then kept, and updated to the latest one when editing ends. Usually used to display live data (e.g. a database stream) without losing user input in a form. - New
EditingScopewidget (inextra.dart), base ofEditingValueBuilder, that tracks elements being edited in its subtree.GuardedForm(and soSubmitFormBuilder) automatically registers to the closestEditingScopewhen changed, until saved or disposed. Other elements may be registered manually. Nested scopes are supported. - New
GuardedForm.markAsSaved, to allow pop again after changes have been saved. Automatically called bySubmitFormBuilderon success. - Fix
SubmitFormBuilderstill asking confirmation on pop after a successful submission, when the page stays open.
5.2.0 #
- Minimum required Flutter is now
3.41.0(Dart3.11.0). - New
fadeSizeparameter onFetcherConfig(also available onFetcherConfig.silent), to also animate the height during the fade transition, so that the widget smoothly grows or shrinks when its content changes size (e.g. from a silent loader to the loaded content).fadeAlignmentdefines how the content is anchored during the transition. Defaults tofalse(previous behavior).
5.1.0 #
- New
FetchBuilder.snapshotconstructor, taking a singlesnapshotBuilderthat receives anAsyncSnapshot(likeFutureBuilder), to handle loading and error states yourself instead of using the loader and error widget from the config (e.g. a button that stays displayed but disabled until data is available). No fade transition is applied.
5.0.0 #
- BREAKING:
FetcherConfig.fadeOnDataChangenow defaults tofalse: data updates rebuild the child in-place, preserving its state (scroll position, text fields, animations, platform views, etc.), instead of fading and recreating it. Transitions between fetch states (loading, error, data) still fade. SetfadeOnDataChange: trueto restore the previous behavior. Beware of state derived from data, which is now kept across data updates (e.g.refresh()withoutclearDataFirst, newEventFetchBuilderevent): fields initialized from the data ininitState(orlatefields),initialValueof form fields, or unkeyed stateful children in a list (state would be associated to the wrong item when items are inserted/removed). Either handle updates indidUpdateWidget, add keys (e.g.ValueKey(item.id)), or setfadeOnDataChange: true. - New
fadeAlignmentparameter onFetcherConfig, to control how outgoing and incoming children are aligned during the fade transition (e.g. when the loader and the content have different sizes). Defaults toAlignment.topLeft(previous behavior). - BREAKING: new
submittingBuilderparameter onFetcherConfig, to customize the loader displayed on the barrier bySubmitBuilderandSubmitFormBuilder, independently of thefetchingBuilder(which is often a placeholder of the content).SubmitBuilderandSubmitFormBuilderdon't usefetchingBuilderanymore: if you customizedfetchingBuilderin yourDefaultFetcherConfig(or in aSubmitBuilder.config), also setsubmittingBuilder. - BREAKING:
AsyncEditBuilder.fetchingBuilderwas removed. Useconfig: FetcherConfig(fetchingBuilder: ...)instead (same behavior). UseFetcherConfig.submittingBuilderto customize the submitting widget. - BREAKING:
validateForm'sonSuccessparameter was renamed toonValidated, to avoid confusion with the taskonSuccessofSubmitBuilder.validateFormnow also returns whether the form is valid, likeFormState.validate. - Fix config changes being ignored by already built widgets:
FetchBuilderandSubmitBuilderused to freeze their config (bothDefaultFetcherConfigandconfigparameter) on first build. All widgets now rebuild when the enclosingDefaultFetcherConfigchanges. - Fix
SubmitBuilder.runTasknot callingFetcherConfig.onErrorfromDefaultFetcherConfigwhen the context is unmounted before the task ends: config is now resolved before running the task. - BREAKING:
DefaultFetcherConfig.ofnow registers a dependency on the enclosingDefaultFetcherConfigby default (so that widgets rebuild on change), so it can't be called frominitStateanymore. Use the newlisten: falseparameter to read it outside of the build phase (e.g. ininitStateor in callbacks). - BREAKING: nested
DefaultFetcherConfigs are now merged: aDefaultFetcherConfignow only overrides the non-null fields of the closestDefaultFetcherConfigancestor, instead of resetting all other fields to the library defaults. - BREAKING:
FetcherConfig.applywas renamed tomerge(same behavior, likeTextStyle.merge). - BREAKING:
FetcherConfig.defaultConfigis nowfinal. Use aDefaultFetcherConfigat the root of your app to customize the global config. - BREAKING:
DefaultFetcherConfig.defaultConfigwas removed, useFetcherConfig.defaultConfiginstead. - BREAKING:
FadedAnimatedSwitcheris no longer exported byextra.dart, and itssizeAnimationparameter was removed. - Fix
PagedListViewFetcherthrowing "setState() or markNeedsBuild() called during build" whentaskreturns synchronously for next pages.
4.6.1 #
- Fix "Duplicate keys found" crash when fetch states change rapidly during a fade transition (e.g. repeated
refresh(clearDataFirst: true)calls), onFetchBuilder,EventFetchBuilder,SubmitBuilderandActivityBarrier.
4.6.0 #
- Minimum required Dart SDK is now
3.4.0. task(onFetchBuilder,FetchBuilderWithParameterandPagedListViewFetcher) now acceptsFutureOr<T>instead ofFuture<T>: return the value directly, instead of wrapping it in aFuture, when it's already known synchronously (e.g. from a cache), to skip the loading indicator entirely. SeeFetchBuilderdoc for an example.
4.5.0 #
- New
fadeOnDataChangeparameter onFetcherConfig. When set tofalse, data updates rebuild the child widget in-place (preserving subtree state) instead of triggering a fade transition. Transitions between fetch states (loading, error, data) still animate naturally. Useful when the builder returns a stateful widget that must survive data changes. Defaults totruefor backward compatibility. - Fix
PagedListViewFetcher.refresh()reloading the wrong page: now refresh always reloads from the first page. - New
physicsparameter onPagedListViewFetcher, forwarded to the internalListView. UseAlwaysScrollableScrollPhysicsto enable pull-to-refresh even when the list doesn't fill the screen.
4.4.0 #
- New
scrollToFirstInvalidFieldfeature onSubmitFormBuilder: automatically scrolls to the first invalid field when form validation fails. Disabled by default.
4.3.1 #
- Migrate
value_streamtovalue_stream_flutter.
4.3.0 #
- New
isMountedgetter on controllers, to safely callrefresh. - New
onFetchSuccessparameter on config, global fetch success interceptor.
4.2.2 #
- Fix popping behavior when using
alwaysAllowFormPopCallbackonSubmitFormBuilder. - Rename
alwaysAllowFormPopCallbacktoignoreFormPopCallbackand review doc to be more clear.
4.2.1 #
- Expose
onChangedparameter onGuardedFormandSubmitFormBuilder.
4.2.0 #
- New feature to prevent a form to pop with unsaved changes when using
SubmitFormBuilder. Introduce newGuardedFormwidget, along with newonUnsavedFormPopparameter inFetcherConfigandSubmitFormBuilder.
4.1.1 #
- Fix unnecessary rebuild when using
EventFetchBuilder.
4.1.0 #
- New
FetchRefresherwidget, that allows to refresh allFetchBuilderchildren using Material "swipe to refresh" idiom. - Fix
FetchBuilder.controllerupdate when widget parameter changes.
4.0.0 #
- BREAKING: replace
FetchBuilder.basicconstructor to simplyFetchBuilder. - BREAKING: replace
FetchBuilder.parameterizedconstructor toFetchBuilderWithParameter. - BREAKING: rename
BasicFetchBuilderControllerto simplyFetchBuilderController. - BREAKING: rename
ParameterizedFetchBuilderControllerto simplyFetchBuilderWithParameterController. - BREAKING: remove obsolete
clearFocus2method. - BREAKING: For
FetchBuilder,FetcherConfig.fetchErrorBuilder.errorData.erroris now directly the thrown error object, instead of a uselessFetchException(which is now hidden). - BREAKING: remove
FetchBuilder.getFromCacheandFetchBuilder.saveToCache: cache handling should be done at the BLoC level. - Fix when
FetchBuilder.onSuccessthrows an error: it's now handled like ifFetchBuilder.taskthrows (before that fix, it would be stuck in loading state). - Export
ActivityBarrierwidget
3.1.0 #
- Add NewsReaderPage example
- Add BLoC pattern components, so fetcher can be use with BLoC pattern without any additional dependency.
3.0.0 #
- BREAKING: rename
AsyncTaskBuildertoSubmitBuilder. - BREAKING: rename
AsyncFormtoSubmitFormBuilder. - BREAKING: rename
AsyncEditBuilder.commitTasktoAsyncEditBuilder.submitTask. - BREAKING: all
onSuccesscallbacks are now synchronous. - BREAKING: remove
FetcherConfig.fadeparameter. UseFetcherConfig.fadeDurationinstead. - BREAKING: a bit of other renaming & export cleaning.
- New
FetcherConfig.silentconfig for cases where loader & error should not be displayed. - Fix fade animation not working properly.
2.0.1 #
- BREAKING: rename
FetcherConfigErrorDatatoFetchErrorData. - Fix
FetchErrorDataexport.
2.0.0 #
- BREAKING:
fetchErrorBuildernow passes error object to the builder, so error can be used in widget.
1.0.0 #
- BREAKING:
AsyncFormis now generic and handles a parameter of typeTto be passed on. - Add new
AsyncFormPagein the example app.
0.6.2 #
- Replace
findAncestorWidgetOfExactTypebygetInheritedWidgetOfExactTypefor better performance - Fix
AsyncTaskBuilder.runTaskcatch bloc throwing because of unmounted context
0.6.1 #
- Fix ActivityBarrier reverse animation
0.6.0 #
- BREAKING: New
FetchBuildererror display handling usingFetchErrorDisplayMode - BREAKING: Remove
ConnectivityException&UnreportedException - BREAKING: Rename
FetchBuilder.errorBuildertoFetchBuilder.fetchErrorBuilder
0.5.1 #
- Properly handle when
FetchBuilder.saveToCachethrows
0.5.0 #
- Add
barrierColorparameter toAsyncTaskBuilder
0.4.1 #
- Fix
FetchBuildererror that may occur when task throws when state is unmounted
0.4.0 #
- BREAKING:
EventFetchBuilder.fromEventconstructor is replaced by default constructor EventFetchBuildernow internally useEventStreamBuilder, which allow to properly handle initial error
0.3.0 #
- New
PagedListViewFetcherwidget, that fetches a paginated list of data, page by page
0.2.0 #
- Add
AsyncEditBuilder.fetchingBuilderparameter, to customize the fetching widget independently from the committing widget
0.1.0 #
- Add
AsyncTaskBuilder.runTaskOnStartparameter
0.0.11 #
- Fix
AsyncEditBuilder.onEditSuccessnot called
0.0.10 #
- Update to
value_stream0.0.4
0.0.9 #
- Fix
AsyncEditBuilderto correctly pass config
0.0.8 #
- Parameter retry of
FetcherConfig.errorBuilderis now optional, to correctly handleEventFetchBuilderstream errors
0.0.7 #
- Fix
EventFetchBuilderwhen using stream with null values
0.0.6 #
- Add
FetchBuilder.initBuilderparam (to be used withfetchAtInitfalse) - New static
AsyncTaskBuilder.runTaskmethod that allows to run headless task safely - New
AsyncEditBuilder
0.0.5 #
- Default
FetchBuilderErrorWidgetnow handlesisDenseparameter - New
EventFetchBuilderwidget - Move
isDenseand fade insideFetcherConfig - Expose
ClearFocusBackground - Rename
reportErrortoonErrorANDshowErrortoonDisplayError
0.0.4 #
- Replace
rxdartdependency byvalue_stream - Remove
ValueStreamBuilder(useEventStreamBuilderfromvalue_stream)
0.0.3 #
- New
AsyncFormwidget - Code clean-up
0.0.1-dev1 #
- Initial dev version