Skip to main content
FileKit keeps successful results, user cancellation, operational failures, and programmer errors separate. New Compose integrations should use launcher overloads with an explicit onError callback.

Callback contract

FileKitPickerException is the picker-specific subtype of FileKitDialogException. FileKit does not convert invalid arguments, unsupported argument combinations, or unexpected defects into operational failures.

State-tracking picker modes

SingleWithState and MultipleWithState report progress and their represented terminal outcome through onResult:
  • Started and Progress are non-terminal values.
  • Exactly one of Completed, Cancelled, or Failed is the represented terminal value.
  • FileKitPickerState.Failed remains data delivered to onResult; it is not duplicated through onError.
  • A picker failure thrown outside the state stream is delivered to onError.
  • Coroutine cancellation stops delivery and produces no later terminal callback.

Sharing

Sharing has no success callback. A successful share launch, including user dismissal after the system share UI appears, remains callback-less. A FileKit-owned operational failure is delivered to onError; coroutine cancellation, invalid invocation, unexpected defects, and callback exceptions propagate.

Compatibility overloads

Launcher overloads without onError remain available for source and binary compatibility. They preserve their historical callback shape and ignore normalized operational failures without logging. They do not swallow coroutine cancellation, invalid invocation, unexpected defects, or exceptions thrown by your callbacks.