From d2a7fdbe4d16a772a1eb8ece2fd409477d7f4348 Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Sat, 14 Oct 2023 15:47:02 -0400 Subject: [PATCH] fix scrolling --- .../contact_invitation_item_widget.dart | 1 - .../contact_invitation_list_widget.dart | 68 ++++++++----------- 2 files changed, 30 insertions(+), 39 deletions(-) diff --git a/lib/components/contact_invitation_item_widget.dart b/lib/components/contact_invitation_item_widget.dart index 1ee74eb..1a967ba 100644 --- a/lib/components/contact_invitation_item_widget.dart +++ b/lib/components/contact_invitation_item_widget.dart @@ -30,7 +30,6 @@ class ContactInvitationItemWidget extends ConsumerWidget { final scale = theme.extension()!; return Container( - margin: const EdgeInsets.fromLTRB(4, 4, 4, 0), clipBehavior: Clip.antiAlias, decoration: ShapeDecoration( color: scale.tertiaryScale.subtleBorder, diff --git a/lib/components/contact_invitation_list_widget.dart b/lib/components/contact_invitation_list_widget.dart index 6828935..372a1cc 100644 --- a/lib/components/contact_invitation_list_widget.dart +++ b/lib/components/contact_invitation_list_widget.dart @@ -46,44 +46,36 @@ class ContactInvitationListWidgetState borderRadius: BorderRadius.circular(16), )), constraints: const BoxConstraints(maxHeight: 200), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - width: double.infinity, - decoration: ShapeDecoration( - color: scale.primaryScale.subtleBackground, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(16), - )), - child: ListView.builder( - controller: _scrollController, - itemCount: widget.contactInvitationRecordList.length, - itemBuilder: (context, index) { - if (index < 0 || - index >= widget.contactInvitationRecordList.length) { - return null; - } - return ContactInvitationItemWidget( - contactInvitationRecord: - widget.contactInvitationRecordList[index], - key: ObjectKey( - widget.contactInvitationRecordList[index])) - .paddingAll(2); - }, - findChildIndexCallback: (key) { - final index = widget.contactInvitationRecordList.indexOf( - (key as ObjectKey).value! - as proto.ContactInvitationRecord); - if (index == -1) { - return null; - } - return index; - }, - shrinkWrap: true, - ).paddingLTRB(0, 0, 0, 4)) - ], - ), + child: Container( + width: double.infinity, + decoration: ShapeDecoration( + color: scale.primaryScale.subtleBackground, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + )), + child: ListView.builder( + controller: _scrollController, + itemCount: widget.contactInvitationRecordList.length, + itemBuilder: (context, index) { + if (index < 0 || + index >= widget.contactInvitationRecordList.length) { + return null; + } + return ContactInvitationItemWidget( + contactInvitationRecord: + widget.contactInvitationRecordList[index], + key: ObjectKey(widget.contactInvitationRecordList[index])) + .paddingLTRB(4, 2, 4, 2); + }, + findChildIndexCallback: (key) { + final index = widget.contactInvitationRecordList.indexOf( + (key as ObjectKey).value! as proto.ContactInvitationRecord); + if (index == -1) { + return null; + } + return index; + }, + ).paddingLTRB(4, 6, 4, 6)), ); } }