knock_flutter 1.0.0
knock_flutter: ^1.0.0 copied to clipboard
A client-side Flutter library to interact with user-facing Knock features, such as feeds.
1.0.0 #
Breaking #
- refactor: remove Pigeon and native plugin code (Android/iOS), convert to pure Dart package.
Push token retrieval is now the consumer's responsibility via
firebase_messagingor similar. - refactor: rename
ApiClienttoKnockApiClient,ApiResponsetoKnockApiResponse,ApiClientStatustoKnockApiClientStatus,ApiErrortoKnockApiException - refactor:
ApiErrorextendeddart:core'sError;KnockApiException implements Exception. This is both a rename and a semantic migration:try/catch/rethrow/Future.onErrorcode that depended onError/ApiErrorwill not behave the same unless updated toKnockApiException(or a broadExceptioncatch). - refactor:
Feed.initialState()now starts withNetworkStatus.initialinstead ofready, so UIs must not infer “already loaded successfully” solely fromNetworkStatusbefore the first HTTP response. Preferfeed.requestInFlight/ explicit handling forinitial,loading,fetchMore,error, andready. - chore: Dart SDK
>=3.8.0, Flutter>=3.32.0(seepubspec.yaml).
Added #
- feat: add
NetworkStatus.initialand use it fromFeed.initialState()before the first fetch - feat: add public
FeedClient.dispose()for deterministic resource cleanup (subscriptions, Phoenix listeners, event stream). Call when abandoning a feed (e.g. route dispose);knock.dispose()handles theKnockinstance broadly.
Fixed #
- fix: cache
PhoenixSocketinstance in socket getter (every access previously created a new connection) - fix: prevent
StateErrorcrash on closed_eventControllerinFeedClient - fix: trigger initial HTTP fetch in
onListenwithout relying onopenStreamBehaviorSubject replay - fix: close connected socket before dispose for clean WebSocket disconnect
- fix: close
_statusStreamControlleron dispose to prevent resource leak - fix: prevent channel join assertion crash (
!_joinedOnce) on quick unsubscribe/re-subscribe - fix: add defensive cancel before re-subscribing to channel messages
- fix: guard
_onNewMessageReceivedagainst post-disposal processing
Changed #
- chore: upgrade dependencies (freezed v3, phoenix_socket ^0.8.0, json_serializable ^6.13, SDK >=3.8.0)
- test: remove duplicate User tests from channel_test.dart
0.1.8 #
- fix: Replace deprecated
flutter_native_timezonewith maintainedflutter_timezonefork to resolve Android build failures - fix: Use
toLanguageTag()instead oftoString()for locale formatting to fix iOS 422 invalid_request_error (e.g.,it-ITinstead ofit_IT)
0.1.7 #
- feat: Update AppDelegate.swift to request push permissions
- feat(KNO-10078): replace tokens array with devices array containing token, locale, and timezone
0.1.6 #
- fix: Adding
ApiResponsetoApiErrorto provide more context
0.1.5 #
- fix: add
renderedproperty toTextContentBlock
0.1.4 #
- fix: ensure preferences can handle both conditions and channel types
0.1.3 #
- feat: add new ContentBlock types to FeedItem
0.1.2 #
- feat: add new methods for registering and deregistering channel data
0.1.1 #
- fix: Feed correctly observes new messages from the Knock API.
0.1.0 #
- Initial release of the Knock Flutter SDK.