giphy_flutter 0.1.0
giphy_flutter: ^0.1.0 copied to clipboard
A production-ready Flutter SDK and UI package for GIPHY integration.
0.1.0 #
First release with a stable public API. Everything below is relative to 0.0.1,
which was never functional as a consumer-facing package.
Breaking changes #
GiphyPaginationController's unnamed constructor now takes aGiphyRepository(GiphyPaginationController(repository: ...)). The previous use-case form moved toGiphyPaginationController.fromUseCases(...), and all four use cases there are now required rather than nullable — a missing one used to fail at runtime when the user switched content type.GiphyBottomSheet'stype:parameter is nowinitialType:, matching the fact that it only seeds the initial value.ratingis aGiphyRatingenum everywhere; theStringform is gone.GiphyRepositoryandGiphyRemoteDataSourcegainedclose(). Custom implementations must add it.GiphyServiceLocator.getDependencies()is gone — it handed out a graph without recording a holder, which defeated the reference counting that now bounds the HTTP client's lifetime. Useacquire(apiKey)and pair it withrelease(apiKey).GiphyDependenciesno longer exposesremoteDataSource, and its generative constructor is private. Build one withGiphyDependencies.fromRepository(...)orGiphyDependencies.forApiKey(...).- Dropped
providerandflutter_hooksas dependencies. The sheet is a plainStatefulWidgetand the controller a plainChangeNotifier, so the package no longer imposes a state-management choice. - Removed
json_serializable/build_runner; JSON mapping is hand-written andgiphy_models.g.dartis deleted. No codegen step is needed to build the package. - Minimum SDK raised to Dart 3.4 / Flutter 3.22.
Fixed #
- Searches were silently dropped.
loadMorebailed out whenever a request was in flight, so typing a new query — or switching between GIFs and stickers — while the first page was loading did nothing. Worse, the stale response then appended into the freshly cleared list. Requests now carry a generation stamp; a superseded response is discarded and the newest intent always wins. - Cancellations were detected by matching on an error message string, so any
reworded message would have surfaced a cancellation as a real error. There is
now a
GiphyCancelledException, and it is never reported throughcontroller.error. - JSON decoding happened outside the data source's
try, so a malformed payload escaped theGiphyExceptionhierarchy as a rawTypeError. Parsing is now inside, and failures arrive asGiphyParseExceptionnaming the endpoint. - GIPHY omits renditions on some assets; requiring
preview_gifandfixed_heightmeant a single unusual GIF failed the whole page. Parsing falls back through alternative renditions, sooriginal,fixedHeightandprevieware always populated. meta.statuserrors, which GIPHY returns with HTTP 200, were treated as success.toJson()returned nested model objects rather than maps, so encoding a GIF threw. Encoding is now deep and round-trips.- No Dio timeouts were configured, so a stalled connection hung forever. Now 10s connect / 20s receive, both overridable.
- The service locator cached a
Dioper API key and never released one, leaking a connection pool per key for the process lifetime. It is now reference counted:acquire/release, closing the client when the last holder leaves. - The search debounce timer was not cancelled on dispose, firing a request into a torn-down controller.
- The attribution footer was hardcoded white and therefore invisible on
GiphyTheme.light. It is now themed viaattributionStyle. controller.gifshanded out the internal mutable list.- Paging past GIPHY's offset ceiling of 4999 produced an API error instead of
stopping;
GiphyPagination.hasMorenow accounts for it. limitis clamped to GIPHY's maximum of 50 instead of being sent verbatim.- Removed a
DiointerceptoronErrorhandler that could not run, since the data source already converted errors before it was reached.
Added #
GiphyRepositoryImpl.withApiKey(apiKey)— previously there was no way for a consumer to construct the repository, because the data source was not exported. The public barrel now exports the data, domain and presentation layers.GiphyLabelsfor localising every string in the sheet.GiphyServiceLocator.register(apiKey, dependencies), so a caller can route the package's widgets —GiphyBottomSheetincluded — through a repository they configured themselves, or through a fake in tests.cachedKeyCountandholderCount(apiKey)expose the cache's state for diagnostics.GiphyBottomSheetparameters:pageSize,searchDebounce,heightFactor,labels, anduseSafeAreaonopen.GiphyTheme.copyWith, value equality, and anerrorColor.- Semantics labels on grid tiles and the type selector.
- Thumbnails decode at a bounded width, cutting memory use on grids of large GIFs.
///documentation on every public member, withpublic_member_api_docsenabled.
0.0.1 #
- Initial scaffold.