TF-528 Apply linter for some widget
This commit is contained in:
@@ -22,6 +22,8 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
|
||||
DestinationPickerView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
MailboxActions? actions;
|
||||
@@ -157,15 +159,15 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
||||
|
||||
Widget _buildLoadingView() {
|
||||
return Obx(() => controller.viewState.value.fold(
|
||||
(failure) => SizedBox.shrink(),
|
||||
(failure) => const SizedBox.shrink(),
|
||||
(success) => success is LoadingState
|
||||
? Center(child: Padding(
|
||||
? const Center(child: Padding(
|
||||
padding: EdgeInsets.only(top: 16),
|
||||
child: SizedBox(
|
||||
width: 24,
|
||||
height: 24,
|
||||
child: CircularProgressIndicator(color: AppColor.primaryColor))))
|
||||
: SizedBox.shrink()));
|
||||
: const SizedBox.shrink()));
|
||||
}
|
||||
|
||||
Widget _buildListMailbox(BuildContext context, MailboxActions? actions) {
|
||||
@@ -178,18 +180,18 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
||||
if (actions == MailboxActions.create && !BuildUtils.isWeb && _responsiveUtils.isScreenWithShortestSide(context))
|
||||
const SizedBox(height: 12),
|
||||
if (actions == MailboxActions.create) _buildUnifiedMailbox(context),
|
||||
SizedBox(height: 12),
|
||||
const SizedBox(height: 12),
|
||||
Obx(() => controller.defaultMailboxTree.value.root.childrenItems?.isNotEmpty ?? false
|
||||
? _buildMailboxCategory(context, MailboxCategories.exchange, controller.defaultMailboxTree.value.root, actions)
|
||||
: SizedBox.shrink()),
|
||||
if (actions == MailboxActions.create) SizedBox(height: 12),
|
||||
: const SizedBox.shrink()),
|
||||
if (actions == MailboxActions.create) const SizedBox(height: 12),
|
||||
if (actions != MailboxActions.create && !kIsWeb)
|
||||
Padding(
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(left: 60),
|
||||
child: Divider(color: AppColor.lineItemListColor, height: 0.5, thickness: 0.2)),
|
||||
Obx(() => controller.folderMailboxTree.value.root.childrenItems?.isNotEmpty ?? false
|
||||
? _buildMailboxCategory(context, MailboxCategories.folders, controller.folderMailboxTree.value.root, actions)
|
||||
: SizedBox.shrink()),
|
||||
: const SizedBox.shrink()),
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -201,10 +203,10 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
||||
return Column(children: [
|
||||
_buildHeaderMailboxCategory(context, categories),
|
||||
AnimatedContainer(
|
||||
duration: Duration(milliseconds: 400),
|
||||
duration: const Duration(milliseconds: 400),
|
||||
child: categories.getExpandMode(controller.mailboxCategoriesExpandMode.value) == ExpandMode.EXPAND
|
||||
? _buildBodyMailboxCategory(context, categories, mailboxNode, actions)
|
||||
: Offstage())
|
||||
: const Offstage())
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -217,7 +219,7 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
||||
Expanded(child: Text(categories.getTitle(context),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 20, color: Colors.black, fontWeight: FontWeight.bold))),
|
||||
style: const TextStyle(fontSize: 20, color: Colors.black, fontWeight: FontWeight.bold))),
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
categories.getExpandMode(controller.mailboxCategoriesExpandMode.value) == ExpandMode.EXPAND
|
||||
@@ -248,7 +250,7 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
||||
?.map((mailboxNode) => mailboxNode.hasChildren()
|
||||
? TreeViewChild(
|
||||
context,
|
||||
key: Key('children_tree_mailbox_child'),
|
||||
key: const Key('children_tree_mailbox_child'),
|
||||
isExpanded: mailboxNode.expandMode == ExpandMode.EXPAND,
|
||||
parent: (MailBoxFolderTileBuilder(context, _imagePaths, mailboxNode,
|
||||
lastNode: lastNode,
|
||||
@@ -268,14 +270,14 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
||||
Widget _buildListMailboxSearched(BuildContext context) {
|
||||
return Obx(() => Container(
|
||||
margin: _responsiveUtils.isDesktop(context)
|
||||
? EdgeInsets.only(left: 16, right: 16)
|
||||
? const EdgeInsets.only(left: 16, right: 16)
|
||||
: EdgeInsets.zero,
|
||||
decoration: _responsiveUtils.isDesktop(context)
|
||||
? BoxDecoration(borderRadius: BorderRadius.circular(14), color: Colors.white)
|
||||
: null,
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.only(left: 16, right: 8),
|
||||
key: Key('list_mailbox_searched'),
|
||||
padding: const EdgeInsets.only(left: 16, right: 8),
|
||||
key: const Key('list_mailbox_searched'),
|
||||
itemCount: controller.listMailboxSearched.length,
|
||||
shrinkWrap: true,
|
||||
primary: false,
|
||||
@@ -299,12 +301,12 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
||||
right: 16),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(14), color: Colors.white),
|
||||
child: MediaQuery(
|
||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
||||
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||
child: ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
onTap: () => controller.selectMailboxAction(null),
|
||||
leading: Padding(
|
||||
padding: EdgeInsets.only(left: 16),
|
||||
padding: const EdgeInsets.only(left: 16),
|
||||
child: SvgPicture.asset(_imagePaths.icFolderMailbox, width: 28, height: 28, fit: BoxFit.fill)),
|
||||
title: Transform(
|
||||
transform: Matrix4.translationValues(-5.0, 0.0, 0.0),
|
||||
@@ -314,7 +316,7 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
||||
AppLocalizations.of(context).default_mailbox,
|
||||
maxLines: 1,
|
||||
overflow:TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 15, color: AppColor.colorNameEmail),
|
||||
style: const TextStyle(fontSize: 15, color: AppColor.colorNameEmail),
|
||||
))
|
||||
]
|
||||
)
|
||||
@@ -339,10 +341,10 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
||||
|
||||
Widget _buildInputSearchFormWidget(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(top: 16, bottom: 16),
|
||||
padding: const EdgeInsets.only(top: 16, bottom: 16),
|
||||
child: Row(
|
||||
children: [
|
||||
Padding(padding: EdgeInsets.only(left: 5), child: buildIconWeb(
|
||||
Padding(padding: const EdgeInsets.only(left: 5), child: buildIconWeb(
|
||||
icon: SvgPicture.asset(_imagePaths.icBack, color: AppColor.colorTextButton, fit: BoxFit.fill),
|
||||
onTap: () => controller.disableSearch(context))),
|
||||
Expanded(child: (SearchAppBarWidget(context, _imagePaths, _responsiveUtils,
|
||||
@@ -352,7 +354,7 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
||||
hasBackButton: false,
|
||||
hasSearchButton: true)
|
||||
..addPadding(EdgeInsets.zero)
|
||||
..setMargin(EdgeInsets.only(right: 16))
|
||||
..setMargin(const EdgeInsets.only(right: 16))
|
||||
..addDecoration(BoxDecoration(borderRadius: BorderRadius.circular(12), color: AppColor.colorBgSearchBar))
|
||||
..addIconClearText(SvgPicture.asset(_imagePaths.icClearTextSearch, width: 18, height: 18, fit: BoxFit.fill))
|
||||
..setHintText(AppLocalizations.of(context).hint_search_mailboxes)
|
||||
|
||||
+8
-8
@@ -26,14 +26,14 @@ class AppBarDestinationPickerBuilder {
|
||||
|
||||
Widget build() {
|
||||
return Container(
|
||||
key: Key('app_bar_destination_picker'),
|
||||
key: const Key('app_bar_destination_picker'),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)),
|
||||
color: Colors.white),
|
||||
height: 52,
|
||||
child: MediaQuery(
|
||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
||||
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
@@ -49,19 +49,19 @@ class AppBarDestinationPickerBuilder {
|
||||
Widget _buildCancelButton() {
|
||||
if (_mailboxAction == MailboxActions.moveEmail) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(right: 12),
|
||||
padding: const EdgeInsets.only(right: 12),
|
||||
child: Material(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: Colors.transparent,
|
||||
child: TextButton(
|
||||
child: Text(
|
||||
AppLocalizations.of(_context).cancel,
|
||||
style: TextStyle(fontSize: 17, color: AppColor.colorTextButton)),
|
||||
style: const TextStyle(fontSize: 17, color: AppColor.colorTextButton)),
|
||||
onPressed: () => _onCloseActionClick?.call()
|
||||
)
|
||||
));
|
||||
} else {
|
||||
return SizedBox(width: 40, height: 40);
|
||||
return const SizedBox(width: 40, height: 40);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class AppBarDestinationPickerBuilder {
|
||||
icon: SvgPicture.asset(_imagePaths.icBack, color: AppColor.colorTextButton, fit: BoxFit.fill),
|
||||
onTap: () => _onCloseActionClick?.call());
|
||||
} else {
|
||||
return SizedBox(width: 100, height: 40);
|
||||
return const SizedBox(width: 100, height: 40);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,6 @@ class AppBarDestinationPickerBuilder {
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 20, color: AppColor.colorNameEmail, fontWeight: FontWeight.w700));
|
||||
style: const TextStyle(fontSize: 20, color: AppColor.colorNameEmail, fontWeight: FontWeight.w700));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user