TF-248 Update UI for web
This commit is contained in:
@@ -13,6 +13,7 @@ class MailboxTileBuilder {
|
||||
final SelectMode selectMode;
|
||||
final ImagePaths _imagePaths;
|
||||
final MailboxDisplayed mailboxDisplayed;
|
||||
final bool isLastElement;
|
||||
|
||||
OnOpenMailboxActionClick? _onOpenMailboxActionClick;
|
||||
|
||||
@@ -21,7 +22,8 @@ class MailboxTileBuilder {
|
||||
this._presentationMailbox,
|
||||
{
|
||||
this.selectMode = SelectMode.INACTIVE,
|
||||
this.mailboxDisplayed = MailboxDisplayed.mailbox
|
||||
this.mailboxDisplayed = MailboxDisplayed.mailbox,
|
||||
this.isLastElement = false,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -38,56 +40,60 @@ class MailboxTileBuilder {
|
||||
key: Key('mailbox_list_tile'),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(mailboxDisplayed == MailboxDisplayed.mailbox ? 10 : 0),
|
||||
color: mailboxDisplayed == MailboxDisplayed.mailbox
|
||||
? selectMode == SelectMode.ACTIVE ? AppColor.mailboxSelectedBackgroundColor : AppColor.mailboxBackgroundColor
|
||||
: Colors.white
|
||||
borderRadius: BorderRadius.circular(0),
|
||||
color: Colors.white
|
||||
),
|
||||
child: MediaQuery(
|
||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
||||
child: ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
onTap: () => {
|
||||
if (_onOpenMailboxActionClick != null) {
|
||||
_onOpenMailboxActionClick!(_presentationMailbox)
|
||||
}
|
||||
},
|
||||
leading: Padding(
|
||||
padding: EdgeInsets.only(left: 8),
|
||||
child: SvgPicture.asset(
|
||||
'${_presentationMailbox.getMailboxIcon(_imagePaths)}',
|
||||
width: 28,
|
||||
height: 28,
|
||||
fit: BoxFit.fill)),
|
||||
title: Transform(
|
||||
transform: Matrix4.translationValues(-10.0, 0.0, 0.0),
|
||||
child: Row(children: [
|
||||
Expanded(child: Text(
|
||||
'${_presentationMailbox.name?.name ?? ''}',
|
||||
maxLines: 1,
|
||||
overflow:TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 15, color: AppColor.colorNameEmail),
|
||||
)),
|
||||
if (mailboxDisplayed == MailboxDisplayed.mailbox)
|
||||
Transform(
|
||||
transform: Matrix4.translationValues(40.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
'${_presentationMailbox.getCountUnReadEmails()}',
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorNameEmail)))
|
||||
])),
|
||||
trailing: Transform(
|
||||
transform: Matrix4.translationValues(8.0, 0.0, 0.0),
|
||||
child: IconButton(
|
||||
color: AppColor.primaryColor,
|
||||
icon: SvgPicture.asset(_imagePaths.icFolderArrow, color: AppColor.colorArrowUserMailbox, fit: BoxFit.fill),
|
||||
onPressed: () {
|
||||
if (_onOpenMailboxActionClick != null) {
|
||||
_onOpenMailboxActionClick!(_presentationMailbox);
|
||||
}
|
||||
}
|
||||
))
|
||||
child: Column(children: [
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
onTap: () => {
|
||||
if (_onOpenMailboxActionClick != null) {
|
||||
_onOpenMailboxActionClick!(_presentationMailbox)
|
||||
}
|
||||
},
|
||||
leading: Padding(
|
||||
padding: EdgeInsets.only(left: 8),
|
||||
child: SvgPicture.asset(
|
||||
'${_presentationMailbox.getMailboxIcon(_imagePaths)}',
|
||||
width: 28,
|
||||
height: 28,
|
||||
fit: BoxFit.fill)),
|
||||
title: Transform(
|
||||
transform: Matrix4.translationValues(-10.0, 0.0, 0.0),
|
||||
child: Row(children: [
|
||||
Expanded(child: Text(
|
||||
'${_presentationMailbox.name?.name ?? ''}',
|
||||
maxLines: 1,
|
||||
overflow:TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 15, color: AppColor.colorNameEmail),
|
||||
)),
|
||||
if (mailboxDisplayed == MailboxDisplayed.mailbox)
|
||||
Transform(
|
||||
transform: Matrix4.translationValues(40.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
'${_presentationMailbox.getCountUnReadEmails()}',
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorNameEmail)))
|
||||
])),
|
||||
trailing: Transform(
|
||||
transform: Matrix4.translationValues(8.0, 0.0, 0.0),
|
||||
child: IconButton(
|
||||
color: AppColor.primaryColor,
|
||||
icon: SvgPicture.asset(_imagePaths.icFolderArrow, color: AppColor.colorArrowUserMailbox, fit: BoxFit.fill),
|
||||
onPressed: () {
|
||||
if (_onOpenMailboxActionClick != null) {
|
||||
_onOpenMailboxActionClick!(_presentationMailbox);
|
||||
}
|
||||
}
|
||||
))
|
||||
),
|
||||
if (!isLastElement)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 45),
|
||||
child: Divider(color: AppColor.lineItemListColor, height: 0.5, thickness: 0.2)),
|
||||
]),
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user