comment/ck_comment_sheet
library
Classes
-
A generic, recursively-nested comment/reply list with built-in
expand/collapse-replies state, connector-line drawing, and pagination —
built on top of CkListView for the outer scroll/refresh/load-more
mechanics.
Typedefs
-
CkAvatarSizeForDepth
= double Function(int depth)
-
Returns the avatar size to use at a given nesting
depth (0 = top level).
-
Builds the avatar for
item. Fully self-contained, including its own
tap handling (e.g. navigating to a profile screen) if any.
-
Builds everything for
item except the avatar, reaction row and reply
action (those are separate builders below) — typically the name/header
row, the comment text and any attached media.
-
Builds the reaction control(s) for
item (e.g. a like/reaction stack).
-
Builds the "reply" affordance for
item. expandReplies is supplied by
the sheet — call it from your widget's tap handler (in addition to any
app-specific logic, like focusing a composer) to reveal item's replies.
-
Builds the composer's toolbar (e.g. a type dropdown, media pickers, an AI
writer button) — everything except the send button, which the sheet
places according to CkSendButtonPosition.
controller is the sheet's
own composer text controller, so app-specific widgets (like an AI writer)
can read/write the same text.
-
Returns a stable, unique identifier for
item. Used as the key for the
internal expand/collapse state, so it must not depend on object identity
(the same logical item may be represented by a new instance after a
refetch).
-
Returns the direct replies/children of
item. Called recursively, so
replies can themselves have replies — depth is not limited to 2 levels.