Always show scroll bar if there is overflow

This commit is contained in:
Hillel Coren 2022-10-02 11:27:28 +03:00
parent 0130dba513
commit e4191f9ca3
2 changed files with 110 additions and 102 deletions

View File

@ -278,74 +278,78 @@ class _ClientViewFullwidthState extends State<ClientViewFullwidth>
right: kMobileDialogPadding / (!showStanding ? 1 : 2),
bottom: kMobileDialogPadding,
left: kMobileDialogPadding / 2),
child: ListView(
child: Scrollbar(
thumbVisibility: true,
controller: _scrollController3,
children: [
Text(
localization.contacts +
(hasMultipleContacts
? ' (${client.contacts.length})'
: ''),
style: Theme.of(context).textTheme.headline6,
),
SizedBox(height: 8),
...client.contacts.map((contact) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
contact.fullName,
style: Theme.of(context).textTheme.subtitle1,
),
if (contact.email.isNotEmpty)
Padding(
padding:
const EdgeInsets.symmetric(vertical: 4),
child: CopyToClipboard(
value: contact.email,
child: IconText(
icon: Icons.email, text: contact.email),
child: ListView(
controller: _scrollController3,
children: [
Text(
localization.contacts +
(hasMultipleContacts
? ' (${client.contacts.length})'
: ''),
style: Theme.of(context).textTheme.headline6,
),
SizedBox(height: 8),
...client.contacts.map((contact) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
contact.fullName,
style: Theme.of(context).textTheme.subtitle1,
),
if (contact.email.isNotEmpty)
Padding(
padding:
const EdgeInsets.symmetric(vertical: 4),
child: CopyToClipboard(
value: contact.email,
child: IconText(
icon: Icons.email, text: contact.email),
),
),
),
if (contact.phone.isNotEmpty)
Padding(
padding:
const EdgeInsets.symmetric(vertical: 4),
child: CopyToClipboard(
value: contact.phone,
child: IconText(
icon: Icons.phone, text: contact.phone),
if (contact.phone.isNotEmpty)
Padding(
padding:
const EdgeInsets.symmetric(vertical: 4),
child: CopyToClipboard(
value: contact.phone,
child: IconText(
icon: Icons.phone, text: contact.phone),
),
),
),
SizedBox(height: 8),
if (!hasMultipleContacts) ...[
PortalLinks(
viewLink: contact.silentLink,
copyLink: contact.link,
client: client,
style: PortalLinkStyle.icons,
),
SizedBox(height: 16),
] else
SizedBox(height: 8),
],
if (!hasMultipleContacts) ...[
PortalLinks(
viewLink: contact.silentLink,
copyLink: contact.link,
client: client,
style: PortalLinkStyle.icons,
),
SizedBox(height: 16),
] else
SizedBox(height: 8),
],
),
),
),
if (hasMultipleContacts)
PortalLinks(
client: client,
viewLink: contact.silentLink,
copyLink: contact.link,
style: PortalLinkStyle.dropdown,
)
],
);
}).toList(),
],
if (hasMultipleContacts)
PortalLinks(
client: client,
viewLink: contact.silentLink,
copyLink: contact.link,
style: PortalLinkStyle.dropdown,
)
],
);
}).toList(),
],
),
),
)),
if (showStanding)

View File

@ -204,48 +204,52 @@ class _VendorViewFullwidthState extends State<VendorViewFullwidth>
right: kMobileDialogPadding / (!showStanding ? 1 : 2),
bottom: kMobileDialogPadding,
left: kMobileDialogPadding / 2),
child: ListView(
child: Scrollbar(
thumbVisibility: true,
controller: _scrollController3,
children: [
Text(
localization.contacts +
(vendor.contacts.length > 1
? ' (${vendor.contacts.length})'
: ''),
style: Theme.of(context).textTheme.headline6,
),
SizedBox(height: 8),
...vendor.contacts.map((contact) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
contact.fullName,
style: Theme.of(context).textTheme.subtitle1,
),
if (contact.email.isNotEmpty)
Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: CopyToClipboard(
value: contact.email,
child: IconText(
icon: Icons.email, text: contact.email),
),
child: ListView(
controller: _scrollController3,
children: [
Text(
localization.contacts +
(vendor.contacts.length > 1
? ' (${vendor.contacts.length})'
: ''),
style: Theme.of(context).textTheme.headline6,
),
SizedBox(height: 8),
...vendor.contacts.map((contact) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
contact.fullName,
style: Theme.of(context).textTheme.subtitle1,
),
if (contact.phone.isNotEmpty)
Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: CopyToClipboard(
value: contact.phone,
child: IconText(
icon: Icons.phone, text: contact.phone),
if (contact.email.isNotEmpty)
Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: CopyToClipboard(
value: contact.email,
child: IconText(
icon: Icons.email, text: contact.email),
),
),
),
SizedBox(height: 16),
],
);
}).toList()
],
if (contact.phone.isNotEmpty)
Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: CopyToClipboard(
value: contact.phone,
child: IconText(
icon: Icons.phone, text: contact.phone),
),
),
SizedBox(height: 16),
],
);
}).toList()
],
),
),
)),
if (showStanding)