TF-1581 Update UI to support language RTL
This commit is contained in:
@@ -8,6 +8,7 @@ import 'package:tmail_ui_user/features/base/mixin/app_loader_mixin.dart';
|
||||
import 'package:tmail_ui_user/features/upload/presentation/model/upload_file_state.dart';
|
||||
import 'package:tmail_ui_user/features/upload/presentation/model/upload_file_status.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
import 'package:tmail_ui_user/main/utils/app_utils.dart';
|
||||
|
||||
typedef OnDeleteAttachmentAction = void Function(UploadFileState fileState);
|
||||
|
||||
@@ -51,9 +52,11 @@ class AttachmentFileComposerBuilder extends StatelessWidget with AppLoaderMixin
|
||||
hoverColor: AppColor.primaryColor,
|
||||
onTap: () {},
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 8,
|
||||
bottom: BuildUtils.isWeb ? 6 : 14),
|
||||
padding: EdgeInsets.only(
|
||||
left: AppUtils.isDirectionRTL(context) ? 0 : 8,
|
||||
right: AppUtils.isDirectionRTL(context) ? 8 : 0,
|
||||
bottom: BuildUtils.isWeb ? 6 : 14
|
||||
),
|
||||
child: SvgPicture.asset(
|
||||
fileState.getIcon(_imagePaths),
|
||||
width: 40,
|
||||
@@ -62,11 +65,14 @@ class AttachmentFileComposerBuilder extends StatelessWidget with AppLoaderMixin
|
||||
),
|
||||
title: Transform(
|
||||
transform: Matrix4.translationValues(
|
||||
BuildUtils.isWeb ? 0.0 : -8.0,
|
||||
AppUtils.isDirectionRTL(context) ? 0.0 : BuildUtils.isWeb ? 0.0 : -8.0,
|
||||
BuildUtils.isWeb ? -8.0 : -10.0,
|
||||
0.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: BuildUtils.isWeb ? 20 : 16),
|
||||
padding: EdgeInsets.only(
|
||||
right: AppUtils.isDirectionRTL(context) ? 0 : BuildUtils.isWeb ? 20 : 16,
|
||||
left: AppUtils.isDirectionRTL(context) ? BuildUtils.isWeb ? 20 : 16 : 0
|
||||
),
|
||||
child: Text(
|
||||
fileState.fileName,
|
||||
maxLines: 1,
|
||||
@@ -82,7 +88,7 @@ class AttachmentFileComposerBuilder extends StatelessWidget with AppLoaderMixin
|
||||
subtitle: fileState.fileSize != 0
|
||||
? Transform(
|
||||
transform: Matrix4.translationValues(
|
||||
BuildUtils.isWeb ? 0.0 : -8.0,
|
||||
AppUtils.isDirectionRTL(context) ? 0.0 : BuildUtils.isWeb ? 0.0 : -8.0,
|
||||
BuildUtils.isWeb ? -8.0 : -10.0,
|
||||
0.0),
|
||||
child: Text(
|
||||
@@ -96,19 +102,34 @@ class AttachmentFileComposerBuilder extends StatelessWidget with AppLoaderMixin
|
||||
color: AppColor.colorContentEmail)))
|
||||
: null,
|
||||
),
|
||||
Positioned(
|
||||
right: BuildUtils.isWeb ? -5 : -12,
|
||||
top: BuildUtils.isWeb ? -5 : -12,
|
||||
child: buildIconWeb(
|
||||
icon: SvgPicture.asset(_imagePaths.icDeleteAttachment, fit: BoxFit.fill),
|
||||
tooltip: AppLocalizations.of(context).delete,
|
||||
onTap: () {
|
||||
if (onDeleteAttachmentAction != null) {
|
||||
onDeleteAttachmentAction!.call(fileState);
|
||||
if (AppUtils.isDirectionRTL(context))
|
||||
Positioned(
|
||||
left: BuildUtils.isWeb ? -5 : -12,
|
||||
top: BuildUtils.isWeb ? -5 : -12,
|
||||
child: buildIconWeb(
|
||||
icon: SvgPicture.asset(_imagePaths.icDeleteAttachment, fit: BoxFit.fill),
|
||||
tooltip: AppLocalizations.of(context).delete,
|
||||
onTap: () {
|
||||
if (onDeleteAttachmentAction != null) {
|
||||
onDeleteAttachmentAction!.call(fileState);
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
),
|
||||
else
|
||||
Positioned(
|
||||
right: BuildUtils.isWeb ? -5 : -12,
|
||||
top: BuildUtils.isWeb ? -5 : -12,
|
||||
child: buildIconWeb(
|
||||
icon: SvgPicture.asset(_imagePaths.icDeleteAttachment, fit: BoxFit.fill),
|
||||
tooltip: AppLocalizations.of(context).delete,
|
||||
onTap: () {
|
||||
if (onDeleteAttachmentAction != null) {
|
||||
onDeleteAttachmentAction!.call(fileState);
|
||||
}
|
||||
}
|
||||
)
|
||||
),
|
||||
Align(alignment: Alignment.bottomCenter, child: _progressLoading),
|
||||
]),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user