Handle line breaks in transactions
This commit is contained in:
parent
a0519e5f76
commit
7cac6c77bb
|
|
@ -192,6 +192,8 @@ abstract class TransactionEntity extends Object
|
|||
|
||||
bool get isConverted => statusId == kTransactionStatusConverted;
|
||||
|
||||
String get formattedDescription => description.replaceAll('\n', ' ');
|
||||
|
||||
@override
|
||||
List<EntityAction?> getActions(
|
||||
{UserCompanyEntity? userCompany,
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ ReportResult transactionReport(
|
|||
value = transaction.date;
|
||||
break;
|
||||
case TransactionReportFields.description:
|
||||
value = transaction.description;
|
||||
value = transaction.formattedDescription;
|
||||
break;
|
||||
case TransactionReportFields.vendor:
|
||||
value = vendorMap[transaction.vendorId]?.name ?? '';
|
||||
|
|
|
|||
|
|
@ -116,7 +116,8 @@ class TransactionListItem extends StatelessWidget {
|
|||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(transaction.description, style: textStyle),
|
||||
Text(transaction.formattedDescription,
|
||||
style: textStyle),
|
||||
Text(
|
||||
state.bankAccountState
|
||||
.get(transaction.bankAccountId)
|
||||
|
|
@ -193,7 +194,7 @@ class TransactionListItem extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Text(
|
||||
transaction.description,
|
||||
transaction.formattedDescription,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -84,8 +84,9 @@ class _TransactionViewState extends State<TransactionView> {
|
|||
ListDivider(),
|
||||
],
|
||||
if (transaction.isConverted) ...[
|
||||
if (transaction.description.isNotEmpty) ...[
|
||||
IconMessage(transaction.description, copyToClipboard: true),
|
||||
if (transaction.formattedDescription.isNotEmpty) ...[
|
||||
IconMessage(transaction.formattedDescription,
|
||||
copyToClipboard: true),
|
||||
ListDivider(),
|
||||
],
|
||||
EntityListTile(
|
||||
|
|
|
|||
Loading…
Reference in New Issue