fix scrolling

This commit is contained in:
Christien Rioux 2023-10-14 15:47:02 -04:00
parent 44ba5fcbb8
commit d2a7fdbe4d
2 changed files with 30 additions and 39 deletions

View File

@ -30,7 +30,6 @@ class ContactInvitationItemWidget extends ConsumerWidget {
final scale = theme.extension<ScaleScheme>()!; final scale = theme.extension<ScaleScheme>()!;
return Container( return Container(
margin: const EdgeInsets.fromLTRB(4, 4, 4, 0),
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: ShapeDecoration( decoration: ShapeDecoration(
color: scale.tertiaryScale.subtleBorder, color: scale.tertiaryScale.subtleBorder,

View File

@ -46,44 +46,36 @@ class ContactInvitationListWidgetState
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
)), )),
constraints: const BoxConstraints(maxHeight: 200), constraints: const BoxConstraints(maxHeight: 200),
child: Column( child: Container(
mainAxisSize: MainAxisSize.min, width: double.infinity,
children: [ decoration: ShapeDecoration(
Container( color: scale.primaryScale.subtleBackground,
width: double.infinity, shape: RoundedRectangleBorder(
decoration: ShapeDecoration( borderRadius: BorderRadius.circular(16),
color: scale.primaryScale.subtleBackground, )),
shape: RoundedRectangleBorder( child: ListView.builder(
borderRadius: BorderRadius.circular(16), controller: _scrollController,
)), itemCount: widget.contactInvitationRecordList.length,
child: ListView.builder( itemBuilder: (context, index) {
controller: _scrollController, if (index < 0 ||
itemCount: widget.contactInvitationRecordList.length, index >= widget.contactInvitationRecordList.length) {
itemBuilder: (context, index) { return null;
if (index < 0 || }
index >= widget.contactInvitationRecordList.length) { return ContactInvitationItemWidget(
return null; contactInvitationRecord:
} widget.contactInvitationRecordList[index],
return ContactInvitationItemWidget( key: ObjectKey(widget.contactInvitationRecordList[index]))
contactInvitationRecord: .paddingLTRB(4, 2, 4, 2);
widget.contactInvitationRecordList[index], },
key: ObjectKey( findChildIndexCallback: (key) {
widget.contactInvitationRecordList[index])) final index = widget.contactInvitationRecordList.indexOf(
.paddingAll(2); (key as ObjectKey).value! as proto.ContactInvitationRecord);
}, if (index == -1) {
findChildIndexCallback: (key) { return null;
final index = widget.contactInvitationRecordList.indexOf( }
(key as ObjectKey).value! return index;
as proto.ContactInvitationRecord); },
if (index == -1) { ).paddingLTRB(4, 6, 4, 6)),
return null;
}
return index;
},
shrinkWrap: true,
).paddingLTRB(0, 0, 0, 4))
],
),
); );
} }
} }