From 94b8312905a79ae389f818639b005e6dc0e34039 Mon Sep 17 00:00:00 2001 From: dab246 Date: Wed, 27 Apr 2022 10:38:15 +0700 Subject: [PATCH] TF-517 Show app version on ManageAccount screen --- .../presentation/mailbox_dashboard_controller.dart | 6 +++--- .../manage_account_dashboard_controller.dart | 7 +++++++ .../widgets/identity_info_tile_builder.dart | 12 ++++++------ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_controller.dart b/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_controller.dart index 87599612c..ba5ba924f 100644 --- a/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_controller.dart +++ b/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_controller.dart @@ -101,7 +101,7 @@ class MailboxDashBoardController extends ReloadableController { dispatchRoute(AppRoutes.THREAD); _setSessionCurrent(); _getUserProfile(); - _initPackageInfo(); + _getAppVersion(); super.onReady(); } @@ -213,9 +213,9 @@ class MailboxDashBoardController extends ReloadableController { } } - Future _initPackageInfo() async { + Future _getAppVersion() async { final info = await PackageInfo.fromPlatform(); - log('MailboxDashBoardController::_initPackageInfo(): ${info.version}'); + log('MailboxDashBoardController::_getAppVersion(): ${info.version}'); appInformation.value = info; } diff --git a/lib/features/manage_account/presentation/manage_account_dashboard_controller.dart b/lib/features/manage_account/presentation/manage_account_dashboard_controller.dart index b02cb136f..f214796c8 100644 --- a/lib/features/manage_account/presentation/manage_account_dashboard_controller.dart +++ b/lib/features/manage_account/presentation/manage_account_dashboard_controller.dart @@ -35,6 +35,7 @@ class ManageAccountDashBoardController extends ReloadableController { @override void onReady() { _getArguments(); + _getAppVersion(); super.onReady(); } @@ -73,6 +74,12 @@ class ManageAccountDashBoardController extends ReloadableController { } } + Future _getAppVersion() async { + final info = await PackageInfo.fromPlatform(); + log('MailboxDashBoardController::_getAppVersion(): ${info.version}'); + appInformation.value = info; + } + void _getUserProfile() async { consumeState(_getUserProfileInteractor.execute()); } diff --git a/lib/features/manage_account/presentation/profiles/identities/widgets/identity_info_tile_builder.dart b/lib/features/manage_account/presentation/profiles/identities/widgets/identity_info_tile_builder.dart index 4927c07df..cabe6e3bd 100644 --- a/lib/features/manage_account/presentation/profiles/identities/widgets/identity_info_tile_builder.dart +++ b/lib/features/manage_account/presentation/profiles/identities/widgets/identity_info_tile_builder.dart @@ -63,8 +63,8 @@ class IdentityInfoTileBuilder extends StatelessWidget { Expanded(child: Text(_identity?.email ?? '', style: const TextStyle(fontWeight: FontWeight.normal, fontSize: 15, color: AppColor.colorHintSearchBar))) ])), - if (_identity?.replyTo != null) const SizedBox(height: 10), - if (_identity?.replyTo != null) + if (_identity?.replyTo != null && _identity?.replyTo?.isNotEmpty == true) const SizedBox(height: 10), + if (_identity?.replyTo != null && _identity?.replyTo?.isNotEmpty == true) Padding( padding: const EdgeInsets.symmetric(horizontal: 12), child: Row(children: [ @@ -75,8 +75,8 @@ class IdentityInfoTileBuilder extends StatelessWidget { Expanded(child: Text(_identity?.replyTo?.listEmailAddressToString(isFullEmailAddress: true) ?? '', style: const TextStyle(fontWeight: FontWeight.normal, fontSize: 15, color: AppColor.colorHintSearchBar))) ])), - if (_identity?.cc != null) const SizedBox(height: 6), - if (_identity?.cc != null) + if (_identity?.cc != null && _identity?.cc?.isNotEmpty == true) const SizedBox(height: 6), + if (_identity?.cc != null && _identity?.cc?.isNotEmpty == true) Padding( padding: const EdgeInsets.symmetric(horizontal: 12), child: Row(children: [ @@ -93,8 +93,8 @@ class IdentityInfoTileBuilder extends StatelessWidget { Expanded(child: Text(_identity?.cc?.listEmailAddressToString(isFullEmailAddress: true) ?? '', style: const TextStyle(fontWeight: FontWeight.normal, fontSize: 15, color: AppColor.colorHintSearchBar))) ])), - if (_identity?.bcc != null) const SizedBox(height: 6), - if (_identity?.bcc != null) + if (_identity?.bcc != null && _identity?.bcc?.isNotEmpty == true) const SizedBox(height: 6), + if (_identity?.bcc != null && _identity?.bcc?.isNotEmpty == true) Padding( padding: const EdgeInsets.symmetric(horizontal: 12), child: Row(children: [