buildInner method
dynamic
buildInner( - dynamic context,
- dynamic ref
)
Implementation
Widget buildInner(BuildContext context, WidgetRef ref) {
final displayNameProvider = ref.watch(roomDisplayNameProvider(roomId));
final titleIsLoading = displayNameProvider.isLoading;
final displayName = displayNameProvider.valueOrNull ?? roomId;
return LayoutBuilder(
builder: (context, constraints) {
return Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Material(
color: Colors.transparent,
child: ListTile(
dense: true,
onTap: onTap,
selected: showSelectedIndication &&
roomId == ref.watch(selectedChatIdProvider),
selectedTileColor: Theme.of(context).colorScheme.primary,
leading: avatarWithIndicator(context, ref),
title: titleIsLoading
? Skeletonizer(child: Text(roomId))
: Text(
displayName,
style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(fontWeight: FontWeight.w700),
overflow: TextOverflow.ellipsis,
),
subtitle: buildSubtitle(context, constraints),
trailing: constraints.maxWidth < 300 ? null : trailing,
),
),
],
);
},
);
}