textOverlay method
Text for the visible slot. Null when this item has no text to show.
slotMain is the item's current main-axis size, so the line and its
alignment update as the slot changes during a scroll.
Implementation
Widget? textOverlay({required double slotMain}) {
final bool dynamicText = applyDynamicTextContentTransform;
final bool small = slotMain <= 56;
final bool large = slotMain >= 200;
final Widget? shownTitle = !dynamicText || large ? title : null;
final bool prefixLine = dynamicText && prefixText != null && small;
final Widget? shownBody = prefixLine ? prefixText : subtitle;
if (shownTitle == null && shownBody == null) {
return null;
}
return Padding(
padding: const EdgeInsets.all(12),
child: Align(
alignment: Alignment.bottomLeft,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (shownTitle != null) _oneLine(shownTitle),
if (shownBody != null) _oneLine(shownBody),
],
),
),
);
}