Show “Blank contact” on client view page
This commit is contained in:
parent
797bb7b6a9
commit
b44613540d
|
|
@ -31,15 +31,19 @@ class AppListTile extends StatelessWidget {
|
|||
title: Text(title),
|
||||
subtitle: buttons != null
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: Row(
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: Row(
|
||||
children: buttons,
|
||||
),
|
||||
)
|
||||
)
|
||||
: (subtitle == null ? Container() : Text(subtitle)),
|
||||
dense: dense,
|
||||
onTap: onTap,
|
||||
onLongPress: () {
|
||||
if ((copyValue ?? title ?? '').isEmpty) {
|
||||
return;
|
||||
}
|
||||
|
||||
Clipboard.setData(ClipboardData(text: copyValue ?? title));
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content: Text(AppLocalization.of(context)
|
||||
|
|
|
|||
|
|
@ -77,9 +77,16 @@ class _ClientViewDetailsState extends State<ClientViewDetails> {
|
|||
)),
|
||||
],
|
||||
icon: Icons.email,
|
||||
title: contact.fullName + '\n' + contact.email,
|
||||
title: (contact.fullName.isEmpty
|
||||
? localization.blankContact
|
||||
: contact.fullName) +
|
||||
('\n' + contact.email).trim(),
|
||||
copyValue: contact.email,
|
||||
onTap: () => setState(() {
|
||||
if ((contact.email ?? '').isEmpty) {
|
||||
return;
|
||||
}
|
||||
|
||||
_launched = _launchURL(context, 'mailto:' + contact.email);
|
||||
}),
|
||||
));
|
||||
|
|
@ -87,7 +94,11 @@ class _ClientViewDetailsState extends State<ClientViewDetails> {
|
|||
if ((contact.phone ?? '').isNotEmpty) {
|
||||
listTiles.add(AppListTile(
|
||||
icon: Icons.phone,
|
||||
title: contact.fullName + '\n' + contact.phone,
|
||||
title: (contact.fullName.isEmpty
|
||||
? localization.blankContact
|
||||
: contact.fullName) +
|
||||
'\n' +
|
||||
contact.phone,
|
||||
copyValue: contact.phone,
|
||||
subtitle: localization.phone,
|
||||
onTap: () => setState(() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue