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