TF-682 Update padding quick search form for tablet landscape
This commit is contained in:
@@ -116,4 +116,12 @@ class ResponsiveUtils {
|
|||||||
isTablet(context);
|
isTablet(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isMailboxDashboardSplitView(BuildContext context) {
|
||||||
|
if (BuildUtils.isWeb) {
|
||||||
|
return isTabletLarge(context);
|
||||||
|
} else {
|
||||||
|
return isLandscapeTablet(context) || isDesktop(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1127,12 +1127,11 @@ class _SuggestionsListState<T, R> extends State<_SuggestionsList<T, R>>
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final listAction = Row(
|
final listAction = Wrap(
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: widget.listActionButton!.map((dynamic action) {
|
children: widget.listActionButton!.map((dynamic action) {
|
||||||
if (widget.actionButtonBuilder != null) {
|
if (widget.actionButtonBuilder != null) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(right: 8),
|
padding: const EdgeInsets.only(right: 8, bottom: kIsWeb ? 8 : 0),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
child: widget.actionButtonBuilder!(context, action),
|
child: widget.actionButtonBuilder!(context, action),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||||
@@ -1209,12 +1208,11 @@ class _SuggestionsListState<T, R> extends State<_SuggestionsList<T, R>>
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final listAction = Row(
|
final listAction = Wrap(
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: widget.listActionButton!.map((dynamic action) {
|
children: widget.listActionButton!.map((dynamic action) {
|
||||||
if (widget.actionButtonBuilder != null) {
|
if (widget.actionButtonBuilder != null) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(right: 8),
|
padding: EdgeInsets.only(right: 8, bottom: kIsWeb ? 8 : 0),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
child: widget.actionButtonBuilder!(context, action),
|
child: widget.actionButtonBuilder!(context, action),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class EmailView extends GetWidget<EmailController> with NetworkConnectionMixin {
|
|||||||
? AppColor.colorBgDesktop
|
? AppColor.colorBgDesktop
|
||||||
: Colors.white,
|
: Colors.white,
|
||||||
body: Row(children: [
|
body: Row(children: [
|
||||||
if (_isMailboxDashboardSplitView(context))
|
if (responsiveUtils.isMailboxDashboardSplitView(context))
|
||||||
const VerticalDivider(color: AppColor.lineItemListColor, width: 1, thickness: 0.2),
|
const VerticalDivider(color: AppColor.lineItemListColor, width: 1, thickness: 0.2),
|
||||||
Expanded(child: SafeArea(
|
Expanded(child: SafeArea(
|
||||||
right: responsiveUtils.isLandscapeMobile(context),
|
right: responsiveUtils.isLandscapeMobile(context),
|
||||||
@@ -79,15 +79,6 @@ class EmailView extends GetWidget<EmailController> with NetworkConnectionMixin {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _isMailboxDashboardSplitView(BuildContext context) {
|
|
||||||
if (BuildUtils.isWeb) {
|
|
||||||
return responsiveUtils.isTabletLarge(context);
|
|
||||||
} else {
|
|
||||||
return responsiveUtils.isLandscapeTablet(context)
|
|
||||||
|| responsiveUtils.isDesktop(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildDivider({EdgeInsets? edgeInsets}){
|
Widget _buildDivider({EdgeInsets? edgeInsets}){
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: edgeInsets ?? const EdgeInsets.symmetric(horizontal: 16),
|
padding: edgeInsets ?? const EdgeInsets.symmetric(horizontal: 16),
|
||||||
@@ -138,7 +129,9 @@ class EmailView extends GetWidget<EmailController> with NetworkConnectionMixin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildEmailBody(BuildContext context) {
|
Widget _buildEmailBody(BuildContext context) {
|
||||||
return Container(
|
return GestureDetector(
|
||||||
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
|
child: Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.topCenter,
|
||||||
@@ -163,6 +156,7 @@ class EmailView extends GetWidget<EmailController> with NetworkConnectionMixin {
|
|||||||
return Center(child: _buildEmailEmpty(context));
|
return Center(child: _buildEmailEmpty(context));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,25 +24,26 @@ abstract class BaseMailboxDashBoardView extends GetWidget<MailboxDashBoardContro
|
|||||||
quickSearchFilter: filter,
|
quickSearchFilter: filter,
|
||||||
);
|
);
|
||||||
|
|
||||||
return Container(
|
return Chip(
|
||||||
decoration: BoxDecoration(
|
labelPadding: const EdgeInsets.only(top: 2, bottom: 2, right: 10),
|
||||||
borderRadius: BorderRadius.circular(10),
|
label: Text(
|
||||||
color: filter.getBackgroundColor(quickSearchFilterSelected: isQuickSearchFilterSelected)),
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
|
||||||
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
|
||||||
SvgPicture.asset(
|
|
||||||
filter.getIcon(imagePaths, quickSearchFilterSelected: isQuickSearchFilterSelected),
|
|
||||||
width: 16,
|
|
||||||
height: 16,
|
|
||||||
fit: BoxFit.fill),
|
|
||||||
const SizedBox(width: 4),
|
|
||||||
Text(
|
|
||||||
filter.getTitle(context, receiveTimeType: controller.searchController.emailReceiveTimeType.value),
|
filter.getTitle(context, receiveTimeType: controller.searchController.emailReceiveTimeType.value),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: filter.getTextStyle(quickSearchFilterSelected: isQuickSearchFilterSelected),
|
style: filter.getTextStyle(quickSearchFilterSelected: isQuickSearchFilterSelected),
|
||||||
)
|
),
|
||||||
]));
|
avatar: SvgPicture.asset(
|
||||||
|
filter.getIcon(imagePaths, quickSearchFilterSelected: isQuickSearchFilterSelected),
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
|
fit: BoxFit.fill),
|
||||||
|
labelStyle: filter.getTextStyle(quickSearchFilterSelected: isQuickSearchFilterSelected),
|
||||||
|
backgroundColor: filter.getBackgroundColor(quickSearchFilterSelected: isQuickSearchFilterSelected),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
side: BorderSide(color: filter.getBackgroundColor(quickSearchFilterSelected: isQuickSearchFilterSelected)),
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -149,6 +149,7 @@ class SearchController extends BaseController {
|
|||||||
searchInputController.clear();
|
searchInputController.clear();
|
||||||
cleanSearchFilter();
|
cleanSearchFilter();
|
||||||
searchFocus.unfocus();
|
searchFocus.unfocus();
|
||||||
|
searchState.value = searchState.value.disableSearchState();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -520,10 +520,7 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
listActionPadding: const EdgeInsets.only(
|
listActionPadding: const EdgeInsets.only(
|
||||||
left: 24,
|
left: 24, right: 24, top: 20, bottom: 12),
|
||||||
top: 24,
|
|
||||||
right: 24,
|
|
||||||
bottom: 16),
|
|
||||||
titleHeaderRecent: Padding(
|
titleHeaderRecent: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 8),
|
||||||
child: Text(AppLocalizations.of(context).recent,
|
child: Text(AppLocalizations.of(context).recent,
|
||||||
|
|||||||
+10
-1
@@ -22,6 +22,10 @@ class EmailQuickSearchItemTileWidget extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
return LayoutBuilder(
|
||||||
|
builder: (context, constraints) {
|
||||||
|
final maxWidthItem = constraints.maxWidth;
|
||||||
|
log('EmailQuickSearchItemTileWidget::build(): maxWidthItem: $maxWidthItem');
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 14),
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 14),
|
||||||
child: Row(
|
child: Row(
|
||||||
@@ -40,13 +44,16 @@ class EmailQuickSearchItemTileWidget extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||||
Text(_getInformationSender(),
|
Container(
|
||||||
|
constraints: BoxConstraints(maxWidth: maxWidthItem / 3),
|
||||||
|
child: Text(_getInformationSender(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: BuildUtils.isWeb ? null : TextOverflow.ellipsis,
|
overflow: BuildUtils.isWeb ? null : TextOverflow.ellipsis,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Colors.black)),
|
color: Colors.black)),
|
||||||
|
),
|
||||||
const SizedBox(width: 16),
|
const SizedBox(width: 16),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(_presentationEmail.getEmailTitle(),
|
child: Text(_presentationEmail.getEmailTitle(),
|
||||||
@@ -84,6 +91,8 @@ class EmailQuickSearchItemTileWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
String _getInformationSender() {
|
String _getInformationSender() {
|
||||||
if (_presentationMailbox?.role == PresentationMailbox.roleSent
|
if (_presentationMailbox?.role == PresentationMailbox.roleSent
|
||||||
|
|||||||
@@ -294,10 +294,7 @@ class ThreadView extends GetWidget<ThreadController> with AppLoaderMixin,
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
listActionPadding: const EdgeInsets.only(
|
listActionPadding: const EdgeInsets.only(
|
||||||
left: 24,
|
left: 24, right: 24, top: 20, bottom: 12),
|
||||||
top: 24,
|
|
||||||
right: 24,
|
|
||||||
bottom: 16),
|
|
||||||
titleHeaderRecent: Padding(
|
titleHeaderRecent: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 8),
|
||||||
child: Text(AppLocalizations.of(context).recent,
|
child: Text(AppLocalizations.of(context).recent,
|
||||||
@@ -787,25 +784,26 @@ class ThreadView extends GetWidget<ThreadController> with AppLoaderMixin,
|
|||||||
quickSearchFilter: filter,
|
quickSearchFilter: filter,
|
||||||
);
|
);
|
||||||
|
|
||||||
return Container(
|
return Chip(
|
||||||
decoration: BoxDecoration(
|
labelPadding: const EdgeInsets.only(top: 2, bottom: 2, right: 10),
|
||||||
borderRadius: BorderRadius.circular(10),
|
label: Text(
|
||||||
color: filter.getBackgroundColor(quickSearchFilterSelected: quickSearchFilterSelected)),
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
|
||||||
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
|
||||||
SvgPicture.asset(
|
|
||||||
filter.getIcon(_imagePaths, quickSearchFilterSelected: quickSearchFilterSelected),
|
|
||||||
width: 16,
|
|
||||||
height: 16,
|
|
||||||
fit: BoxFit.fill),
|
|
||||||
const SizedBox(width: 4),
|
|
||||||
Text(
|
|
||||||
filter.getTitle(context),
|
filter.getTitle(context),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: filter.getTextStyle(quickSearchFilterSelected: quickSearchFilterSelected),
|
style: filter.getTextStyle(quickSearchFilterSelected: quickSearchFilterSelected),
|
||||||
)
|
),
|
||||||
]));
|
avatar: SvgPicture.asset(
|
||||||
|
filter.getIcon(_imagePaths, quickSearchFilterSelected: quickSearchFilterSelected),
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
|
fit: BoxFit.fill),
|
||||||
|
labelStyle: filter.getTextStyle(quickSearchFilterSelected: quickSearchFilterSelected),
|
||||||
|
backgroundColor: filter.getBackgroundColor(quickSearchFilterSelected: quickSearchFilterSelected),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
side: BorderSide(color: filter.getBackgroundColor(quickSearchFilterSelected: quickSearchFilterSelected)),
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user