AppChatMessageList class final
Lista rolável de mensagens — o "chão" da conversa.
Encapsula três comportamentos chatos de acertar à mão: (1) gruda no fim (quando há poucas mensagens, elas ficam ancoradas na base, não no topo); (2) auto-scroll para o fim quando chega mensagem nova; (3) espaçamento uniforme entre os itens.
É agnóstica de domínio: não agrupa por autor nem insere divisores de dia
(não conhece as mensagens). O consumidor expressa isso no itemBuilder —
escolhendo, item a item, uma AppChatBubble (com tail/agrupamento) ou um
AppChatDayDivider.
AppChatMessageList(
itemCount: messages.length,
itemBuilder: (context, i) => _buildRow(messages[i]),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- AppChatMessageList
Constructors
- AppChatMessageList({required int itemCount, required IndexedWidgetBuilder itemBuilder, ScrollController? controller, double spacing = AppSpacings.s16, EdgeInsetsGeometry padding = EdgeInsets.zero, bool stickToBottom = true, bool autoScroll = true, Key? key})
-
Cria uma AppChatMessageList.
const
Properties
- autoScroll → bool
-
Se rola para o fim ao aumentar itemCount.
final
- controller → ScrollController?
-
Controlador de scroll externo (opcional).
null= a lista cria o seu.final - hashCode → int
-
The hash code for this object.
no setterinherited
- itemBuilder → IndexedWidgetBuilder
-
Constrói o item de índice
i(uma bolha, divisor, etc.).final - itemCount → int
-
Quantidade de itens.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- padding → EdgeInsetsGeometry
-
Espaço em volta do conteúdo.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spacing → double
-
Espaço vertical entre itens. Default AppSpacings.s16.
final
- stickToBottom → bool
-
Se ancora o conteúdo na base quando ele é menor que a viewport.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< AppChatMessageList> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited