comment out poll stuff for now

This commit is contained in:
Henry Hiles 2026-01-13 16:12:03 -05:00
commit 6c6bd265d3
No known key found for this signature in database

View file

@ -273,105 +273,105 @@ class RoomChat extends HookConsumerWidget {
replyToMessage.value = null, replyToMessage.value = null,
room: room.roomData, room: room.roomData,
), ),
customMessageBuilder:
(
context,
message,
index, {
required bool isSentByMe,
MessageGroupStatus? groupStatus,
}) {
final poll =
message.metadata?["poll"]
as PollStartContent;
final responses =
(message.metadata?["responses"]
as Map<
String,
Set<String>
>)
.values
.expand((set) => set)
.fold(<String, int>{}, (
acc,
value,
) {
acc[value] =
(acc[value] ?? 0) + 1;
return acc;
});
return Column( // customMessageBuilder:
crossAxisAlignment: // (
CrossAxisAlignment.start, // context,
spacing: 4, // message,
children: [ // index, {
TopWidget( // required bool isSentByMe,
message, // MessageGroupStatus? groupStatus,
headers: room // }) {
.roomData // final poll =
.client // message.metadata?["poll"]
.headers, // as PollStartContent;
groupStatus: groupStatus, // final responses =
), // (message.metadata?["responses"]
// as Map<
// String,
// Set<String>
// >)
// .values
// .expand((set) => set)
// .fold(<String, int>{}, (
// acc,
// value,
// ) {
// acc[value] =
// (acc[value] ?? 0) + 1;
// return acc;
// });
// TODO: Make this actually work // return Column(
DynamicPolls( // crossAxisAlignment:
startDate: DateTime.now(), // CrossAxisAlignment.start,
endDate: DateTime.now(), // spacing: 4,
private: // children: [
poll.kind == // TopWidget(
PollKind.undisclosed, // message,
allowReselection: true, // headers: room
backgroundDecoration: // .roomData
BoxDecoration( // .client
borderRadius: // .headers,
BorderRadius.all( // groupStatus: groupStatus,
Radius.circular(16), // ),
),
border: Border.all(
color: theme
.colorScheme
.primaryContainer,
width: 4,
),
),
allStyle: Styles(
titleStyle: TitleStyle(
style: theme
.textTheme
.headlineSmall,
),
optionStyle: OptionStyle(
fillColor: theme
.colorScheme
.primaryContainer,
selectedBorderColor: theme
.colorScheme
.primary,
borderColor: theme
.colorScheme
.primary,
unselectedBorderColor:
Colors.transparent,
textSelectColor: theme
.colorScheme
.primary,
),
),
onOptionSelected:
(int index) {},
title: poll.question.mText,
options: poll.answers
.map(
(option) => option.mText,
)
.toList(),
),
],
);
},
// // TODO: Make this actually work
// DynamicPolls(
// startDate: DateTime.now(),
// endDate: DateTime.now(),
// private:
// poll.kind ==
// PollKind.undisclosed,
// allowReselection: true,
// backgroundDecoration:
// BoxDecoration(
// borderRadius:
// BorderRadius.all(
// Radius.circular(16),
// ),
// border: Border.all(
// color: theme
// .colorScheme
// .primaryContainer,
// width: 4,
// ),
// ),
// allStyle: Styles(
// titleStyle: TitleStyle(
// style: theme
// .textTheme
// .headlineSmall,
// ),
// optionStyle: OptionStyle(
// fillColor: theme
// .colorScheme
// .primaryContainer,
// selectedBorderColor: theme
// .colorScheme
// .primary,
// borderColor: theme
// .colorScheme
// .primary,
// unselectedBorderColor:
// Colors.transparent,
// textSelectColor: theme
// .colorScheme
// .primary,
// ),
// ),
// onOptionSelected:
// (int index) {},
// title: poll.question.mText,
// options: poll.answers
// .map(
// (option) => option.mText,
// )
// .toList(),
// ),
// ],
// );
// },
textMessageBuilder: textMessageBuilder:
( (
context, context,