AdaptiveConversationDesk<T> constructor
const
AdaptiveConversationDesk<T> ({
- Key? key,
- required List<
T> conversations, - required Widget itemBuilder(
- BuildContext context,
- T conversation,
- bool selected,
- VoidCallback onTap,
- required Widget threadBuilder(
- BuildContext context,
- T conversation
- required Widget contextBuilder(
- BuildContext context,
- T conversation
- required String listTitle,
- required String contextTitle,
- Widget? header,
- Widget? emptyState,
- String? listDescription,
- Widget? listLeading,
- String? contextDescription,
- Widget? contextLeading,
- String modalListLabel = 'Open conversations',
- Widget modalListIcon = const Icon(Icons.chat_bubble_outline),
- String modalContextLabel = 'Open context',
- Widget modalContextIcon = const Icon(Icons.info_outline),
- AdaptiveSize listDockedAt = AdaptiveSize.medium,
- AdaptiveSize contextDockedAt = AdaptiveSize.expanded,
- AdaptiveHeight minimumListDockedHeight = AdaptiveHeight.compact,
- AdaptiveHeight minimumContextDockedHeight = AdaptiveHeight.medium,
- bool useContainerConstraints = true,
- bool considerOrientation = false,
- int? selectedIndex,
- int initialIndex = 0,
- ValueChanged<
int> ? onSelectedIndexChanged, - double spacing = 16,
- double itemSpacing = 12,
- int listFlex = 2,
- int threadFlex = 4,
- int contextFlex = 2,
- EdgeInsetsGeometry listPadding = const EdgeInsets.all(16),
- EdgeInsetsGeometry threadPadding = const EdgeInsets.all(16),
- EdgeInsetsGeometry contextPadding = const EdgeInsets.all(16),
- double modalHeightFactor = 0.72,
- bool showModalDragHandle = true,
- bool animateSize = true,
- Duration animationDuration = const Duration(milliseconds: 250),
- Curve animationCurve = Curves.easeInOutCubic,
Creates an adaptive conversation desk.
Implementation
const AdaptiveConversationDesk({
super.key,
required this.conversations,
required this.itemBuilder,
required this.threadBuilder,
required this.contextBuilder,
required this.listTitle,
required this.contextTitle,
this.header,
this.emptyState,
this.listDescription,
this.listLeading,
this.contextDescription,
this.contextLeading,
this.modalListLabel = 'Open conversations',
this.modalListIcon = const Icon(Icons.chat_bubble_outline),
this.modalContextLabel = 'Open context',
this.modalContextIcon = const Icon(Icons.info_outline),
this.listDockedAt = AdaptiveSize.medium,
this.contextDockedAt = AdaptiveSize.expanded,
this.minimumListDockedHeight = AdaptiveHeight.compact,
this.minimumContextDockedHeight = AdaptiveHeight.medium,
this.useContainerConstraints = true,
this.considerOrientation = false,
this.selectedIndex,
this.initialIndex = 0,
this.onSelectedIndexChanged,
this.spacing = 16,
this.itemSpacing = 12,
this.listFlex = 2,
this.threadFlex = 4,
this.contextFlex = 2,
this.listPadding = const EdgeInsets.all(16),
this.threadPadding = const EdgeInsets.all(16),
this.contextPadding = const EdgeInsets.all(16),
this.modalHeightFactor = 0.72,
this.showModalDragHandle = true,
this.animateSize = true,
this.animationDuration = const Duration(milliseconds: 250),
this.animationCurve = Curves.easeInOutCubic,
}) : assert(spacing >= 0, 'spacing must be zero or greater.'),
assert(itemSpacing >= 0, 'itemSpacing must be zero or greater.'),
assert(listFlex > 0, 'listFlex must be greater than zero.'),
assert(threadFlex > 0, 'threadFlex must be greater than zero.'),
assert(contextFlex > 0, 'contextFlex must be greater than zero.'),
assert(
modalHeightFactor > 0 && modalHeightFactor <= 1,
'modalHeightFactor must be between 0 and 1.',
);