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(
|
final res = await _databaseClient.updateData(
|
||||||
EmailAddressTable.TABLE_NAME,
|
EmailAddressTable.TABLE_NAME,
|
||||||
EmailAddressTable.EMAIL,
|
EmailAddressTable.EMAIL,
|
||||||
emailAddress.getEmail(),
|
emailAddress.emailAddress,
|
||||||
emailAddress.toEmailAddressCache().toJson());
|
emailAddress.toEmailAddressCache().toJson());
|
||||||
return res > 0 ? true : false;
|
return res > 0 ? true : false;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -182,9 +182,9 @@ class EmailAddressComposerWidgetBuilder {
|
|||||||
title: Text(
|
title: Text(
|
||||||
emailAddress.asString(),
|
emailAddress.asString(),
|
||||||
style: TextStyle(color: AppColor.nameUserColor, fontSize: 14, fontWeight: FontWeight.w500)),
|
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(
|
? Text(
|
||||||
emailAddress.getEmail(),
|
emailAddress.emailAddress,
|
||||||
style: TextStyle(color: AppColor.baseTextColor, fontSize: 12, fontWeight: FontWeight.w500))
|
style: TextStyle(color: AppColor.baseTextColor, fontSize: 12, fontWeight: FontWeight.w500))
|
||||||
: null,
|
: null,
|
||||||
onTap: () => state.selectSuggestion(emailAddress),
|
onTap: () => state.selectSuggestion(emailAddress),
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ class SenderAndReceiverInformationTileBuilder {
|
|||||||
title: Transform(
|
title: Transform(
|
||||||
transform: Matrix4.translationValues(-15.0, 0.0, 0.0),
|
transform: Matrix4.translationValues(-15.0, 0.0, 0.0),
|
||||||
child: Text(
|
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),
|
style: TextStyle(fontSize: 16, color: AppColor.nameUserColor, fontWeight: FontWeight.w500),
|
||||||
)),
|
)),
|
||||||
subtitle: Transform(
|
subtitle: Transform(
|
||||||
|
|||||||
@@ -86,8 +86,8 @@ class EmailTileBuilder {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
_mailboxRole == PresentationMailbox.roleSent
|
_mailboxRole == PresentationMailbox.roleSent
|
||||||
? '${_presentationEmail.recipientsName().inCaps}'
|
? '${_presentationEmail.recipientsName()}'
|
||||||
: '${_presentationEmail.getSenderName().inCaps}',
|
: '${_presentationEmail.getSenderName()}',
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow:TextOverflow.ellipsis,
|
overflow:TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@@ -1,32 +1,36 @@
|
|||||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||||
import 'package:model/email/email_address_cache.dart';
|
import 'package:model/email/email_address_cache.dart';
|
||||||
|
import 'package:core/core.dart';
|
||||||
|
|
||||||
extension EmailAddressExtension on EmailAddress {
|
extension EmailAddressExtension on EmailAddress {
|
||||||
|
|
||||||
String asString() {
|
String asString() {
|
||||||
if (getName().isNotEmpty) {
|
if (displayName.isNotEmpty) {
|
||||||
return name!;
|
if (emailAddress.isNotEmpty && displayName == emailAddress) {
|
||||||
} else if (getEmail().isNotEmpty) {
|
return displayName;
|
||||||
return email!;
|
}
|
||||||
|
return displayName.capitalizeFirstEach;
|
||||||
|
} else if (emailAddress.isNotEmpty) {
|
||||||
|
return emailAddress;
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
String asFullString() {
|
String asFullString() {
|
||||||
if (getName().isNotEmpty) {
|
if (displayName.isNotEmpty) {
|
||||||
if (getEmail().isNotEmpty) {
|
if (emailAddress.isNotEmpty) {
|
||||||
return '${name!} <${email!}>';
|
return '${displayName.capitalizeFirstEach} <$emailAddress>';
|
||||||
}
|
}
|
||||||
return name!;
|
return displayName.capitalizeFirstEach;
|
||||||
} else if (getEmail().isNotEmpty) {
|
} else if (emailAddress.isNotEmpty) {
|
||||||
return email!;
|
return emailAddress;
|
||||||
}
|
}
|
||||||
return '';
|
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>? {
|
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();
|
List<EmailAddress> asList() => this != null ? this!.toList() : List.empty();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user