TF-105 [BUG] Fix email address should be in lower case
This commit is contained in:
@@ -39,7 +39,7 @@ class EmailAddressDatabaseManager implements DatabaseManager<EmailAddress> {
|
||||
final res = await _databaseClient.updateData(
|
||||
EmailAddressTable.TABLE_NAME,
|
||||
EmailAddressTable.EMAIL,
|
||||
emailAddress.getEmail(),
|
||||
emailAddress.emailAddress,
|
||||
emailAddress.toEmailAddressCache().toJson());
|
||||
return res > 0 ? true : false;
|
||||
}
|
||||
|
||||
+2
-2
@@ -182,9 +182,9 @@ class EmailAddressComposerWidgetBuilder {
|
||||
title: Text(
|
||||
emailAddress.asString(),
|
||||
style: TextStyle(color: AppColor.nameUserColor, fontSize: 14, fontWeight: FontWeight.w500)),
|
||||
subtitle: emailAddress.getName().isNotEmpty && emailAddress.getEmail().isNotEmpty
|
||||
subtitle: emailAddress.displayName.isNotEmpty && emailAddress.emailAddress.isNotEmpty
|
||||
? Text(
|
||||
emailAddress.getEmail(),
|
||||
emailAddress.emailAddress,
|
||||
style: TextStyle(color: AppColor.baseTextColor, fontSize: 12, fontWeight: FontWeight.w500))
|
||||
: null,
|
||||
onTap: () => state.selectSuggestion(emailAddress),
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ class SenderAndReceiverInformationTileBuilder {
|
||||
title: Transform(
|
||||
transform: Matrix4.translationValues(-15.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
'${AppLocalizations.of(_context).from_email_address_prefix}: ${_presentationEmail!.getSenderName().inCaps}',
|
||||
'${AppLocalizations.of(_context).from_email_address_prefix}: ${_presentationEmail!.getSenderName()}',
|
||||
style: TextStyle(fontSize: 16, color: AppColor.nameUserColor, fontWeight: FontWeight.w500),
|
||||
)),
|
||||
subtitle: Transform(
|
||||
|
||||
@@ -86,8 +86,8 @@ class EmailTileBuilder {
|
||||
Expanded(
|
||||
child: Text(
|
||||
_mailboxRole == PresentationMailbox.roleSent
|
||||
? '${_presentationEmail.recipientsName().inCaps}'
|
||||
: '${_presentationEmail.getSenderName().inCaps}',
|
||||
? '${_presentationEmail.recipientsName()}'
|
||||
: '${_presentationEmail.getSenderName()}',
|
||||
maxLines: 1,
|
||||
overflow:TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
|
||||
@@ -1,32 +1,36 @@
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||
import 'package:model/email/email_address_cache.dart';
|
||||
import 'package:core/core.dart';
|
||||
|
||||
extension EmailAddressExtension on EmailAddress {
|
||||
|
||||
String asString() {
|
||||
if (getName().isNotEmpty) {
|
||||
return name!;
|
||||
} else if (getEmail().isNotEmpty) {
|
||||
return email!;
|
||||
if (displayName.isNotEmpty) {
|
||||
if (emailAddress.isNotEmpty && displayName == emailAddress) {
|
||||
return displayName;
|
||||
}
|
||||
return displayName.capitalizeFirstEach;
|
||||
} else if (emailAddress.isNotEmpty) {
|
||||
return emailAddress;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
String asFullString() {
|
||||
if (getName().isNotEmpty) {
|
||||
if (getEmail().isNotEmpty) {
|
||||
return '${name!} <${email!}>';
|
||||
if (displayName.isNotEmpty) {
|
||||
if (emailAddress.isNotEmpty) {
|
||||
return '${displayName.capitalizeFirstEach} <$emailAddress>';
|
||||
}
|
||||
return name!;
|
||||
} else if (getEmail().isNotEmpty) {
|
||||
return email!;
|
||||
return displayName.capitalizeFirstEach;
|
||||
} else if (emailAddress.isNotEmpty) {
|
||||
return emailAddress;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
String getEmail() => email != null ? email! : '';
|
||||
String get emailAddress => email != null ? email! : '';
|
||||
|
||||
String getName() => name != null ? name! : '';
|
||||
String get displayName => name != null ? name! : '';
|
||||
|
||||
EmailAddressCache toEmailAddressCache() => EmailAddressCache(name ?? '', email ?? '');
|
||||
EmailAddressCache toEmailAddressCache() => EmailAddressCache(displayName, emailAddress);
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import 'package:model/extensions/email_address_extension.dart';
|
||||
|
||||
extension ListEmailAddressExtension on Set<EmailAddress>? {
|
||||
|
||||
List<String>? getListAddress() => this?.map((emailAddress) => emailAddress.getEmail()).toList();
|
||||
List<String>? getListAddress() => this?.map((emailAddress) => emailAddress.emailAddress).toList();
|
||||
|
||||
List<EmailAddress> asList() => this != null ? this!.toList() : List.empty();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user