TF-528 Apply linter for some widget
This commit is contained in:
@@ -20,14 +20,14 @@ abstract class BaseMailboxController extends BaseController {
|
|||||||
List<PresentationMailbox> allMailboxes = <PresentationMailbox>[];
|
List<PresentationMailbox> allMailboxes = <PresentationMailbox>[];
|
||||||
|
|
||||||
Future buildTree(List<PresentationMailbox> allMailbox) async {
|
Future buildTree(List<PresentationMailbox> allMailbox) async {
|
||||||
this.allMailboxes = allMailbox;
|
allMailboxes = allMailbox;
|
||||||
final tupleTree = await _treeBuilder.generateMailboxTreeInUI(allMailbox);
|
final tupleTree = await _treeBuilder.generateMailboxTreeInUI(allMailbox);
|
||||||
defaultMailboxTree.value = tupleTree.value1;
|
defaultMailboxTree.value = tupleTree.value1;
|
||||||
folderMailboxTree.value = tupleTree.value2;
|
folderMailboxTree.value = tupleTree.value2;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future refreshTree(List<PresentationMailbox> allMailbox) async {
|
Future refreshTree(List<PresentationMailbox> allMailbox) async {
|
||||||
this.allMailboxes = allMailbox;
|
allMailboxes = allMailbox;
|
||||||
final tupleTree = await _treeBuilder.generateMailboxTreeInUIAfterRefreshChanges(
|
final tupleTree = await _treeBuilder.generateMailboxTreeInUIAfterRefreshChanges(
|
||||||
allMailbox, defaultMailboxTree.value, folderMailboxTree.value);
|
allMailbox, defaultMailboxTree.value, folderMailboxTree.value);
|
||||||
defaultMailboxTree.firstRebuild = true;
|
defaultMailboxTree.firstRebuild = true;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import 'package:flutter/cupertino.dart';
|
|||||||
mixin AppLoaderMixin {
|
mixin AppLoaderMixin {
|
||||||
|
|
||||||
Widget get loadingWidget {
|
Widget get loadingWidget {
|
||||||
return Center(child: SizedBox(
|
return const Center(child: SizedBox(
|
||||||
width: 24,
|
width: 24,
|
||||||
height: 24,
|
height: 24,
|
||||||
child: CupertinoActivityIndicator(color: AppColor.colorLoading)));
|
child: CupertinoActivityIndicator(color: AppColor.colorLoading)));
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ mixin MessageDialogActionMixin {
|
|||||||
if (_responsiveUtils.isMobile(context)) {
|
if (_responsiveUtils.isMobile(context)) {
|
||||||
(ConfirmationDialogActionSheetBuilder(context)
|
(ConfirmationDialogActionSheetBuilder(context)
|
||||||
..messageText(message)
|
..messageText(message)
|
||||||
..styleConfirmButton(TextStyle(fontSize: 20, fontWeight: FontWeight.normal, color: Colors.black))
|
..styleConfirmButton(const TextStyle(fontSize: 20, fontWeight: FontWeight.normal, color: Colors.black))
|
||||||
..onCancelAction(AppLocalizations.of(context).cancel, () => popBack())
|
..onCancelAction(AppLocalizations.of(context).cancel, () => popBack())
|
||||||
..onConfirmAction(actionName, () {
|
..onConfirmAction(actionName, () {
|
||||||
popBack();
|
popBack();
|
||||||
@@ -32,20 +32,20 @@ mixin MessageDialogActionMixin {
|
|||||||
context: context,
|
context: context,
|
||||||
barrierColor: AppColor.colorDefaultCupertinoActionSheet,
|
barrierColor: AppColor.colorDefaultCupertinoActionSheet,
|
||||||
builder: (BuildContext context) => PointerInterceptor(child: (ConfirmDialogBuilder(_imagePaths)
|
builder: (BuildContext context) => PointerInterceptor(child: (ConfirmDialogBuilder(_imagePaths)
|
||||||
..key(Key('confirm_dialog_action'))
|
..key(const Key('confirm_dialog_action'))
|
||||||
..title(title ?? '')
|
..title(title ?? '')
|
||||||
..content(message)
|
..content(message)
|
||||||
..addIcon(icon)
|
..addIcon(icon)
|
||||||
..colorConfirmButton(AppColor.colorTextButton)
|
..colorConfirmButton(AppColor.colorTextButton)
|
||||||
..colorCancelButton(AppColor.colorCancelButton)
|
..colorCancelButton(AppColor.colorCancelButton)
|
||||||
..paddingTitle(icon != null ? EdgeInsets.only(top: 34) : EdgeInsets.zero)
|
..paddingTitle(icon != null ? const EdgeInsets.only(top: 34) : EdgeInsets.zero)
|
||||||
..marginIcon(EdgeInsets.zero)
|
..marginIcon(EdgeInsets.zero)
|
||||||
..paddingContent(EdgeInsets.only(left: 44, right: 44, bottom: 24, top: 8))
|
..paddingContent(const EdgeInsets.only(left: 44, right: 44, bottom: 24, top: 8))
|
||||||
..paddingButton(hasCancelButton ? null : EdgeInsets.only(bottom: 16, left: 44, right: 44))
|
..paddingButton(hasCancelButton ? null : const EdgeInsets.only(bottom: 16, left: 44, right: 44))
|
||||||
..styleTitle(TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: Colors.black))
|
..styleTitle(const TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: Colors.black))
|
||||||
..styleContent(TextStyle(fontSize: 14, fontWeight: FontWeight.normal, color: AppColor.colorContentEmail))
|
..styleContent(const TextStyle(fontSize: 14, fontWeight: FontWeight.normal, color: AppColor.colorContentEmail))
|
||||||
..styleTextCancelButton(TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: AppColor.colorTextButton))
|
..styleTextCancelButton(const TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: AppColor.colorTextButton))
|
||||||
..styleTextConfirmButton(TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: Colors.white))
|
..styleTextConfirmButton(const TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: Colors.white))
|
||||||
..onConfirmButtonAction(actionName, () {
|
..onConfirmButtonAction(actionName, () {
|
||||||
popBack();
|
popBack();
|
||||||
onConfirmAction.call();
|
onConfirmAction.call();
|
||||||
|
|||||||
@@ -15,17 +15,17 @@ mixin NetworkConnectionMixin {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(16)),
|
borderRadius: BorderRadius.circular(16)),
|
||||||
width: 320,
|
width: 320,
|
||||||
margin: EdgeInsets.only(bottom: 100),
|
margin: const EdgeInsets.only(bottom: 100),
|
||||||
child: Material(
|
child: Material(
|
||||||
elevation: 8,
|
elevation: 8,
|
||||||
shape: RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(16.0)),
|
borderRadius: BorderRadius.all(Radius.circular(16.0)),
|
||||||
),
|
),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
leading: SvgPicture.asset(_imagePaths.icNotConnection),
|
leading: SvgPicture.asset(_imagePaths.icNotConnection),
|
||||||
title: Text(
|
title: Text(
|
||||||
AppLocalizations.of(context).no_internet_connection,
|
AppLocalizations.of(context).no_internet_connection,
|
||||||
style: TextStyle(fontSize: 15, color: Colors.black)),
|
style: const TextStyle(fontSize: 15, color: Colors.black)),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:path_provider/path_provider.dart' as pathProvider;
|
import 'package:path_provider/path_provider.dart' as path_provider;
|
||||||
import 'package:tmail_ui_user/features/mailbox/data/model/mailbox_cache.dart';
|
import 'package:tmail_ui_user/features/mailbox/data/model/mailbox_cache.dart';
|
||||||
import 'package:tmail_ui_user/features/mailbox/data/model/mailbox_rights_cache.dart';
|
import 'package:tmail_ui_user/features/mailbox/data/model/mailbox_rights_cache.dart';
|
||||||
import 'package:tmail_ui_user/features/mailbox/data/model/state_cache.dart';
|
import 'package:tmail_ui_user/features/mailbox/data/model/state_cache.dart';
|
||||||
@@ -22,7 +22,7 @@ class HiveCacheConfig {
|
|||||||
Hive.init(databasePath);
|
Hive.init(databasePath);
|
||||||
} else {
|
} else {
|
||||||
if (!GetPlatform.isWeb) {
|
if (!GetPlatform.isWeb) {
|
||||||
Directory directory = await pathProvider.getApplicationDocumentsDirectory();
|
Directory directory = await path_provider.getApplicationDocumentsDirectory();
|
||||||
Hive.init(directory.path);
|
Hive.init(directory.path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
|||||||
final _imagePaths = Get.find<ImagePaths>();
|
final _imagePaths = Get.find<ImagePaths>();
|
||||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||||
|
|
||||||
|
DestinationPickerView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
MailboxActions? actions;
|
MailboxActions? actions;
|
||||||
@@ -157,15 +159,15 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
|||||||
|
|
||||||
Widget _buildLoadingView() {
|
Widget _buildLoadingView() {
|
||||||
return Obx(() => controller.viewState.value.fold(
|
return Obx(() => controller.viewState.value.fold(
|
||||||
(failure) => SizedBox.shrink(),
|
(failure) => const SizedBox.shrink(),
|
||||||
(success) => success is LoadingState
|
(success) => success is LoadingState
|
||||||
? Center(child: Padding(
|
? const Center(child: Padding(
|
||||||
padding: EdgeInsets.only(top: 16),
|
padding: EdgeInsets.only(top: 16),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 24,
|
width: 24,
|
||||||
height: 24,
|
height: 24,
|
||||||
child: CircularProgressIndicator(color: AppColor.primaryColor))))
|
child: CircularProgressIndicator(color: AppColor.primaryColor))))
|
||||||
: SizedBox.shrink()));
|
: const SizedBox.shrink()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildListMailbox(BuildContext context, MailboxActions? actions) {
|
Widget _buildListMailbox(BuildContext context, MailboxActions? actions) {
|
||||||
@@ -178,18 +180,18 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
|||||||
if (actions == MailboxActions.create && !BuildUtils.isWeb && _responsiveUtils.isScreenWithShortestSide(context))
|
if (actions == MailboxActions.create && !BuildUtils.isWeb && _responsiveUtils.isScreenWithShortestSide(context))
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
if (actions == MailboxActions.create) _buildUnifiedMailbox(context),
|
if (actions == MailboxActions.create) _buildUnifiedMailbox(context),
|
||||||
SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Obx(() => controller.defaultMailboxTree.value.root.childrenItems?.isNotEmpty ?? false
|
Obx(() => controller.defaultMailboxTree.value.root.childrenItems?.isNotEmpty ?? false
|
||||||
? _buildMailboxCategory(context, MailboxCategories.exchange, controller.defaultMailboxTree.value.root, actions)
|
? _buildMailboxCategory(context, MailboxCategories.exchange, controller.defaultMailboxTree.value.root, actions)
|
||||||
: SizedBox.shrink()),
|
: const SizedBox.shrink()),
|
||||||
if (actions == MailboxActions.create) SizedBox(height: 12),
|
if (actions == MailboxActions.create) const SizedBox(height: 12),
|
||||||
if (actions != MailboxActions.create && !kIsWeb)
|
if (actions != MailboxActions.create && !kIsWeb)
|
||||||
Padding(
|
const Padding(
|
||||||
padding: EdgeInsets.only(left: 60),
|
padding: EdgeInsets.only(left: 60),
|
||||||
child: Divider(color: AppColor.lineItemListColor, height: 0.5, thickness: 0.2)),
|
child: Divider(color: AppColor.lineItemListColor, height: 0.5, thickness: 0.2)),
|
||||||
Obx(() => controller.folderMailboxTree.value.root.childrenItems?.isNotEmpty ?? false
|
Obx(() => controller.folderMailboxTree.value.root.childrenItems?.isNotEmpty ?? false
|
||||||
? _buildMailboxCategory(context, MailboxCategories.folders, controller.folderMailboxTree.value.root, actions)
|
? _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: [
|
return Column(children: [
|
||||||
_buildHeaderMailboxCategory(context, categories),
|
_buildHeaderMailboxCategory(context, categories),
|
||||||
AnimatedContainer(
|
AnimatedContainer(
|
||||||
duration: Duration(milliseconds: 400),
|
duration: const Duration(milliseconds: 400),
|
||||||
child: categories.getExpandMode(controller.mailboxCategoriesExpandMode.value) == ExpandMode.EXPAND
|
child: categories.getExpandMode(controller.mailboxCategoriesExpandMode.value) == ExpandMode.EXPAND
|
||||||
? _buildBodyMailboxCategory(context, categories, mailboxNode, actions)
|
? _buildBodyMailboxCategory(context, categories, mailboxNode, actions)
|
||||||
: Offstage())
|
: const Offstage())
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,7 +219,7 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
|||||||
Expanded(child: Text(categories.getTitle(context),
|
Expanded(child: Text(categories.getTitle(context),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
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(
|
buildIconWeb(
|
||||||
icon: SvgPicture.asset(
|
icon: SvgPicture.asset(
|
||||||
categories.getExpandMode(controller.mailboxCategoriesExpandMode.value) == ExpandMode.EXPAND
|
categories.getExpandMode(controller.mailboxCategoriesExpandMode.value) == ExpandMode.EXPAND
|
||||||
@@ -248,7 +250,7 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
|||||||
?.map((mailboxNode) => mailboxNode.hasChildren()
|
?.map((mailboxNode) => mailboxNode.hasChildren()
|
||||||
? TreeViewChild(
|
? TreeViewChild(
|
||||||
context,
|
context,
|
||||||
key: Key('children_tree_mailbox_child'),
|
key: const Key('children_tree_mailbox_child'),
|
||||||
isExpanded: mailboxNode.expandMode == ExpandMode.EXPAND,
|
isExpanded: mailboxNode.expandMode == ExpandMode.EXPAND,
|
||||||
parent: (MailBoxFolderTileBuilder(context, _imagePaths, mailboxNode,
|
parent: (MailBoxFolderTileBuilder(context, _imagePaths, mailboxNode,
|
||||||
lastNode: lastNode,
|
lastNode: lastNode,
|
||||||
@@ -268,14 +270,14 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
|||||||
Widget _buildListMailboxSearched(BuildContext context) {
|
Widget _buildListMailboxSearched(BuildContext context) {
|
||||||
return Obx(() => Container(
|
return Obx(() => Container(
|
||||||
margin: _responsiveUtils.isDesktop(context)
|
margin: _responsiveUtils.isDesktop(context)
|
||||||
? EdgeInsets.only(left: 16, right: 16)
|
? const EdgeInsets.only(left: 16, right: 16)
|
||||||
: EdgeInsets.zero,
|
: EdgeInsets.zero,
|
||||||
decoration: _responsiveUtils.isDesktop(context)
|
decoration: _responsiveUtils.isDesktop(context)
|
||||||
? BoxDecoration(borderRadius: BorderRadius.circular(14), color: Colors.white)
|
? BoxDecoration(borderRadius: BorderRadius.circular(14), color: Colors.white)
|
||||||
: null,
|
: null,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
padding: EdgeInsets.only(left: 16, right: 8),
|
padding: const EdgeInsets.only(left: 16, right: 8),
|
||||||
key: Key('list_mailbox_searched'),
|
key: const Key('list_mailbox_searched'),
|
||||||
itemCount: controller.listMailboxSearched.length,
|
itemCount: controller.listMailboxSearched.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
primary: false,
|
primary: false,
|
||||||
@@ -299,12 +301,12 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
|||||||
right: 16),
|
right: 16),
|
||||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(14), color: Colors.white),
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(14), color: Colors.white),
|
||||||
child: MediaQuery(
|
child: MediaQuery(
|
||||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
onTap: () => controller.selectMailboxAction(null),
|
onTap: () => controller.selectMailboxAction(null),
|
||||||
leading: Padding(
|
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)),
|
child: SvgPicture.asset(_imagePaths.icFolderMailbox, width: 28, height: 28, fit: BoxFit.fill)),
|
||||||
title: Transform(
|
title: Transform(
|
||||||
transform: Matrix4.translationValues(-5.0, 0.0, 0.0),
|
transform: Matrix4.translationValues(-5.0, 0.0, 0.0),
|
||||||
@@ -314,7 +316,7 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
|||||||
AppLocalizations.of(context).default_mailbox,
|
AppLocalizations.of(context).default_mailbox,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow:TextOverflow.ellipsis,
|
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) {
|
Widget _buildInputSearchFormWidget(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(top: 16, bottom: 16),
|
padding: const EdgeInsets.only(top: 16, bottom: 16),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
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),
|
icon: SvgPicture.asset(_imagePaths.icBack, color: AppColor.colorTextButton, fit: BoxFit.fill),
|
||||||
onTap: () => controller.disableSearch(context))),
|
onTap: () => controller.disableSearch(context))),
|
||||||
Expanded(child: (SearchAppBarWidget(context, _imagePaths, _responsiveUtils,
|
Expanded(child: (SearchAppBarWidget(context, _imagePaths, _responsiveUtils,
|
||||||
@@ -352,7 +354,7 @@ class DestinationPickerView extends GetWidget<DestinationPickerController> {
|
|||||||
hasBackButton: false,
|
hasBackButton: false,
|
||||||
hasSearchButton: true)
|
hasSearchButton: true)
|
||||||
..addPadding(EdgeInsets.zero)
|
..addPadding(EdgeInsets.zero)
|
||||||
..setMargin(EdgeInsets.only(right: 16))
|
..setMargin(const EdgeInsets.only(right: 16))
|
||||||
..addDecoration(BoxDecoration(borderRadius: BorderRadius.circular(12), color: AppColor.colorBgSearchBar))
|
..addDecoration(BoxDecoration(borderRadius: BorderRadius.circular(12), color: AppColor.colorBgSearchBar))
|
||||||
..addIconClearText(SvgPicture.asset(_imagePaths.icClearTextSearch, width: 18, height: 18, fit: BoxFit.fill))
|
..addIconClearText(SvgPicture.asset(_imagePaths.icClearTextSearch, width: 18, height: 18, fit: BoxFit.fill))
|
||||||
..setHintText(AppLocalizations.of(context).hint_search_mailboxes)
|
..setHintText(AppLocalizations.of(context).hint_search_mailboxes)
|
||||||
|
|||||||
+8
-8
@@ -26,14 +26,14 @@ class AppBarDestinationPickerBuilder {
|
|||||||
|
|
||||||
Widget build() {
|
Widget build() {
|
||||||
return Container(
|
return Container(
|
||||||
key: Key('app_bar_destination_picker'),
|
key: const Key('app_bar_destination_picker'),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)),
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)),
|
||||||
color: Colors.white),
|
color: Colors.white),
|
||||||
height: 52,
|
height: 52,
|
||||||
child: MediaQuery(
|
child: MediaQuery(
|
||||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
@@ -49,19 +49,19 @@ class AppBarDestinationPickerBuilder {
|
|||||||
Widget _buildCancelButton() {
|
Widget _buildCancelButton() {
|
||||||
if (_mailboxAction == MailboxActions.moveEmail) {
|
if (_mailboxAction == MailboxActions.moveEmail) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(right: 12),
|
padding: const EdgeInsets.only(right: 12),
|
||||||
child: Material(
|
child: Material(
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
AppLocalizations.of(_context).cancel,
|
AppLocalizations.of(_context).cancel,
|
||||||
style: TextStyle(fontSize: 17, color: AppColor.colorTextButton)),
|
style: const TextStyle(fontSize: 17, color: AppColor.colorTextButton)),
|
||||||
onPressed: () => _onCloseActionClick?.call()
|
onPressed: () => _onCloseActionClick?.call()
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
} else {
|
} 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),
|
icon: SvgPicture.asset(_imagePaths.icBack, color: AppColor.colorTextButton, fit: BoxFit.fill),
|
||||||
onTap: () => _onCloseActionClick?.call());
|
onTap: () => _onCloseActionClick?.call());
|
||||||
} else {
|
} else {
|
||||||
return SizedBox(width: 100, height: 40);
|
return const SizedBox(width: 100, height: 40);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,6 +81,6 @@ class AppBarDestinationPickerBuilder {
|
|||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(fontSize: 20, color: AppColor.colorNameEmail, fontWeight: FontWeight.w700));
|
style: const TextStyle(fontSize: 20, color: AppColor.colorNameEmail, fontWeight: FontWeight.w700));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,7 @@ class EmailAPI {
|
|||||||
|
|
||||||
if (emailRequest.emailIdDestroyed != null) {
|
if (emailRequest.emailIdDestroyed != null) {
|
||||||
setEmailMethod
|
setEmailMethod
|
||||||
..addDestroy({emailRequest.emailIdDestroyed!.id});
|
.addDestroy({emailRequest.emailIdDestroyed!.id});
|
||||||
}
|
}
|
||||||
|
|
||||||
final setEmailSubmissionMethod = SetEmailSubmissionMethod(accountId)
|
final setEmailSubmissionMethod = SetEmailSubmissionMethod(accountId)
|
||||||
@@ -160,7 +160,7 @@ class EmailAPI {
|
|||||||
String baseDownloadUrl,
|
String baseDownloadUrl,
|
||||||
AccountRequest accountRequest
|
AccountRequest accountRequest
|
||||||
) async {
|
) async {
|
||||||
var externalStorageDirPath;
|
String externalStorageDirPath;
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
externalStorageDirPath = await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_DOWNLOADS);
|
externalStorageDirPath = await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_DOWNLOADS);
|
||||||
} else if (Platform.isIOS) {
|
} else if (Platform.isIOS) {
|
||||||
@@ -381,7 +381,7 @@ class EmailAPI {
|
|||||||
Future<bool> deleteEmailPermanently(AccountId accountId, EmailId emailId) async {
|
Future<bool> deleteEmailPermanently(AccountId accountId, EmailId emailId) async {
|
||||||
final requestBuilder = JmapRequestBuilder(_httpClient, ProcessingInvocation());
|
final requestBuilder = JmapRequestBuilder(_httpClient, ProcessingInvocation());
|
||||||
final setEmailMethod = SetEmailMethod(accountId)
|
final setEmailMethod = SetEmailMethod(accountId)
|
||||||
..addDestroy(Set.of([emailId.id]));
|
..addDestroy({emailId.id});
|
||||||
|
|
||||||
final setEmailInvocation = requestBuilder.invocation(setEmailMethod);
|
final setEmailInvocation = requestBuilder.invocation(setEmailMethod);
|
||||||
|
|
||||||
|
|||||||
@@ -78,10 +78,10 @@ class EmailRepositoryImpl extends EmailRepository {
|
|||||||
String? baseUrlDownload,
|
String? baseUrlDownload,
|
||||||
AccountId accountId
|
AccountId accountId
|
||||||
) async {
|
) async {
|
||||||
final mapUrlDownloadCID = Map<String, String>.fromIterable(
|
final mapUrlDownloadCID = {
|
||||||
attachmentInlines,
|
for (var attachment in attachmentInlines)
|
||||||
key: (attachment) => attachment.cid!,
|
attachment.cid! : attachment.getDownloadUrl(baseUrlDownload!, accountId)
|
||||||
value: (attachment) => attachment.getDownloadUrl(baseUrlDownload, accountId));
|
};
|
||||||
return await Future.wait(emailContents
|
return await Future.wait(emailContents
|
||||||
.map((emailContent) async {
|
.map((emailContent) async {
|
||||||
return await _htmlDataSource.transformEmailContent(emailContent, mapUrlDownloadCID);
|
return await _htmlDataSource.transformEmailContent(emailContent, mapUrlDownloadCID);
|
||||||
|
|||||||
@@ -115,11 +115,6 @@ class EmailController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
void onData(Either<Failure, Success> newState) {
|
|
||||||
super.onData(newState);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onDone() {
|
void onDone() {
|
||||||
viewState.value.fold(
|
viewState.value.fold(
|
||||||
@@ -271,7 +266,7 @@ class EmailController extends BaseController {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (_) =>
|
builder: (_) =>
|
||||||
PointerInterceptor(child: (DownloadingFileDialogBuilder()
|
PointerInterceptor(child: (DownloadingFileDialogBuilder()
|
||||||
..key(Key('downloading_file_dialog'))
|
..key(const Key('downloading_file_dialog'))
|
||||||
..title(AppLocalizations.of(context).preparing_to_export)
|
..title(AppLocalizations.of(context).preparing_to_export)
|
||||||
..content(AppLocalizations.of(context).downloading_file(attachment.name ?? ''))
|
..content(AppLocalizations.of(context).downloading_file(attachment.name ?? ''))
|
||||||
..actionText(AppLocalizations.of(context).cancel)
|
..actionText(AppLocalizations.of(context).cancel)
|
||||||
@@ -285,7 +280,7 @@ class EmailController extends BaseController {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (_) =>
|
builder: (_) =>
|
||||||
PointerInterceptor(child: (DownloadingFileDialogBuilder()
|
PointerInterceptor(child: (DownloadingFileDialogBuilder()
|
||||||
..key(Key('downloading_file_for_web_dialog'))
|
..key(const Key('downloading_file_for_web_dialog'))
|
||||||
..title(AppLocalizations.of(context).preparing_to_save)
|
..title(AppLocalizations.of(context).preparing_to_save)
|
||||||
..content(AppLocalizations.of(context).downloading_file(attachment.name ?? '')))
|
..content(AppLocalizations.of(context).downloading_file(attachment.name ?? '')))
|
||||||
.build()));
|
.build()));
|
||||||
@@ -301,7 +296,7 @@ class EmailController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _exportAttachmentFailureAction(Failure failure) {
|
void _exportAttachmentFailureAction(Failure failure) {
|
||||||
if (failure is ExportAttachmentFailure && !(failure.exception is CancelDownloadFileException)) {
|
if (failure is ExportAttachmentFailure && failure.exception is! CancelDownloadFileException) {
|
||||||
popBack();
|
popBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -589,12 +584,12 @@ class EmailController extends BaseController {
|
|||||||
context: context,
|
context: context,
|
||||||
barrierColor: AppColor.colorDefaultCupertinoActionSheet,
|
barrierColor: AppColor.colorDefaultCupertinoActionSheet,
|
||||||
builder: (BuildContext context) => PointerInterceptor(child: (ConfirmDialogBuilder(imagePaths)
|
builder: (BuildContext context) => PointerInterceptor(child: (ConfirmDialogBuilder(imagePaths)
|
||||||
..key(Key('confirm_dialog_delete_email_permanently'))
|
..key(const Key('confirm_dialog_delete_email_permanently'))
|
||||||
..title(DeleteActionType.single.getTitleDialog(context))
|
..title(DeleteActionType.single.getTitleDialog(context))
|
||||||
..content(DeleteActionType.single.getContentDialog(context))
|
..content(DeleteActionType.single.getContentDialog(context))
|
||||||
..addIcon(SvgPicture.asset(imagePaths.icRemoveDialog, fit: BoxFit.fill))
|
..addIcon(SvgPicture.asset(imagePaths.icRemoveDialog, fit: BoxFit.fill))
|
||||||
..colorConfirmButton(AppColor.colorConfirmActionDialog)
|
..colorConfirmButton(AppColor.colorConfirmActionDialog)
|
||||||
..styleTextConfirmButton(TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: AppColor.colorActionDeleteConfirmDialog))
|
..styleTextConfirmButton(const TextStyle(fontSize: 17, fontWeight: FontWeight.w500, color: AppColor.colorActionDeleteConfirmDialog))
|
||||||
..onCloseButtonAction(() => popBack())
|
..onCloseButtonAction(() => popBack())
|
||||||
..onConfirmButtonAction(DeleteActionType.single.getConfirmActionName(context), () => _deleteEmailPermanentlyAction(context, email))
|
..onConfirmButtonAction(DeleteActionType.single.getConfirmActionName(context), () => _deleteEmailPermanentlyAction(context, email))
|
||||||
..onCancelButtonAction(AppLocalizations.of(context).cancel, () => popBack()))
|
..onCancelButtonAction(AppLocalizations.of(context).cancel, () => popBack()))
|
||||||
|
|||||||
@@ -55,16 +55,16 @@ class AttachmentFileTileBuilder {
|
|||||||
splashColor: Colors.transparent ,
|
splashColor: Colors.transparent ,
|
||||||
highlightColor: Colors.transparent),
|
highlightColor: Colors.transparent),
|
||||||
child: Container(
|
child: Container(
|
||||||
key: Key('attach_file_tile'),
|
key: const Key('attach_file_tile'),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
margin: EdgeInsets.only(top:heightItem != null ? 8 : 0),
|
margin: EdgeInsets.only(top:heightItem != null ? 8 : 0),
|
||||||
height: heightItem ?? null,
|
height: heightItem,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border: Border.all(color: AppColor.attachmentFileBorderColor),
|
border: Border.all(color: AppColor.attachmentFileBorderColor),
|
||||||
color: Colors.white),
|
color: Colors.white),
|
||||||
child: MediaQuery(
|
child: MediaQuery(
|
||||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
alignment: AlignmentDirectional.bottomEnd,
|
alignment: AlignmentDirectional.bottomEnd,
|
||||||
children: [
|
children: [
|
||||||
@@ -85,7 +85,7 @@ class AttachmentFileTileBuilder {
|
|||||||
_attachment.name ?? '',
|
_attachment.name ?? '',
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontSize: 12, color: AppColor.attachmentFileNameColor, fontWeight: FontWeight.w500),
|
style: const TextStyle(fontSize: 12, color: AppColor.attachmentFileNameColor, fontWeight: FontWeight.w500),
|
||||||
)),
|
)),
|
||||||
subtitle: _attachment.size != null && _attachment.size?.value != 0
|
subtitle: _attachment.size != null && _attachment.size?.value != 0
|
||||||
? Transform(
|
? Transform(
|
||||||
@@ -94,7 +94,7 @@ class AttachmentFileTileBuilder {
|
|||||||
filesize(_attachment.size?.value),
|
filesize(_attachment.size?.value),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontSize: 12, color: AppColor.attachmentFileSizeColor)))
|
style: const TextStyle(fontSize: 12, color: AppColor.attachmentFileSizeColor)))
|
||||||
: null,
|
: null,
|
||||||
trailing: buttonAction != null
|
trailing: buttonAction != null
|
||||||
? Transform(
|
? Transform(
|
||||||
@@ -134,7 +134,7 @@ class AttachmentFileTileBuilder {
|
|||||||
Container(color: AppColor.backgroundCountAttachment),
|
Container(color: AppColor.backgroundCountAttachment),
|
||||||
Text(
|
Text(
|
||||||
'+${_attachmentSize - _limitDisplayAttachment + 1}',
|
'+${_attachmentSize - _limitDisplayAttachment + 1}',
|
||||||
style: TextStyle(fontSize: 16, color: Colors.white, fontWeight: FontWeight.bold))
|
style: const TextStyle(fontSize: 16, color: Colors.white, fontWeight: FontWeight.bold))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
+9
-9
@@ -23,9 +23,9 @@ Decoration _radiusBoxDecoration({
|
|||||||
return color;
|
return color;
|
||||||
}).toList()
|
}).toList()
|
||||||
: [
|
: [
|
||||||
Color.fromRGBO(0, 0, 0, 0.1),
|
const Color.fromRGBO(0, 0, 0, 0.1),
|
||||||
Color(0x32E5E5E5),
|
const Color(0x32E5E5E5),
|
||||||
Color.fromRGBO(0, 0, 0, 0.1),
|
const Color.fromRGBO(0, 0, 0, 0.1),
|
||||||
],
|
],
|
||||||
stops: [animation.value - 2, animation.value, animation.value + 1]));
|
stops: [animation.value - 2, animation.value, animation.value + 1]));
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ class _AttachmentsPlaceHolderLoadingState extends State<AttachmentsPlaceHolderLo
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_animationController = AnimationController(duration: Duration(seconds: 1), vsync: this)..repeat();
|
_animationController = AnimationController(duration: const Duration(seconds: 1), vsync: this)..repeat();
|
||||||
_animation = Tween<double>(begin: -2, end: 2)
|
_animation = Tween<double>(begin: -2, end: 2)
|
||||||
.animate(CurvedAnimation(curve: Curves.easeInOutSine, parent: _animationController));
|
.animate(CurvedAnimation(curve: Curves.easeInOutSine, parent: _animationController));
|
||||||
}
|
}
|
||||||
@@ -67,13 +67,13 @@ class _AttachmentsPlaceHolderLoadingState extends State<AttachmentsPlaceHolderLo
|
|||||||
animation: _animation,
|
animation: _animation,
|
||||||
builder: (BuildContext context, Widget? child) {
|
builder: (BuildContext context, Widget? child) {
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.only(top: 20),
|
margin: const EdgeInsets.only(top: 20),
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
_placeHolderAttachment(context),
|
_placeHolderAttachment(context),
|
||||||
if (widget.responsiveUtils.isDesktop(context))
|
if (widget.responsiveUtils.isDesktop(context))
|
||||||
SizedBox(width: 16),
|
const SizedBox(width: 16),
|
||||||
if (widget.responsiveUtils.isDesktop(context))
|
if (widget.responsiveUtils.isDesktop(context))
|
||||||
_placeHolderAttachment(context),
|
_placeHolderAttachment(context),
|
||||||
]),
|
]),
|
||||||
@@ -91,7 +91,7 @@ class _AttachmentsPlaceHolderLoadingState extends State<AttachmentsPlaceHolderLo
|
|||||||
height: 55,
|
height: 55,
|
||||||
width: width * percentAttachment,
|
width: width * percentAttachment,
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 16),
|
||||||
decoration: _radiusBoxDecoration(animation: _animation),
|
decoration: _radiusBoxDecoration(animation: _animation),
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@@ -100,14 +100,14 @@ class _AttachmentsPlaceHolderLoadingState extends State<AttachmentsPlaceHolderLo
|
|||||||
height: 24,
|
height: 24,
|
||||||
width: 24,
|
width: 24,
|
||||||
decoration: _radiusBoxDecoration(animation: _animation, radius: 12)),
|
decoration: _radiusBoxDecoration(animation: _animation, radius: 12)),
|
||||||
SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Expanded(child: Column(
|
Expanded(child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
height: 5,
|
height: 5,
|
||||||
decoration: _radiusBoxDecoration(animation: _animation)),
|
decoration: _radiusBoxDecoration(animation: _animation)),
|
||||||
SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Container(
|
Container(
|
||||||
height: 5,
|
height: 5,
|
||||||
decoration: _radiusBoxDecoration(animation: _animation))
|
decoration: _radiusBoxDecoration(animation: _animation))
|
||||||
|
|||||||
@@ -27,12 +27,12 @@ class BottomBarMailWidgetBuilder {
|
|||||||
|
|
||||||
Widget build() {
|
Widget build() {
|
||||||
return Container(
|
return Container(
|
||||||
key: Key('bottom_bar_messenger_widget'),
|
key: const Key('bottom_bar_messenger_widget'),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: MediaQuery(
|
child: MediaQuery(
|
||||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||||
child: _presentationEmail != null ? _buildListOptionButton(_presentationEmail!) : SizedBox.shrink()
|
child: _presentationEmail != null ? _buildListOptionButton(_presentationEmail!) : const SizedBox.shrink()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@ class BottomBarMailWidgetBuilder {
|
|||||||
children: [
|
children: [
|
||||||
if (presentationEmail.numberOfAllEmailAddress() > 1)
|
if (presentationEmail.numberOfAllEmailAddress() > 1)
|
||||||
Expanded(child: (ButtonBuilder(_imagePaths.icReplyAll)
|
Expanded(child: (ButtonBuilder(_imagePaths.icReplyAll)
|
||||||
..key(Key('button_reply_all_message'))
|
..key(const Key('button_reply_all_message'))
|
||||||
..size(15)
|
..size(15)
|
||||||
..paddingIcon(EdgeInsets.only(
|
..paddingIcon(EdgeInsets.only(
|
||||||
top: _responsiveUtils.isMobile(_context) ? 10 : 16,
|
top: _responsiveUtils.isMobile(_context) ? 10 : 16,
|
||||||
@@ -60,7 +60,7 @@ class BottomBarMailWidgetBuilder {
|
|||||||
..text(AppLocalizations.of(_context).reply_all, isVertical: _responsiveUtils.isMobile(_context)))
|
..text(AppLocalizations.of(_context).reply_all, isVertical: _responsiveUtils.isMobile(_context)))
|
||||||
.build()),
|
.build()),
|
||||||
Expanded(child: (ButtonBuilder(_imagePaths.icReply)
|
Expanded(child: (ButtonBuilder(_imagePaths.icReply)
|
||||||
..key(Key('button_reply_message'))
|
..key(const Key('button_reply_message'))
|
||||||
..size(20)
|
..size(20)
|
||||||
..paddingIcon(EdgeInsets.only(
|
..paddingIcon(EdgeInsets.only(
|
||||||
top: _responsiveUtils.isMobile(_context) ? 10 : 16,
|
top: _responsiveUtils.isMobile(_context) ? 10 : 16,
|
||||||
@@ -76,7 +76,7 @@ class BottomBarMailWidgetBuilder {
|
|||||||
..text(AppLocalizations.of(_context).reply, isVertical: _responsiveUtils.isMobile(_context)))
|
..text(AppLocalizations.of(_context).reply, isVertical: _responsiveUtils.isMobile(_context)))
|
||||||
.build()),
|
.build()),
|
||||||
Expanded(child: (ButtonBuilder(_imagePaths.icForward)
|
Expanded(child: (ButtonBuilder(_imagePaths.icForward)
|
||||||
..key(Key('button_forward_message'))
|
..key(const Key('button_forward_message'))
|
||||||
..size(20)
|
..size(20)
|
||||||
..paddingIcon(EdgeInsets.only(
|
..paddingIcon(EdgeInsets.only(
|
||||||
top: _responsiveUtils.isMobile(_context) ? 10 : 16,
|
top: _responsiveUtils.isMobile(_context) ? 10 : 16,
|
||||||
@@ -93,7 +93,7 @@ class BottomBarMailWidgetBuilder {
|
|||||||
.build()),
|
.build()),
|
||||||
if (!_responsiveUtils.isDesktop(_context))
|
if (!_responsiveUtils.isDesktop(_context))
|
||||||
Expanded(child: (ButtonBuilder(_imagePaths.icNewMessage)
|
Expanded(child: (ButtonBuilder(_imagePaths.icNewMessage)
|
||||||
..key(Key('button_new_message'))
|
..key(const Key('button_new_message'))
|
||||||
..size(20)
|
..size(20)
|
||||||
..paddingIcon(EdgeInsets.only(
|
..paddingIcon(EdgeInsets.only(
|
||||||
top: _responsiveUtils.isMobile(_context) ? 10 : 16,
|
top: _responsiveUtils.isMobile(_context) ? 10 : 16,
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ class EmailActionCupertinoActionSheetActionBuilder extends CupertinoActionSheetA
|
|||||||
key: key,
|
key: key,
|
||||||
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: iconLeftPadding ?? EdgeInsets.only(left: 12, right: 16),
|
padding: iconLeftPadding ?? const EdgeInsets.only(left: 12, right: 16),
|
||||||
child: actionIcon),
|
child: actionIcon),
|
||||||
Expanded(child: Text(actionName, textAlign: TextAlign.left, style: actionTextStyle())),
|
Expanded(child: Text(actionName, textAlign: TextAlign.left, style: actionTextStyle())),
|
||||||
]),
|
]),
|
||||||
|
|||||||
@@ -41,18 +41,18 @@ class EmailAddressBottomSheetBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RoundedRectangleBorder _shape() {
|
RoundedRectangleBorder _shape() {
|
||||||
return RoundedRectangleBorder(
|
return const RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: Radius.circular(20.0),
|
topLeft: Radius.circular(20.0),
|
||||||
topRight: Radius.circular(20.0)));
|
topRight: Radius.circular(20.0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
BoxDecoration _decoration(BuildContext context) {
|
BoxDecoration _decoration(BuildContext context) {
|
||||||
return BoxDecoration(
|
return const BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: const Radius.circular(20.0),
|
topLeft: Radius.circular(20.0),
|
||||||
topRight: const Radius.circular(20.0)));
|
topRight: Radius.circular(20.0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void show() {
|
void show() {
|
||||||
@@ -70,27 +70,27 @@ class EmailAddressBottomSheetBuilder {
|
|||||||
Align(
|
Align(
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
padding: EdgeInsets.only(top: 16, right: 16),
|
padding: const EdgeInsets.only(top: 16, right: 16),
|
||||||
onPressed: () => _onCloseBottomSheetAction?.call(),
|
onPressed: () => _onCloseBottomSheetAction?.call(),
|
||||||
icon: SvgPicture.asset(_imagePaths.icCloseMailbox, width: 24, height: 24, fit: BoxFit.fill))),
|
icon: SvgPicture.asset(_imagePaths.icCloseMailbox, width: 24, height: 24, fit: BoxFit.fill))),
|
||||||
(AvatarBuilder()
|
(AvatarBuilder()
|
||||||
..text('${_emailAddress.asString().characters.first.toUpperCase()}')
|
..text(_emailAddress.asString().characters.first.toUpperCase())
|
||||||
..size(64)
|
..size(64)
|
||||||
..addTextStyle(TextStyle(fontWeight: FontWeight.w600, fontSize: 23, color: Colors.white))
|
..addTextStyle(const TextStyle(fontWeight: FontWeight.w600, fontSize: 23, color: Colors.white))
|
||||||
..avatarColor(_emailAddress.avatarColors))
|
..avatarColor(_emailAddress.avatarColors))
|
||||||
.build(),
|
.build(),
|
||||||
if (_emailAddress.displayName.isNotEmpty)
|
if (_emailAddress.displayName.isNotEmpty)
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(left: 16, right: 16, top: 16),
|
padding: const EdgeInsets.only(left: 16, right: 16, top: 16),
|
||||||
child: Text(
|
child: Text(
|
||||||
_emailAddress.asString(),
|
_emailAddress.asString(),
|
||||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: AppColor.colorNameEmail),
|
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: AppColor.colorNameEmail),
|
||||||
)),
|
)),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(left: 16, right: 16, top: _emailAddress.displayName.isNotEmpty ? 12 : 16),
|
padding: EdgeInsets.only(left: 16, right: 16, top: _emailAddress.displayName.isNotEmpty ? 12 : 16),
|
||||||
child: Text(
|
child: Text(
|
||||||
_emailAddress.emailAddress,
|
_emailAddress.emailAddress,
|
||||||
style: TextStyle(fontSize: 17, fontWeight: FontWeight.normal, color: AppColor.colorMessageConfirmDialog),
|
style: const TextStyle(fontSize: 17, fontWeight: FontWeight.normal, color: AppColor.colorMessageConfirmDialog),
|
||||||
)),
|
)),
|
||||||
Material(
|
Material(
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
@@ -98,16 +98,16 @@ class EmailAddressBottomSheetBuilder {
|
|||||||
child: TextButton(
|
child: TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
AppLocalizations.of(_context).copy_email_address,
|
AppLocalizations.of(_context).copy_email_address,
|
||||||
style: TextStyle(fontSize: 13, color: AppColor.colorTextButton, fontWeight: FontWeight.normal),
|
style: const TextStyle(fontSize: 13, color: AppColor.colorTextButton, fontWeight: FontWeight.normal),
|
||||||
),
|
),
|
||||||
onPressed: () => _onCopyEmailAddressAction?.call(_emailAddress)
|
onPressed: () => _onCopyEmailAddressAction?.call(_emailAddress)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
SizedBox(height: _emailAddress.displayName.isNotEmpty ? 100 : 130),
|
SizedBox(height: _emailAddress.displayName.isNotEmpty ? 100 : 130),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(left: 16, right: 16, bottom: 20),
|
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 20),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
key: Key('compose_email_button'),
|
key: const Key('compose_email_button'),
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 48,
|
height: 48,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
@@ -116,8 +116,8 @@ class EmailAddressBottomSheetBuilder {
|
|||||||
backgroundColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) => AppColor.colorTextButton),
|
backgroundColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) => AppColor.colorTextButton),
|
||||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
side: BorderSide(width: 0, color: AppColor.colorTextButton)))),
|
side: const BorderSide(width: 0, color: AppColor.colorTextButton)))),
|
||||||
child: Text(AppLocalizations.of(_context).compose_email, style: TextStyle(fontSize: 16, color: Colors.white, fontWeight: FontWeight.w500)),
|
child: Text(AppLocalizations.of(_context).compose_email, style: const TextStyle(fontSize: 16, color: Colors.white, fontWeight: FontWeight.w500)),
|
||||||
onPressed: () => _onComposeEmailAction?.call(_emailAddress)),
|
onPressed: () => _onComposeEmailAction?.call(_emailAddress)),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -40,13 +40,13 @@ class EmailAddressDialogBuilder {
|
|||||||
|
|
||||||
Widget build() {
|
Widget build() {
|
||||||
return Dialog(
|
return Dialog(
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16))),
|
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16))),
|
||||||
insetPadding: EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0),
|
insetPadding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
width: 400,
|
width: 400,
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(16))),
|
borderRadius: BorderRadius.all(Radius.circular(16))),
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
@@ -54,48 +54,48 @@ class EmailAddressDialogBuilder {
|
|||||||
Align(
|
Align(
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
padding: EdgeInsets.only(top: 16, right: 16),
|
padding: const EdgeInsets.only(top: 16, right: 16),
|
||||||
onPressed: () => _onCloseDialogAction?.call(),
|
onPressed: () => _onCloseDialogAction?.call(),
|
||||||
icon: SvgPicture.asset(_imagePaths.icCloseMailbox, width: 24, height: 24, fit: BoxFit.fill))),
|
icon: SvgPicture.asset(_imagePaths.icCloseMailbox, width: 24, height: 24, fit: BoxFit.fill))),
|
||||||
Padding(padding: EdgeInsets.symmetric(horizontal: 16),
|
Padding(padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: Center(child: (AvatarBuilder()
|
child: Center(child: (AvatarBuilder()
|
||||||
..text('${_emailAddress.asString().characters.first.toUpperCase()}')
|
..text(_emailAddress.asString().characters.first.toUpperCase())
|
||||||
..size(64)
|
..size(64)
|
||||||
..addTextStyle(TextStyle(fontWeight: FontWeight.w600, fontSize: 23, color: Colors.white))
|
..addTextStyle(const TextStyle(fontWeight: FontWeight.w600, fontSize: 23, color: Colors.white))
|
||||||
..avatarColor(_emailAddress.avatarColors))
|
..avatarColor(_emailAddress.avatarColors))
|
||||||
.build())),
|
.build())),
|
||||||
if (_emailAddress.displayName.isNotEmpty)
|
if (_emailAddress.displayName.isNotEmpty)
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(left: 16, right: 16, top: 16),
|
padding: const EdgeInsets.only(left: 16, right: 16, top: 16),
|
||||||
child: Center(child: Text(
|
child: Center(child: Text(
|
||||||
_emailAddress.asString(),
|
_emailAddress.asString(),
|
||||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: AppColor.colorNameEmail),
|
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: AppColor.colorNameEmail),
|
||||||
))
|
))
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(left: 16, right: 16, top: _emailAddress.displayName.isNotEmpty ? 12 : 16),
|
padding: EdgeInsets.only(left: 16, right: 16, top: _emailAddress.displayName.isNotEmpty ? 12 : 16),
|
||||||
child: Center(child: Text(
|
child: Center(child: Text(
|
||||||
_emailAddress.emailAddress,
|
_emailAddress.emailAddress,
|
||||||
style: TextStyle(fontSize: 17, fontWeight: FontWeight.normal, color: AppColor.colorMessageConfirmDialog),
|
style: const TextStyle(fontSize: 17, fontWeight: FontWeight.normal, color: AppColor.colorMessageConfirmDialog),
|
||||||
))
|
))
|
||||||
),
|
),
|
||||||
Padding(padding: EdgeInsets.symmetric(horizontal: 16),
|
Padding(padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: Center(child: Material(
|
child: Center(child: Material(
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
AppLocalizations.of(_context).copy_email_address,
|
AppLocalizations.of(_context).copy_email_address,
|
||||||
style: TextStyle(fontSize: 13, color: AppColor.colorTextButton, fontWeight: FontWeight.normal),
|
style: const TextStyle(fontSize: 13, color: AppColor.colorTextButton, fontWeight: FontWeight.normal),
|
||||||
),
|
),
|
||||||
onPressed: () => _onCopyEmailAddressAction?.call(_emailAddress)
|
onPressed: () => _onCopyEmailAddressAction?.call(_emailAddress)
|
||||||
)
|
)
|
||||||
))),
|
))),
|
||||||
SizedBox(height: _emailAddress.displayName.isNotEmpty ? 100 : 130),
|
SizedBox(height: _emailAddress.displayName.isNotEmpty ? 100 : 130),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(left: 16, right: 16, bottom: 20),
|
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 20),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
key: Key('compose_email_button'),
|
key: const Key('compose_email_button'),
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 48,
|
height: 48,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
@@ -104,8 +104,8 @@ class EmailAddressDialogBuilder {
|
|||||||
backgroundColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) => AppColor.colorTextButton),
|
backgroundColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) => AppColor.colorTextButton),
|
||||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
side: BorderSide(width: 0, color: AppColor.colorTextButton)))),
|
side: const BorderSide(width: 0, color: AppColor.colorTextButton)))),
|
||||||
child: Text(AppLocalizations.of(_context).compose_email, style: TextStyle(fontSize: 16, color: Colors.white, fontWeight: FontWeight.w500)),
|
child: Text(AppLocalizations.of(_context).compose_email, style: const TextStyle(fontSize: 16, color: Colors.white, fontWeight: FontWeight.w500)),
|
||||||
onPressed: () => _onComposeEmailAction?.call(_emailAddress)),
|
onPressed: () => _onComposeEmailAction?.call(_emailAddress)),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
+9
-9
@@ -23,9 +23,9 @@ Decoration _radiusBoxDecoration({
|
|||||||
return color;
|
return color;
|
||||||
}).toList()
|
}).toList()
|
||||||
: [
|
: [
|
||||||
Color.fromRGBO(0, 0, 0, 0.1),
|
const Color.fromRGBO(0, 0, 0, 0.1),
|
||||||
Color(0x32E5E5E5),
|
const Color(0x32E5E5E5),
|
||||||
Color.fromRGBO(0, 0, 0, 0.1),
|
const Color.fromRGBO(0, 0, 0, 0.1),
|
||||||
],
|
],
|
||||||
stops: [animation.value - 2, animation.value, animation.value + 1]));
|
stops: [animation.value - 2, animation.value, animation.value + 1]));
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ class _EmailContentPlaceHolderLoadingState extends State<EmailContentPlaceHolder
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_animationController = AnimationController(duration: Duration(seconds: 1), vsync: this)..repeat();
|
_animationController = AnimationController(duration: const Duration(seconds: 1), vsync: this)..repeat();
|
||||||
_animation = Tween<double>(begin: -2, end: 2)
|
_animation = Tween<double>(begin: -2, end: 2)
|
||||||
.animate(CurvedAnimation(curve: Curves.easeInOutSine, parent: _animationController));
|
.animate(CurvedAnimation(curve: Curves.easeInOutSine, parent: _animationController));
|
||||||
}
|
}
|
||||||
@@ -67,22 +67,22 @@ class _EmailContentPlaceHolderLoadingState extends State<EmailContentPlaceHolder
|
|||||||
animation: _animation,
|
animation: _animation,
|
||||||
builder: (BuildContext context, Widget? child) {
|
builder: (BuildContext context, Widget? child) {
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.only(top: 16),
|
margin: const EdgeInsets.only(top: 16),
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(right: 64),
|
margin: const EdgeInsets.only(right: 64),
|
||||||
height: 10,
|
height: 10,
|
||||||
decoration: _radiusBoxDecoration(animation: _animation, radius: 5)),
|
decoration: _radiusBoxDecoration(animation: _animation, radius: 5)),
|
||||||
SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Container(
|
Container(
|
||||||
height: 10,
|
height: 10,
|
||||||
decoration: _radiusBoxDecoration(animation: _animation, radius: 5)),
|
decoration: _radiusBoxDecoration(animation: _animation, radius: 5)),
|
||||||
SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(right: 128),
|
margin: const EdgeInsets.only(right: 128),
|
||||||
height: 10,
|
height: 10,
|
||||||
decoration: _radiusBoxDecoration(animation: _animation, radius: 5)),
|
decoration: _radiusBoxDecoration(animation: _animation, radius: 5)),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -14,11 +14,6 @@ import 'package:tmail_ui_user/main/utils/email_receive_manager.dart';
|
|||||||
|
|
||||||
class HomeBindings extends BaseBindings {
|
class HomeBindings extends BaseBindings {
|
||||||
|
|
||||||
@override
|
|
||||||
void dependencies() {
|
|
||||||
super.dependencies();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void bindingsController() {
|
void bindingsController() {
|
||||||
Get.lazyPut(() => HomeController(
|
Get.lazyPut(() => HomeController(
|
||||||
|
|||||||
@@ -4,12 +4,13 @@ import 'package:get/get.dart';
|
|||||||
import 'package:tmail_ui_user/features/home/presentation/home_controller.dart';
|
import 'package:tmail_ui_user/features/home/presentation/home_controller.dart';
|
||||||
|
|
||||||
class HomeView extends GetWidget<HomeController> {
|
class HomeView extends GetWidget<HomeController> {
|
||||||
|
const HomeView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
color: AppColor.primaryLightColor,
|
color: AppColor.primaryLightColor,
|
||||||
child: SizedBox(
|
child: const SizedBox(
|
||||||
width: 100,
|
width: 100,
|
||||||
height: 100,
|
height: 100,
|
||||||
child: CupertinoActivityIndicator(),
|
child: CupertinoActivityIndicator(),
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import 'package:equatable/equatable.dart';
|
import 'package:equatable/equatable.dart';
|
||||||
|
|
||||||
abstract class AuthenticationException extends Equatable {
|
abstract class AuthenticationException extends Equatable {
|
||||||
static final wrongCredential = 'Credential is wrong';
|
static const wrongCredential = 'Credential is wrong';
|
||||||
|
|
||||||
AuthenticationException(String message);
|
const AuthenticationException(String message);
|
||||||
}
|
}
|
||||||
|
|
||||||
class BadCredentials extends AuthenticationException {
|
class BadCredentials extends AuthenticationException {
|
||||||
BadCredentials() : super(AuthenticationException.wrongCredential);
|
const BadCredentials() : super(AuthenticationException.wrongCredential);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [];
|
List<Object> get props => [];
|
||||||
|
|||||||
@@ -13,11 +13,6 @@ import 'package:tmail_ui_user/features/login/presentation/login_controller.dart'
|
|||||||
|
|
||||||
class LoginBindings extends BaseBindings {
|
class LoginBindings extends BaseBindings {
|
||||||
|
|
||||||
@override
|
|
||||||
void dependencies() {
|
|
||||||
super.dependencies();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void bindingsController() {
|
void bindingsController() {
|
||||||
Get.lazyPut(() => LoginController(
|
Get.lazyPut(() => LoginController(
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ class LoginView extends GetWidget<LoginController> {
|
|||||||
final responsiveUtils = Get.find<ResponsiveUtils>();
|
final responsiveUtils = Get.find<ResponsiveUtils>();
|
||||||
final keyboardUtils = Get.find<KeyboardUtils>();
|
final keyboardUtils = Get.find<KeyboardUtils>();
|
||||||
|
|
||||||
|
LoginView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@@ -30,7 +32,7 @@ class LoginView extends GetWidget<LoginController> {
|
|||||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
||||||
child: Container(
|
child: Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
padding: EdgeInsets.only(top: 40),
|
padding: const EdgeInsets.only(top: 40),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
@@ -58,18 +60,18 @@ class LoginView extends GetWidget<LoginController> {
|
|||||||
return (SloganBuilder()
|
return (SloganBuilder()
|
||||||
..setSloganText(AppLocalizations.of(context).login_text_slogan)
|
..setSloganText(AppLocalizations.of(context).login_text_slogan)
|
||||||
..setSloganTextAlign(TextAlign.center)
|
..setSloganTextAlign(TextAlign.center)
|
||||||
..setSloganTextStyle(TextStyle(color: AppColor.primaryColor, fontSize: 16, fontWeight: FontWeight.w700))
|
..setSloganTextStyle(const TextStyle(color: AppColor.primaryColor, fontSize: 16, fontWeight: FontWeight.w700))
|
||||||
..setLogo(imagePaths.icLogoTMail))
|
..setLogo(imagePaths.icLogoTMail))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildLoginMessage(BuildContext context, LoginState loginState) {
|
Widget _buildLoginMessage(BuildContext context, LoginState loginState) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(bottom: 24, top: 60),
|
padding: const EdgeInsets.only(bottom: 24, top: 60),
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: responsiveUtils.getWidthLoginTextField(context),
|
width: responsiveUtils.getWidthLoginTextField(context),
|
||||||
child: CenterTextBuilder()
|
child: CenterTextBuilder()
|
||||||
.key(Key('login_message'))
|
.key(const Key('login_message'))
|
||||||
.text(loginState.viewState.fold(
|
.text(loginState.viewState.fold(
|
||||||
(failure) => failure is AuthenticationUserFailure
|
(failure) => failure is AuthenticationUserFailure
|
||||||
? AppLocalizations.of(context).unknown_error_login_message
|
? AppLocalizations.of(context).unknown_error_login_message
|
||||||
@@ -88,11 +90,11 @@ class LoginView extends GetWidget<LoginController> {
|
|||||||
|
|
||||||
Widget _buildUrlInput(BuildContext context) {
|
Widget _buildUrlInput(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(bottom: 16),
|
padding: const EdgeInsets.only(bottom: 16),
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: responsiveUtils.getWidthLoginTextField(context),
|
width: responsiveUtils.getWidthLoginTextField(context),
|
||||||
child: (TextFieldBuilder()
|
child: (TextFieldBuilder()
|
||||||
..key(Key('login_url_input'))
|
..key(const Key('login_url_input'))
|
||||||
..onChange((value) => loginController.formatUrl(value))
|
..onChange((value) => loginController.formatUrl(value))
|
||||||
..textInputAction(TextInputAction.next)
|
..textInputAction(TextInputAction.next)
|
||||||
..addController(loginController.urlInputController)
|
..addController(loginController.urlInputController)
|
||||||
@@ -106,11 +108,11 @@ class LoginView extends GetWidget<LoginController> {
|
|||||||
|
|
||||||
Widget _buildUserNameInput(BuildContext context) {
|
Widget _buildUserNameInput(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(bottom: 16),
|
padding: const EdgeInsets.only(bottom: 16),
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: responsiveUtils.getWidthLoginTextField(context),
|
width: responsiveUtils.getWidthLoginTextField(context),
|
||||||
child: (TextFieldBuilder()
|
child: (TextFieldBuilder()
|
||||||
..key(Key('login_username_input'))
|
..key(const Key('login_username_input'))
|
||||||
..onChange((value) => loginController.setUserNameText(value))
|
..onChange((value) => loginController.setUserNameText(value))
|
||||||
..textInputAction(TextInputAction.next)
|
..textInputAction(TextInputAction.next)
|
||||||
..keyboardType(TextInputType.emailAddress)
|
..keyboardType(TextInputType.emailAddress)
|
||||||
@@ -123,11 +125,11 @@ class LoginView extends GetWidget<LoginController> {
|
|||||||
|
|
||||||
Widget _buildPasswordInput(BuildContext context) {
|
Widget _buildPasswordInput(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(bottom: 40),
|
padding: const EdgeInsets.only(bottom: 40),
|
||||||
child: Container(
|
child: SizedBox(
|
||||||
width: responsiveUtils.getWidthLoginTextField(context),
|
width: responsiveUtils.getWidthLoginTextField(context),
|
||||||
child: (TextFieldBuilder()
|
child: (TextFieldBuilder()
|
||||||
..key(Key('login_password_input'))
|
..key(const Key('login_password_input'))
|
||||||
..obscureText(true)
|
..obscureText(true)
|
||||||
..onChange((value) => loginController.setPasswordText(value))
|
..onChange((value) => loginController.setPasswordText(value))
|
||||||
..textInputAction(TextInputAction.done)
|
..textInputAction(TextInputAction.done)
|
||||||
@@ -140,9 +142,9 @@ class LoginView extends GetWidget<LoginController> {
|
|||||||
|
|
||||||
Widget _buildLoginButton(BuildContext context) {
|
Widget _buildLoginButton(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(bottom: 16),
|
padding: const EdgeInsets.only(bottom: 16),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
key: Key('login_confirm_button'),
|
key: const Key('login_confirm_button'),
|
||||||
width: responsiveUtils.getWidthLoginButton(),
|
width: responsiveUtils.getWidthLoginButton(),
|
||||||
height: 48,
|
height: 48,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
@@ -151,8 +153,8 @@ class LoginView extends GetWidget<LoginController> {
|
|||||||
backgroundColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) => AppColor.buttonColor),
|
backgroundColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) => AppColor.buttonColor),
|
||||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
shape: MaterialStateProperty.all(RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(80),
|
borderRadius: BorderRadius.circular(80),
|
||||||
side: BorderSide(width: 0, color: AppColor.buttonColor)))),
|
side: const BorderSide(width: 0, color: AppColor.buttonColor)))),
|
||||||
child: Text(AppLocalizations.of(context).login, style: TextStyle(fontSize: 16, color: Colors.white)),
|
child: Text(AppLocalizations.of(context).login, style: const TextStyle(fontSize: 16, color: Colors.white)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
keyboardUtils.hideKeyboard(context);
|
keyboardUtils.hideKeyboard(context);
|
||||||
loginController.handleLoginPressed();
|
loginController.handleLoginPressed();
|
||||||
@@ -162,7 +164,7 @@ class LoginView extends GetWidget<LoginController> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildLoadingCircularProgress() {
|
Widget _buildLoadingCircularProgress() {
|
||||||
return SizedBox(
|
return const SizedBox(
|
||||||
key: Key('login_loading_icon'),
|
key: Key('login_loading_icon'),
|
||||||
width: 40,
|
width: 40,
|
||||||
height: 40,
|
height: 40,
|
||||||
|
|||||||
@@ -7,22 +7,22 @@ class LoginInputDecorationBuilder extends InputDecorationBuilder {
|
|||||||
@override
|
@override
|
||||||
InputDecoration build() {
|
InputDecoration build() {
|
||||||
return InputDecoration(
|
return InputDecoration(
|
||||||
enabledBorder: enabledBorder ?? OutlineInputBorder(
|
enabledBorder: enabledBorder ?? const OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(29)),
|
borderRadius: BorderRadius.all(Radius.circular(29)),
|
||||||
borderSide: BorderSide(width: 1, color: AppColor.textFieldBorderColor)),
|
borderSide: BorderSide(width: 1, color: AppColor.textFieldBorderColor)),
|
||||||
focusedBorder: enabledBorder ?? OutlineInputBorder(
|
focusedBorder: enabledBorder ?? const OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(29)),
|
borderRadius: BorderRadius.all(Radius.circular(29)),
|
||||||
borderSide: BorderSide(width: 2, color: AppColor.textFieldFocusedBorderColor)),
|
borderSide: BorderSide(width: 2, color: AppColor.textFieldFocusedBorderColor)),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: const OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(29)),
|
borderRadius: BorderRadius.all(Radius.circular(29)),
|
||||||
borderSide: BorderSide(width: 1, color: AppColor.textFieldErrorBorderColor)),
|
borderSide: BorderSide(width: 1, color: AppColor.textFieldErrorBorderColor)),
|
||||||
prefixText: prefixText,
|
prefixText: prefixText,
|
||||||
labelText: labelText,
|
labelText: labelText,
|
||||||
floatingLabelBehavior: FloatingLabelBehavior.never,
|
floatingLabelBehavior: FloatingLabelBehavior.never,
|
||||||
labelStyle: labelStyle ?? TextStyle(color: AppColor.textFieldLabelColor, fontSize: 16),
|
labelStyle: labelStyle ?? const TextStyle(color: AppColor.textFieldLabelColor, fontSize: 16),
|
||||||
hintText: hintText,
|
hintText: hintText,
|
||||||
hintStyle: hintStyle ?? TextStyle(color: AppColor.textFieldHintColor, fontSize: 16),
|
hintStyle: hintStyle ?? const TextStyle(color: AppColor.textFieldHintColor, fontSize: 16),
|
||||||
contentPadding: contentPadding ?? EdgeInsets.only(left: 25, top: 15, bottom: 15, right: 25),
|
contentPadding: contentPadding ?? const EdgeInsets.only(left: 25, top: 15, bottom: 15, right: 25),
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: AppColor.textFieldBorderColor);
|
fillColor: AppColor.textFieldBorderColor);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,31 +2,31 @@
|
|||||||
import 'package:equatable/equatable.dart';
|
import 'package:equatable/equatable.dart';
|
||||||
|
|
||||||
abstract class VerifyNameException extends Equatable implements Exception {
|
abstract class VerifyNameException extends Equatable implements Exception {
|
||||||
static const EmptyName = 'The name cannot be empty!';
|
static const emptyName = 'The name cannot be empty!';
|
||||||
static const DuplicatedName = 'The name already exists!';
|
static const duplicatedName = 'The name already exists!';
|
||||||
static const NameContainSpecialCharacter = 'The name cannot contain special characters';
|
static const nameContainSpecialCharacter = 'The name cannot contain special characters';
|
||||||
|
|
||||||
final String? message;
|
final String? message;
|
||||||
|
|
||||||
VerifyNameException(this.message);
|
const VerifyNameException(this.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
class EmptyNameException extends VerifyNameException {
|
class EmptyNameException extends VerifyNameException {
|
||||||
EmptyNameException() : super(VerifyNameException.EmptyName);
|
const EmptyNameException() : super(VerifyNameException.emptyName);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [];
|
List<Object> get props => [];
|
||||||
}
|
}
|
||||||
|
|
||||||
class DuplicatedNameException extends VerifyNameException {
|
class DuplicatedNameException extends VerifyNameException {
|
||||||
DuplicatedNameException() : super(VerifyNameException.DuplicatedName);
|
const DuplicatedNameException() : super(VerifyNameException.duplicatedName);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [];
|
List<Object> get props => [];
|
||||||
}
|
}
|
||||||
|
|
||||||
class SpecialCharacterException extends VerifyNameException {
|
class SpecialCharacterException extends VerifyNameException {
|
||||||
SpecialCharacterException() : super(VerifyNameException.NameContainSpecialCharacter);
|
const SpecialCharacterException() : super(VerifyNameException.nameContainSpecialCharacter);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [];
|
List<Object> get props => [];
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ class DuplicateNameValidator extends Validator<NewNameRequest> {
|
|||||||
.map((nameItem) => nameItem.toLowerCase())
|
.map((nameItem) => nameItem.toLowerCase())
|
||||||
.contains(newNameRequest.value!.toLowerCase());
|
.contains(newNameRequest.value!.toLowerCase());
|
||||||
if (nameExist) {
|
if (nameExist) {
|
||||||
return Left<Failure, Success>(VerifyNameFailure(DuplicatedNameException()));
|
return Left<Failure, Success>(VerifyNameFailure(const DuplicatedNameException()));
|
||||||
} else {
|
} else {
|
||||||
return Right<Failure, Success>(VerifyNameViewState());
|
return Right<Failure, Success>(VerifyNameViewState());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class EmptyNameValidator extends Validator<NewNameRequest> {
|
|||||||
@override
|
@override
|
||||||
Either<Failure, Success> validate(NewNameRequest newNameRequest) {
|
Either<Failure, Success> validate(NewNameRequest newNameRequest) {
|
||||||
if (newNameRequest.value == null || newNameRequest.value!.isEmpty) {
|
if (newNameRequest.value == null || newNameRequest.value!.isEmpty) {
|
||||||
return Left<Failure, Success>(VerifyNameFailure(EmptyNameException()));
|
return Left<Failure, Success>(VerifyNameFailure(const EmptyNameException()));
|
||||||
} else {
|
} else {
|
||||||
return Right<Failure, Success>(VerifyNameViewState());
|
return Right<Failure, Success>(VerifyNameViewState());
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ class SpecialCharacterValidator extends Validator<NewNameRequest> {
|
|||||||
@override
|
@override
|
||||||
Either<Failure, Success> validate(NewNameRequest newNameRequest) {
|
Either<Failure, Success> validate(NewNameRequest newNameRequest) {
|
||||||
if (newNameRequest.value != null && newNameRequest.value!.hasSpecialCharactersInName()) {
|
if (newNameRequest.value != null && newNameRequest.value!.hasSpecialCharactersInName()) {
|
||||||
return Left<Failure, Success>(VerifyNameFailure(SpecialCharacterException()));
|
return Left<Failure, Success>(VerifyNameFailure(const SpecialCharacterException()));
|
||||||
} else {
|
} else {
|
||||||
return Right<Failure, Success>(VerifyNameViewState());
|
return Right<Failure, Success>(VerifyNameViewState());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,11 +5,6 @@ import 'package:tmail_ui_user/features/mailbox_creator/presentation/mailbox_crea
|
|||||||
|
|
||||||
class MailboxCreatorBindings extends BaseBindings {
|
class MailboxCreatorBindings extends BaseBindings {
|
||||||
|
|
||||||
@override
|
|
||||||
void dependencies() {
|
|
||||||
super.dependencies();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void bindingsController() {
|
void bindingsController() {
|
||||||
Get.lazyPut(() => MailboxCreatorController(
|
Get.lazyPut(() => MailboxCreatorController(
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
import 'package:core/core.dart';
|
import 'package:core/core.dart';
|
||||||
import 'package:dartz/dartz.dart';
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||||
@@ -56,11 +55,6 @@ class MailboxCreatorController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
void onData(Either<Failure, Success> newState) {
|
|
||||||
super.onData(newState);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onDone() {
|
void onDone() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class MailboxCreatorView extends GetWidget<MailboxCreatorController> {
|
|||||||
|
|
||||||
Widget _buildAppBar(BuildContext context) {
|
Widget _buildAppBar(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(top: 5),
|
padding: const EdgeInsets.only(top: 5),
|
||||||
child: Obx(() => (AppBarMailboxCreatorBuilder(
|
child: Obx(() => (AppBarMailboxCreatorBuilder(
|
||||||
context,
|
context,
|
||||||
title: AppLocalizations.of(context).new_mailbox,
|
title: AppLocalizations.of(context).new_mailbox,
|
||||||
@@ -90,13 +90,13 @@ class MailboxCreatorView extends GetWidget<MailboxCreatorController> {
|
|||||||
|
|
||||||
Widget _buildCreateMailboxNameInput(BuildContext context) {
|
Widget _buildCreateMailboxNameInput(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||||
child: Obx(() => (TextFieldBuilder()
|
child: Obx(() => (TextFieldBuilder()
|
||||||
..key(Key('create_mailbox_name_input'))
|
..key(const Key('create_mailbox_name_input'))
|
||||||
..onChange((value) => controller.setNewNameMailbox(value))
|
..onChange((value) => controller.setNewNameMailbox(value))
|
||||||
..keyboardType(TextInputType.visiblePassword)
|
..keyboardType(TextInputType.visiblePassword)
|
||||||
..cursorColor(AppColor.colorTextButton)
|
..cursorColor(AppColor.colorTextButton)
|
||||||
..textStyle(TextStyle(color: AppColor.colorNameEmail, fontSize: 16))
|
..textStyle(const TextStyle(color: AppColor.colorNameEmail, fontSize: 16))
|
||||||
..addFocusNode(controller.nameInputFocusNode)
|
..addFocusNode(controller.nameInputFocusNode)
|
||||||
..textDecoration((CreateMailboxNameInputDecorationBuilder()
|
..textDecoration((CreateMailboxNameInputDecorationBuilder()
|
||||||
..setHintText(AppLocalizations.of(context).hint_input_create_new_mailbox)
|
..setHintText(AppLocalizations.of(context).hint_input_create_new_mailbox)
|
||||||
@@ -109,26 +109,26 @@ class MailboxCreatorView extends GetWidget<MailboxCreatorController> {
|
|||||||
Widget _buildMailboxLocation(BuildContext context) {
|
Widget _buildMailboxLocation(BuildContext context) {
|
||||||
return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(left: 24, right: 16, top: 16),
|
padding: const EdgeInsets.only(left: 24, right: 16, top: 16),
|
||||||
child: Text(
|
child: Text(
|
||||||
AppLocalizations.of(context).mailbox_location.toUpperCase(),
|
AppLocalizations.of(context).mailbox_location.toUpperCase(),
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
style: TextStyle(fontSize: 13, color: AppColor.colorHintSearchBar)),
|
style: const TextStyle(fontSize: 13, color: AppColor.colorHintSearchBar)),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(14),
|
borderRadius: BorderRadius.circular(14),
|
||||||
color: Colors.white
|
color: Colors.white
|
||||||
),
|
),
|
||||||
child: MediaQuery(
|
child: MediaQuery(
|
||||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
onTap: () => controller.selectMailboxLocation(context),
|
onTap: () => controller.selectMailboxLocation(context),
|
||||||
leading: Padding(
|
leading: Padding(
|
||||||
padding: EdgeInsets.only(left: 16),
|
padding: const EdgeInsets.only(left: 16),
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
_imagePaths.icFolderMailbox,
|
_imagePaths.icFolderMailbox,
|
||||||
width: 28,
|
width: 28,
|
||||||
@@ -138,7 +138,7 @@ class MailboxCreatorView extends GetWidget<MailboxCreatorController> {
|
|||||||
transform: Matrix4.translationValues(-5.0, 0.0, 0.0),
|
transform: Matrix4.translationValues(-5.0, 0.0, 0.0),
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
Expanded(child: Obx(() => Text(
|
Expanded(child: Obx(() => Text(
|
||||||
'${controller.selectedMailbox.value?.name?.name ?? AppLocalizations.of(context).default_mailbox}',
|
controller.selectedMailbox.value?.name?.name ?? AppLocalizations.of(context).default_mailbox,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow:TextOverflow.ellipsis,
|
overflow:TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
+7
-7
@@ -32,14 +32,14 @@ class AppBarMailboxCreatorBuilder {
|
|||||||
|
|
||||||
Widget build() {
|
Widget build() {
|
||||||
return Container(
|
return Container(
|
||||||
key: Key('app_bar_mailbox_creator'),
|
key: const Key('app_bar_mailbox_creator'),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)),
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)),
|
||||||
color: AppColor.colorBgMailbox),
|
color: AppColor.colorBgMailbox),
|
||||||
child: MediaQuery(
|
child: MediaQuery(
|
||||||
data: MediaQueryData(padding: EdgeInsets.zero),
|
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@@ -59,7 +59,7 @@ class AppBarMailboxCreatorBuilder {
|
|||||||
child: TextButton(
|
child: TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
AppLocalizations.of(_context).cancel,
|
AppLocalizations.of(_context).cancel,
|
||||||
style: TextStyle(fontSize: 17, color: AppColor.colorTextButton),
|
style: const TextStyle(fontSize: 17, color: AppColor.colorTextButton),
|
||||||
),
|
),
|
||||||
onPressed: () => _cancelActionClick?.call()
|
onPressed: () => _cancelActionClick?.call()
|
||||||
)
|
)
|
||||||
@@ -82,10 +82,10 @@ class AppBarMailboxCreatorBuilder {
|
|||||||
|
|
||||||
Widget _buildTitle() {
|
Widget _buildTitle() {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
child: Text(
|
child: Text(
|
||||||
title ?? '',
|
title ?? '',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(fontSize: 20, color: AppColor.colorNameEmail, fontWeight: FontWeight.bold)));
|
style: const TextStyle(fontSize: 20, color: AppColor.colorNameEmail, fontWeight: FontWeight.bold)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+8
-8
@@ -7,27 +7,27 @@ class CreateMailboxNameInputDecorationBuilder extends InputDecorationBuilder {
|
|||||||
@override
|
@override
|
||||||
InputDecoration build() {
|
InputDecoration build() {
|
||||||
return InputDecoration(
|
return InputDecoration(
|
||||||
enabledBorder: enabledBorder ?? OutlineInputBorder(
|
enabledBorder: enabledBorder ?? const OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||||
borderSide: BorderSide(width: 1, color: AppColor.colorInputBorderCreateMailbox)),
|
borderSide: BorderSide(width: 1, color: AppColor.colorInputBorderCreateMailbox)),
|
||||||
focusedBorder: enabledBorder ?? OutlineInputBorder(
|
focusedBorder: enabledBorder ?? const OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||||
borderSide: BorderSide(width: 1, color: AppColor.colorTextButton)),
|
borderSide: BorderSide(width: 1, color: AppColor.colorTextButton)),
|
||||||
errorBorder: errorBorder ?? OutlineInputBorder(
|
errorBorder: errorBorder ?? const OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||||
borderSide: BorderSide(width: 1, color: AppColor.colorInputBorderErrorVerifyName)),
|
borderSide: BorderSide(width: 1, color: AppColor.colorInputBorderErrorVerifyName)),
|
||||||
focusedErrorBorder: errorBorder ?? OutlineInputBorder(
|
focusedErrorBorder: errorBorder ?? const OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||||
borderSide: BorderSide(width: 1, color: AppColor.colorInputBorderErrorVerifyName)),
|
borderSide: BorderSide(width: 1, color: AppColor.colorInputBorderErrorVerifyName)),
|
||||||
prefixText: prefixText,
|
prefixText: prefixText,
|
||||||
labelText: labelText,
|
labelText: labelText,
|
||||||
floatingLabelBehavior: FloatingLabelBehavior.never,
|
floatingLabelBehavior: FloatingLabelBehavior.never,
|
||||||
labelStyle: labelStyle ?? TextStyle(color: AppColor.colorNameEmail, fontSize: 16),
|
labelStyle: labelStyle ?? const TextStyle(color: AppColor.colorNameEmail, fontSize: 16),
|
||||||
hintText: hintText,
|
hintText: hintText,
|
||||||
hintStyle: hintStyle ?? TextStyle(color: AppColor.colorHintInputCreateMailbox, fontSize: 16),
|
hintStyle: hintStyle ?? const TextStyle(color: AppColor.colorHintInputCreateMailbox, fontSize: 16),
|
||||||
contentPadding: contentPadding ?? EdgeInsets.all(12),
|
contentPadding: contentPadding ?? const EdgeInsets.all(12),
|
||||||
errorText: errorText,
|
errorText: errorText,
|
||||||
errorStyle: errorTextStyle ?? TextStyle(color: AppColor.colorInputBorderErrorVerifyName, fontSize: 13),
|
errorStyle: errorTextStyle ?? const TextStyle(color: AppColor.colorInputBorderErrorVerifyName, fontSize: 13),
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: errorText?.isNotEmpty == true
|
fillColor: errorText?.isNotEmpty == true
|
||||||
? AppColor.colorInputBackgroundErrorVerifyName
|
? AppColor.colorInputBackgroundErrorVerifyName
|
||||||
|
|||||||
+6
-6
@@ -15,11 +15,11 @@ mixin FilterEmailPopupMenuMixin {
|
|||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
child: _filterEmailAction(context, optionSelected, FilterMessageOption.attachments, onCallBack)),
|
child: _filterEmailAction(context, optionSelected, FilterMessageOption.attachments, onCallBack)),
|
||||||
PopupMenuDivider(height: 0.5),
|
const PopupMenuDivider(height: 0.5),
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
child: _filterEmailAction(context, optionSelected, FilterMessageOption.unread, onCallBack)),
|
child: _filterEmailAction(context, optionSelected, FilterMessageOption.unread, onCallBack)),
|
||||||
PopupMenuDivider(height: 0.5),
|
const PopupMenuDivider(height: 0.5),
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
child: _filterEmailAction(context, optionSelected, FilterMessageOption.starred, onCallBack)),
|
child: _filterEmailAction(context, optionSelected, FilterMessageOption.starred, onCallBack)),
|
||||||
@@ -31,7 +31,7 @@ mixin FilterEmailPopupMenuMixin {
|
|||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () => onCallBack?.call(option == optionSelected ? FilterMessageOption.all : option),
|
onTap: () => onCallBack?.call(option == optionSelected ? FilterMessageOption.all : option),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
SvgPicture.asset(option.getIcon(_imagePaths),
|
SvgPicture.asset(option.getIcon(_imagePaths),
|
||||||
@@ -39,12 +39,12 @@ mixin FilterEmailPopupMenuMixin {
|
|||||||
height: 20,
|
height: 20,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
color: option != FilterMessageOption.starred ? AppColor.colorTextButton : null),
|
color: option != FilterMessageOption.starred ? AppColor.colorTextButton : null),
|
||||||
SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
Expanded(child: Text(
|
Expanded(child: Text(
|
||||||
option.getName(context),
|
option.getName(context),
|
||||||
style: TextStyle(fontSize: 15, color: Colors.black, fontWeight: FontWeight.w500))),
|
style: const TextStyle(fontSize: 15, color: Colors.black, fontWeight: FontWeight.w500))),
|
||||||
if (optionSelected == option)
|
if (optionSelected == option)
|
||||||
SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
if (optionSelected == option)
|
if (optionSelected == option)
|
||||||
SvgPicture.asset(_imagePaths.icFilterSelected, width: 16, height: 16, fit: BoxFit.fill),
|
SvgPicture.asset(_imagePaths.icFilterSelected, width: 16, height: 16, fit: BoxFit.fill),
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -7,11 +7,6 @@ import 'package:tmail_ui_user/features/session/presentation/session_controller.d
|
|||||||
|
|
||||||
class SessionPageBindings extends BaseBindings {
|
class SessionPageBindings extends BaseBindings {
|
||||||
|
|
||||||
@override
|
|
||||||
void dependencies() {
|
|
||||||
super.dependencies();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void bindingsController() {
|
void bindingsController() {
|
||||||
Get.lazyPut(() => SessionController(
|
Get.lazyPut(() => SessionController(
|
||||||
|
|||||||
@@ -4,12 +4,13 @@ import 'package:get/get.dart';
|
|||||||
import 'package:tmail_ui_user/features/session/presentation/session_controller.dart';
|
import 'package:tmail_ui_user/features/session/presentation/session_controller.dart';
|
||||||
|
|
||||||
class SessionView extends GetWidget<SessionController> {
|
class SessionView extends GetWidget<SessionController> {
|
||||||
|
const SessionView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
color: AppColor.primaryLightColor,
|
color: AppColor.primaryLightColor,
|
||||||
child: SizedBox(
|
child: const SizedBox(
|
||||||
width: 100,
|
width: 100,
|
||||||
height: 100,
|
height: 100,
|
||||||
child: CupertinoActivityIndicator(),
|
child: CupertinoActivityIndicator(),
|
||||||
|
|||||||
Reference in New Issue
Block a user