TF-2717 Display attachment bar below subject field on tablet
This commit is contained in:
+1
@@ -6,5 +6,6 @@ class MobileAttachmentComposerWidgetStyle {
|
|||||||
static const double listItemHeight = 50;
|
static const double listItemHeight = 50;
|
||||||
|
|
||||||
static const EdgeInsetsGeometry padding = EdgeInsetsDirectional.symmetric(vertical: 8, horizontal: 16);
|
static const EdgeInsetsGeometry padding = EdgeInsetsDirectional.symmetric(vertical: 8, horizontal: 16);
|
||||||
|
static const EdgeInsetsGeometry tabletPadding = EdgeInsetsDirectional.only(start: 16, end: 16, bottom: 8);
|
||||||
static const EdgeInsetsGeometry itemMargin = EdgeInsetsDirectional.only(top: 8);
|
static const EdgeInsetsGeometry itemMargin = EdgeInsetsDirectional.only(top: 8);
|
||||||
}
|
}
|
||||||
+77
-76
@@ -53,80 +53,15 @@ class _MobileAttachmentComposerWidgetState extends State<MobileAttachmentCompose
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: MobileAttachmentComposerWidgetStyle.padding,
|
padding: _responsiveUtils.isPortraitMobile(context)
|
||||||
|
? MobileAttachmentComposerWidgetStyle.padding
|
||||||
|
: MobileAttachmentComposerWidgetStyle.tabletPadding,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: Column(
|
child: _responsiveUtils.isPortraitMobile(context)
|
||||||
mainAxisSize: MainAxisSize.min,
|
? Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
if (_responsiveUtils.isLandscapeMobile(context))
|
children: [
|
||||||
Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Flexible(
|
|
||||||
flex: 7,
|
|
||||||
child: GridView.builder(
|
|
||||||
primary: false,
|
|
||||||
shrinkWrap: true,
|
|
||||||
itemCount: _listFileDisplayed.length,
|
|
||||||
gridDelegate: const SliverGridDelegateFixedHeight(
|
|
||||||
height: MobileAttachmentComposerWidgetStyle.listItemHeight,
|
|
||||||
crossAxisCount: MobileAttachmentComposerWidgetStyle.maxItemRow,
|
|
||||||
crossAxisSpacing: MobileAttachmentComposerWidgetStyle.listItemSpace,
|
|
||||||
),
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
return AttachmentItemComposerWidget(
|
|
||||||
fileState: _listFileDisplayed[index],
|
|
||||||
itemMargin: MobileAttachmentComposerWidgetStyle.itemMargin,
|
|
||||||
itemPadding: const EdgeInsets.symmetric(horizontal: 8),
|
|
||||||
onDeleteAttachmentAction: widget.onDeleteAttachmentAction
|
|
||||||
);
|
|
||||||
}
|
|
||||||
)
|
|
||||||
),
|
|
||||||
Flexible(
|
|
||||||
flex: 3,
|
|
||||||
child: _isExceededDisplayedAttachments
|
|
||||||
? Row(
|
|
||||||
children: [
|
|
||||||
if (!_isCollapsed)
|
|
||||||
TMailButtonWidget(
|
|
||||||
text: AppLocalizations.of(context).showLess,
|
|
||||||
icon: _imagePaths.icChevronUp,
|
|
||||||
iconAlignment: TextDirection.rtl,
|
|
||||||
iconSpace: 2,
|
|
||||||
iconSize: 24,
|
|
||||||
iconColor: AppColor.primaryColor,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
textStyle: Theme.of(context).textTheme.labelSmall?.copyWith(
|
|
||||||
fontSize: 15,
|
|
||||||
color: AppColor.primaryColor
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
|
||||||
margin: const EdgeInsetsDirectional.only(start: 8, top: 10),
|
|
||||||
onTapActionCallback: _toggleListAttachments
|
|
||||||
)
|
|
||||||
else
|
|
||||||
TMailButtonWidget.fromText(
|
|
||||||
text: AppLocalizations.of(context).showMoreAttachment(_countRemainingAttachments),
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
textStyle: Theme.of(context).textTheme.labelSmall?.copyWith(
|
|
||||||
fontSize: 15,
|
|
||||||
color: AppColor.primaryColor
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
|
||||||
margin: const EdgeInsetsDirectional.only(start: 8, top: 10),
|
|
||||||
onTapActionCallback: _toggleListAttachments
|
|
||||||
),
|
|
||||||
const Spacer(),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: const SizedBox.shrink()
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
else
|
|
||||||
...[
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
@@ -177,8 +112,74 @@ class _MobileAttachmentComposerWidgetState extends State<MobileAttachmentCompose
|
|||||||
onTapActionCallback: _toggleListAttachments
|
onTapActionCallback: _toggleListAttachments
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
]
|
)
|
||||||
),
|
: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Flexible(
|
||||||
|
flex: 7,
|
||||||
|
child: GridView.builder(
|
||||||
|
primary: false,
|
||||||
|
shrinkWrap: true,
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
itemCount: _listFileDisplayed.length,
|
||||||
|
gridDelegate: const SliverGridDelegateFixedHeight(
|
||||||
|
height: MobileAttachmentComposerWidgetStyle.listItemHeight,
|
||||||
|
crossAxisCount: MobileAttachmentComposerWidgetStyle.maxItemRow,
|
||||||
|
crossAxisSpacing: MobileAttachmentComposerWidgetStyle.listItemSpace,
|
||||||
|
),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return AttachmentItemComposerWidget(
|
||||||
|
fileState: _listFileDisplayed[index],
|
||||||
|
itemMargin: MobileAttachmentComposerWidgetStyle.itemMargin,
|
||||||
|
itemPadding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
|
onDeleteAttachmentAction: widget.onDeleteAttachmentAction
|
||||||
|
);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
),
|
||||||
|
Flexible(
|
||||||
|
flex: 3,
|
||||||
|
child: _isExceededDisplayedAttachments
|
||||||
|
? Row(
|
||||||
|
children: [
|
||||||
|
if (!_isCollapsed)
|
||||||
|
TMailButtonWidget(
|
||||||
|
text: AppLocalizations.of(context).showLess,
|
||||||
|
icon: _imagePaths.icChevronUp,
|
||||||
|
iconAlignment: TextDirection.rtl,
|
||||||
|
iconSpace: 2,
|
||||||
|
iconSize: 24,
|
||||||
|
iconColor: AppColor.primaryColor,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
textStyle: Theme.of(context).textTheme.labelSmall?.copyWith(
|
||||||
|
fontSize: 15,
|
||||||
|
color: AppColor.primaryColor
|
||||||
|
),
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||||
|
margin: const EdgeInsetsDirectional.only(start: 8, top: 10),
|
||||||
|
onTapActionCallback: _toggleListAttachments
|
||||||
|
)
|
||||||
|
else
|
||||||
|
TMailButtonWidget.fromText(
|
||||||
|
text: AppLocalizations.of(context).showMoreAttachment(_countRemainingAttachments),
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
textStyle: Theme.of(context).textTheme.labelSmall?.copyWith(
|
||||||
|
fontSize: 15,
|
||||||
|
color: AppColor.primaryColor
|
||||||
|
),
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||||
|
margin: const EdgeInsetsDirectional.only(start: 8, top: 10),
|
||||||
|
onTapActionCallback: _toggleListAttachments
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: const SizedBox.shrink()
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,7 +195,7 @@ class _MobileAttachmentComposerWidgetState extends State<MobileAttachmentCompose
|
|||||||
|
|
||||||
void _updateListFileDisplayed() {
|
void _updateListFileDisplayed() {
|
||||||
final reversedList = widget.listFileUploaded.reversed.toList();
|
final reversedList = widget.listFileUploaded.reversed.toList();
|
||||||
if (_isCollapsed) {
|
if (_isCollapsed && reversedList.length > _maxCountDisplayedAttachments) {
|
||||||
_listFileDisplayed = reversedList.sublist(0, _maxCountDisplayedAttachments);
|
_listFileDisplayed = reversedList.sublist(0, _maxCountDisplayedAttachments);
|
||||||
} else {
|
} else {
|
||||||
_listFileDisplayed = reversedList;
|
_listFileDisplayed = reversedList;
|
||||||
|
|||||||
Reference in New Issue
Block a user