TF-495 Implement linter for mailbox view
This commit is contained in:
+10
-10
@@ -26,11 +26,11 @@ class BottomBarSelectionMailboxWidget {
|
||||
|
||||
Widget build() {
|
||||
return Container(
|
||||
key: Key('bottom_bar_selection_mailbox_widget'),
|
||||
key: const Key('bottom_bar_selection_mailbox_widget'),
|
||||
alignment: Alignment.center,
|
||||
color: Colors.white,
|
||||
child: MediaQuery(
|
||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
||||
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||
child: SafeArea(child: _buildListOptionButton())
|
||||
)
|
||||
);
|
||||
@@ -42,16 +42,16 @@ class BottomBarSelectionMailboxWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(child: (ButtonBuilder(_imagePaths.icMove)
|
||||
..key(Key('button_move_all_mailbox'))
|
||||
..paddingIcon(EdgeInsets.all(8))
|
||||
..key(const Key('button_move_all_mailbox'))
|
||||
..paddingIcon(const EdgeInsets.all(8))
|
||||
..textStyle(TextStyle(fontSize: 12, color: AppColor.colorTextButton.withOpacity(0.3)))
|
||||
..iconColor(AppColor.colorTextButton.withOpacity(0.3))
|
||||
..onPressActionClick(() => {})
|
||||
..text(AppLocalizations.of(_context).move, isVertical: true))
|
||||
.build()),
|
||||
Expanded(child: (ButtonBuilder(_imagePaths.icRenameMailbox)
|
||||
..key(Key('button_rename_mailbox'))
|
||||
..paddingIcon(EdgeInsets.all(8))
|
||||
..key(const Key('button_rename_mailbox'))
|
||||
..paddingIcon(const EdgeInsets.all(8))
|
||||
..textStyle(TextStyle(
|
||||
fontSize: 12,
|
||||
color: _isRenameMailboxValid ? AppColor.colorTextButton : AppColor.colorTextButton.withOpacity(0.3)))
|
||||
@@ -64,16 +64,16 @@ class BottomBarSelectionMailboxWidget {
|
||||
..text(AppLocalizations.of(_context).rename, isVertical: true))
|
||||
.build()),
|
||||
Expanded(child: (ButtonBuilder(_imagePaths.icRead)
|
||||
..key(Key('button_mark_read_all_mailbox'))
|
||||
..paddingIcon(EdgeInsets.all(8))
|
||||
..key(const Key('button_mark_read_all_mailbox'))
|
||||
..paddingIcon(const EdgeInsets.all(8))
|
||||
..textStyle(TextStyle(fontSize: 12, color: AppColor.colorTextButton.withOpacity(0.3)))
|
||||
..iconColor(AppColor.colorTextButton.withOpacity(0.3))
|
||||
..onPressActionClick(() => {})
|
||||
..text(AppLocalizations.of(_context).mark_as_read, isVertical: true))
|
||||
.build()),
|
||||
Expanded(child: (ButtonBuilder(_imagePaths.icDelete)
|
||||
..key(Key('button_delete_all_mailbox'))
|
||||
..paddingIcon(EdgeInsets.all(8))
|
||||
..key(const Key('button_delete_all_mailbox'))
|
||||
..paddingIcon(const EdgeInsets.all(8))
|
||||
..textStyle(TextStyle(
|
||||
fontSize: 12,
|
||||
color: _isDeleteMailboxValid ? AppColor.colorTextButton : AppColor.colorTextButton.withOpacity(0.3)))
|
||||
|
||||
@@ -32,13 +32,13 @@ class MailboxNewFolderTileBuilder {
|
||||
splashColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent),
|
||||
child: Container(
|
||||
key: Key('mailbox_new_folder_tile'),
|
||||
key: const Key('mailbox_new_folder_tile'),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
color: AppColor.mailboxBackgroundColor),
|
||||
child: MediaQuery(
|
||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
||||
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||
child: ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
onTap: () => {
|
||||
@@ -47,16 +47,16 @@ class MailboxNewFolderTileBuilder {
|
||||
}
|
||||
},
|
||||
leading: Padding(
|
||||
padding: EdgeInsets.only(left: 34),
|
||||
padding: const EdgeInsets.only(left: 34),
|
||||
child: _icon != null
|
||||
? SvgPicture.asset(_icon!, width: 24, height: 24, color: AppColor.mailboxIconColor, fit: BoxFit.fill)
|
||||
: SizedBox.shrink()),
|
||||
: const SizedBox.shrink()),
|
||||
title: Padding(
|
||||
padding: EdgeInsets.only(left: 8),
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
child: Text(
|
||||
_name ?? '',
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 15, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
||||
style: const TextStyle(fontSize: 15, color: AppColor.mailboxTextColor, fontWeight: FontWeight.bold),
|
||||
)),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -44,15 +44,15 @@ class MailBoxFolderTileBuilder {
|
||||
);
|
||||
|
||||
void addOnExpandFolderActionClick(OnExpandFolderActionClick onExpandFolderActionClick) {
|
||||
this._onExpandFolderActionClick = onExpandFolderActionClick;
|
||||
_onExpandFolderActionClick = onExpandFolderActionClick;
|
||||
}
|
||||
|
||||
void addOnOpenMailboxFolderClick(OnOpenMailboxFolderClick onOpenMailboxFolderClick) {
|
||||
this._onOpenMailboxFolderClick = onOpenMailboxFolderClick;
|
||||
_onOpenMailboxFolderClick = onOpenMailboxFolderClick;
|
||||
}
|
||||
|
||||
void addOnSelectMailboxFolderClick(OnSelectMailboxFolderClick onSelectMailboxFolderClick) {
|
||||
this._onSelectMailboxFolderClick = onSelectMailboxFolderClick;
|
||||
_onSelectMailboxFolderClick = onSelectMailboxFolderClick;
|
||||
}
|
||||
|
||||
Widget build() {
|
||||
@@ -61,14 +61,14 @@ class MailBoxFolderTileBuilder {
|
||||
splashColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent),
|
||||
child: Container(
|
||||
key: Key('mailbox_folder_tile'),
|
||||
key: const Key('mailbox_folder_tile'),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(kIsWeb ? 10 : 0),
|
||||
color: backgroundColorItem
|
||||
),
|
||||
padding: kIsWeb ? EdgeInsets.only(left: 8, right: 4) : EdgeInsets.zero,
|
||||
padding: kIsWeb ? const EdgeInsets.only(left: 8, right: 4) : EdgeInsets.zero,
|
||||
child: MediaQuery(
|
||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
||||
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||
child: Column(children: [
|
||||
ListTile(
|
||||
hoverColor: Colors.transparent,
|
||||
@@ -92,13 +92,13 @@ class MailBoxFolderTileBuilder {
|
||||
: _mailboxNode.item.getCountUnReadEmails().isNotEmpty
|
||||
&& mailboxDisplayed == MailboxDisplayed.mailbox
|
||||
&& !_mailboxNode.hasChildren()
|
||||
? SizedBox(width: 40)
|
||||
: SizedBox.shrink()
|
||||
? const SizedBox(width: 40)
|
||||
: const SizedBox.shrink()
|
||||
),
|
||||
if (lastNode?.item.id != _mailboxNode.item.id && !kIsWeb)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: allSelectMode == SelectMode.ACTIVE ? 50 : 35),
|
||||
child: Divider(color: AppColor.lineItemListColor, height: 0.5, thickness: 0.2)),
|
||||
child: const Divider(color: AppColor.lineItemListColor, height: 0.5, thickness: 0.2)),
|
||||
])
|
||||
)
|
||||
)
|
||||
@@ -123,10 +123,10 @@ class MailBoxFolderTileBuilder {
|
||||
Expanded(child: Transform(
|
||||
transform: Matrix4.translationValues(allSelectMode == SelectMode.ACTIVE ? -16.0 : -20.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
'${_mailboxNode.item.name?.name ?? ''}',
|
||||
_mailboxNode.item.name?.name ?? '',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.normal),
|
||||
style: const TextStyle(fontSize: 15, color: AppColor.colorNameEmail, fontWeight: FontWeight.normal),
|
||||
))),
|
||||
if (_mailboxNode.item.getCountUnReadEmails().isNotEmpty && mailboxDisplayed == MailboxDisplayed.mailbox)
|
||||
Transform(transform: Matrix4.translationValues(25.0, 0.0, 0.0), child: _buildCounter())
|
||||
@@ -136,10 +136,10 @@ class MailBoxFolderTileBuilder {
|
||||
|
||||
Widget _buildCounter() {
|
||||
return Text(
|
||||
'${_mailboxNode.item.getCountUnReadEmails()}',
|
||||
_mailboxNode.item.getCountUnReadEmails(),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 13, color: Colors.black, fontWeight: FontWeight.normal),
|
||||
style: const TextStyle(fontSize: 13, color: Colors.black, fontWeight: FontWeight.normal),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -152,11 +152,11 @@ class MailBoxFolderTileBuilder {
|
||||
onHover: (value) => setState(() => isHoverIcon = value),
|
||||
child: isHoverIcon
|
||||
? _buildSelectModeIcon()
|
||||
: SvgPicture.asset('${_mailboxNode.item.getMailboxIcon(_imagePaths)}', width: 28, height: 28, fit: BoxFit.fill)
|
||||
: SvgPicture.asset(_mailboxNode.item.getMailboxIcon(_imagePaths), width: 28, height: 28, fit: BoxFit.fill)
|
||||
);
|
||||
});
|
||||
} else {
|
||||
return SvgPicture.asset('${_mailboxNode.item.getMailboxIcon(_imagePaths)}', width: 28, height: 28, fit: BoxFit.fill);
|
||||
return SvgPicture.asset(_mailboxNode.item.getMailboxIcon(_imagePaths), width: 28, height: 28, fit: BoxFit.fill);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,10 +43,10 @@ class MailboxSearchTileBuilder {
|
||||
splashColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent),
|
||||
child: Container(
|
||||
key: Key('mailbox_list_tile'),
|
||||
key: const Key('mailbox_list_tile'),
|
||||
alignment: Alignment.center,
|
||||
child: MediaQuery(
|
||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
||||
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||
child: Column(children: [
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
@@ -62,10 +62,10 @@ class MailboxSearchTileBuilder {
|
||||
Expanded(child: Transform(
|
||||
transform: Matrix4.translationValues(allSelectMode == SelectMode.ACTIVE ? -16.0 : -20.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
'${_presentationMailbox.name?.name ?? ''}',
|
||||
_presentationMailbox.name?.name ?? '',
|
||||
maxLines: 1,
|
||||
overflow:TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 17, color: AppColor.colorNameEmail, fontWeight: FontWeight.normal),
|
||||
style: const TextStyle(fontSize: 17, color: AppColor.colorNameEmail, fontWeight: FontWeight.normal),
|
||||
))),
|
||||
]),
|
||||
subtitle: _presentationMailbox.mailboxPath?.isNotEmpty == true
|
||||
@@ -75,7 +75,7 @@ class MailboxSearchTileBuilder {
|
||||
_presentationMailbox.mailboxPath ?? '',
|
||||
maxLines: 1,
|
||||
overflow:TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 13, color: AppColor.colorContentEmail),
|
||||
style: const TextStyle(fontSize: 13, color: AppColor.colorContentEmail),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
@@ -83,7 +83,7 @@ class MailboxSearchTileBuilder {
|
||||
if (lastMailbox?.id != _presentationMailbox.id && !kIsWeb)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: allSelectMode == SelectMode.ACTIVE ? 50 : 35),
|
||||
child: Divider(color: AppColor.lineItemListColor, height: 0.5, thickness: 0.2)),
|
||||
child: const Divider(color: AppColor.lineItemListColor, height: 0.5, thickness: 0.2)),
|
||||
]),
|
||||
)
|
||||
)
|
||||
@@ -107,11 +107,11 @@ class MailboxSearchTileBuilder {
|
||||
onHover: (value) => setState(() => isHoverIcon = value),
|
||||
child: isHoverIcon
|
||||
? _buildSelectModeIcon()
|
||||
: SvgPicture.asset('${_presentationMailbox.getMailboxIcon(_imagePaths)}', width: 28, height: 28, fit: BoxFit.fill)
|
||||
: SvgPicture.asset(_presentationMailbox.getMailboxIcon(_imagePaths), width: 28, height: 28, fit: BoxFit.fill)
|
||||
);
|
||||
});
|
||||
} else {
|
||||
return SvgPicture.asset('${_presentationMailbox.getMailboxIcon(_imagePaths)}', width: 28, height: 28, fit: BoxFit.fill);
|
||||
return SvgPicture.asset(_presentationMailbox.getMailboxIcon(_imagePaths), width: 28, height: 28, fit: BoxFit.fill);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class SearchFormWidgetBuilder {
|
||||
|
||||
Widget build() {
|
||||
return Container(
|
||||
key: Key('search_folder_form'),
|
||||
key: const Key('search_folder_form'),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
@@ -38,23 +38,23 @@ class SearchFormWidgetBuilder {
|
||||
border: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
enabledBorder: InputBorder.none,
|
||||
contentPadding: EdgeInsets.only(left: 0, top: 15, bottom: 15, right: 15),
|
||||
contentPadding: const EdgeInsets.only(left: 0, top: 15, bottom: 15, right: 15),
|
||||
hintText: AppLocalizations.of(_context).search_folder,
|
||||
hintStyle: TextStyle(color: AppColor.searchHintTextColor, fontSize: 15.0, fontWeight: FontWeight.w500),
|
||||
hintStyle: const TextStyle(color: AppColor.searchHintTextColor, fontSize: 15.0, fontWeight: FontWeight.w500),
|
||||
icon: Padding(
|
||||
padding: EdgeInsets.only(left: 20),
|
||||
padding: const EdgeInsets.only(left: 20),
|
||||
child: SvgPicture.asset(_imagePaths.icSearch, width: 24, height: 24, fit: BoxFit.fill),
|
||||
))),
|
||||
debounceDuration: Duration(milliseconds: 300),
|
||||
debounceDuration: const Duration(milliseconds: 300),
|
||||
suggestionsCallback: (pattern) async {
|
||||
if (_onNewSearchQuery != null) {
|
||||
_onNewSearchQuery!(pattern);
|
||||
}
|
||||
return [];
|
||||
},
|
||||
itemBuilder: (BuildContext context, itemData) => SizedBox.shrink(),
|
||||
itemBuilder: (BuildContext context, itemData) => const SizedBox.shrink(),
|
||||
onSuggestionSelected: (suggestion) {},
|
||||
noItemsFoundBuilder: (context) => SizedBox(),
|
||||
noItemsFoundBuilder: (context) => const SizedBox(),
|
||||
hideOnEmpty: true,
|
||||
hideOnError: true,
|
||||
hideOnLoading: true,
|
||||
|
||||
@@ -12,8 +12,8 @@ class StorageWidgetBuilder {
|
||||
|
||||
Widget build() {
|
||||
return Container(
|
||||
key: Key('storage_widget'),
|
||||
padding: EdgeInsets.only(left: 40, top: 16, bottom: 20, right: 40),
|
||||
key: const Key('storage_widget'),
|
||||
padding: const EdgeInsets.only(left: 40, top: 16, bottom: 20, right: 40),
|
||||
color: AppColor.storageBackgroundColor,
|
||||
alignment: Alignment.bottomLeft,
|
||||
height: 100,
|
||||
@@ -24,11 +24,11 @@ class StorageWidgetBuilder {
|
||||
Text(
|
||||
AppLocalizations.of(_context).storage,
|
||||
maxLines: 1,
|
||||
style: TextStyle(fontSize: 12, color: AppColor.storageTitleColor, fontWeight: FontWeight.w500)),
|
||||
style: const TextStyle(fontSize: 12, color: AppColor.storageTitleColor, fontWeight: FontWeight.w500)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 8.0),
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: const TextSpan(
|
||||
style: TextStyle(fontSize: 16, color: AppColor.storageMaxSizeColor, fontWeight: FontWeight.w700),
|
||||
children: [
|
||||
TextSpan(
|
||||
|
||||
@@ -28,7 +28,7 @@ class UserInformationWidgetBuilder {
|
||||
|
||||
Widget build() {
|
||||
return Container(
|
||||
key: Key('user_information_widget'),
|
||||
key: const Key('user_information_widget'),
|
||||
color: Colors.transparent,
|
||||
padding: EdgeInsets.zero,
|
||||
margin: EdgeInsets.zero,
|
||||
@@ -37,7 +37,7 @@ class UserInformationWidgetBuilder {
|
||||
..text(_userProfile != null ? _userProfile!.getAvatarText() : '')
|
||||
..backgroundColor(Colors.white)
|
||||
..textColor(Colors.black)
|
||||
..addBoxShadows([BoxShadow(
|
||||
..addBoxShadows([const BoxShadow(
|
||||
color: AppColor.colorShadowBgContentEmail,
|
||||
spreadRadius: 1, blurRadius: 1, offset: Offset(0, 0.5))])
|
||||
..size(GetPlatform.isWeb ? 48 : 56))
|
||||
@@ -47,16 +47,16 @@ class UserInformationWidgetBuilder {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 16, top: 10),
|
||||
padding: const EdgeInsets.only(left: 16, top: 10),
|
||||
child: Text(
|
||||
_userProfile != null ? '${_userProfile?.email}' : '',
|
||||
maxLines: 1,
|
||||
overflow: GetPlatform.isWeb ? TextOverflow.clip : TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 17, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600)
|
||||
style: const TextStyle(fontSize: 17, color: AppColor.colorNameEmail, fontWeight: FontWeight.w600)
|
||||
)
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 10),
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Material(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: Colors.transparent,
|
||||
@@ -66,7 +66,7 @@ class UserInformationWidgetBuilder {
|
||||
onPressed: () => _onLogoutActionClick?.call(),
|
||||
child: Text(
|
||||
AppLocalizations.of(_context).logout,
|
||||
style: TextStyle(fontSize: 14, color: AppColor.colorTextButton),
|
||||
style: const TextStyle(fontSize: 14, color: AppColor.colorTextButton),
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user