easy_api_provider 2.4.0
easy_api_provider: ^2.4.0 copied to clipboard
Flutter Dio API client with automatic state management, error handling, request logging, file downloads, and reactive UI widgets.
Changelog #
2.4.0 - 2026-08-17 #
Security #
requestLoggernow defaults tofalse— prevents Authorization tokens and response bodies from being logged in production builds (S2)- Added
assertonApiProviderConfig.authorizationto catch non-String values at development time (S1) - Narrowed
setAuthorisation()parameter fromdynamictoString?(S1)
Performance #
init()now calls_dio?.close(force: true)before creating a new Dio instance, preventing resource leaks on repeated initialisation (P1)- Fixed
listen()memory leak — callbacks are now stored in aMapand can be removed via the newunlisten()method; repeatedlisten()calls with the same callback are idempotent (P2) - Fixed crash when API response body is a
List,String, or binary blob —response.data['message']is now guarded with anis Mapcheck (P3) ApiProviderUinow skipssetStatewhen the controller status hasn't actually changed, eliminating redundant widget rebuilds (P4)
Added #
ApiProvider.create()factory for creating independent instances when multiple backends with different configs are needed concurrently (D1)ApiProviderController.unlisten()— pair tolisten()for removing callbacks without holding a closure reference (P2)ApiProviderController.dispose()override that clears all wrapped listeners on teardown (P2)
Fixed #
- Added
assert(savePath.isNotEmpty)todownload()and documented that the method is not supported on Web (D3) - Updated stale widget tests for
IdleWidgetandEmptyWidgetto match the output introduced in v2.3.0 (D2)
2.3.0 - 2026-08-17 #
Added #
- Library-level dartdoc comment for the
easy_api_providerexport file - Constructor-level doc comments on
ApiProviderControllerandApiProviderUifor 100% public API documentation coverage
Fixed #
- Default widgets (
IdleWidget,LoadingWidget,SuccessWidget,ApiErrorWidget,EmptyWidget) now have complete dartdoc comments EmptyWidgetdisplayed incorrect "Success" text — now correctly shows "Empty"IdleWidgetnow rendersSizedBox.shrink()instead of a visibleText('Idle')label- Made
SuccessWidgetandApiErrorWidgetbodiesconstfor better performance
2.2.0 - 2026-06-03 #
Added #
- Animated preview GIF showcasing the example application
- Preview section in README
2.1.0 - 2026-06-02 #
Added #
- Full example application demonstrating all package features (CRUD, download, interceptors, auth)
- SEO-friendly pub.dev metadata and documentation
Fixed #
- Static analysis issues resolved
- Removed unused local variables in config tests
Changed #
- Excluded coverage directory from published package
2.0.0 - 2026-06-02 #
Breaking Changes #
- Bumped minimum Dart SDK from
>=2.18.0to>=3.0.0(enables Dart 3 features)
Added #
- Comprehensive test suite: 42 unit/widget tests + integration test suite
AnimatedSwitcherfor smooth cross-fade transitions between UI states inApiProviderUi- Exhaustive
DioExceptionTypeerror handling covering all 8 cases (connectionTimeout, sendTimeout, receiveTimeout, badResponse, cancel, connectionError, badCertificate, unknown)
Fixed #
- Header overwrite bug:
init()no longer overwrites all headers including Authorization whenconfig.headersis provided - URL double-slash bug: request URLs are now correctly constructed without duplicate slashes
- Listener leak in
ApiProviderUi: properly removes listeners indispose()withmountedguard - Circular imports: all internal files now use direct
package:imports instead of barrel file imports
Changed #
- Refactored HTTP methods (
get,post,put,patch,delete,download) to use a shared_requesthelper, eliminating ~400 lines of duplicated try/catch logic - Default widgets (
IdleWidget,LoadingWidget, etc.) now includeValueKeyfor proper widget reconciliation