WIP: Support for pinned messages #49
1 changed files with 12 additions and 32 deletions
use EventRenderer card for pins
commit
92f53c9aca
|
|
@ -52,43 +52,23 @@ class PinnedEventsDrawer extends HookConsumerWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Henry-Hiles marked this conversation as resolved
Outdated
|
|||||||
AsyncData(:final value) => ListView.builder(
|
AsyncData(:final value) => ListView.builder(
|
||||||
padding: .symmetric(vertical: 18),
|
padding: .symmetric(horizontal: 8),
|
||||||
itemCount: value.length,
|
itemCount: value.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final event = value[index];
|
final event = value[index];
|
||||||
|
|
||||||
return Card(
|
return InkWell(
|
||||||
margin: .only(bottom: 8),
|
|
||||||
child: InkWell(
|
|
||||||
borderRadius: .circular(12),
|
borderRadius: .circular(12),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
// TODO: // Close drawer, then scroll to the message
|
// TODO: // Close drawer, then scroll to the message
|
||||||
},
|
},
|
||||||
child: Padding(
|
|
||||||
padding: .all(12),
|
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
Icons.push_pin,
|
|
||||||
size: 16,
|
|
||||||
color: theme.colorScheme.primary,
|
|
||||||
),
|
|
||||||
SizedBox(width: 8),
|
|
||||||
Expanded(
|
|
||||||
child: EventRenderer(
|
child: EventRenderer(
|
||||||
event,
|
event,
|
||||||
textOnly: true,
|
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
isGrouped: false,
|
isGrouped: false,
|
||||||
getEventOptions: getEventOptions,
|
getEventOptions: getEventOptions,
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue
I would say instead of this, a
SuperSliverViewshould be used, like we do in the main chat view, and instead of an extra card, just wrapEventRendererwith anInkWellor something. And then, you don't need to settextOnlyonEventRenderer.Okay, I take it back about
SuperSliverView, the performance ofListViewseems acceptable here.I've done my other suggestion with not using
textOnly.