Transactions
This commit is contained in:
parent
f2cbcf408d
commit
2f480bb0b0
|
|
@ -26,6 +26,7 @@ class ViewScaffold extends StatelessWidget {
|
|||
this.appBarBottom,
|
||||
this.isFilter = false,
|
||||
this.onBackPressed,
|
||||
this.title,
|
||||
});
|
||||
|
||||
final bool isFilter;
|
||||
|
|
@ -34,6 +35,7 @@ class ViewScaffold extends StatelessWidget {
|
|||
final Function onBackPressed;
|
||||
final Widget floatingActionButton;
|
||||
final Widget appBarBottom;
|
||||
final String title;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -43,12 +45,14 @@ class ViewScaffold extends StatelessWidget {
|
|||
final userCompany = state.userCompany;
|
||||
final isSettings = entity.entityType.isSetting;
|
||||
|
||||
String title;
|
||||
if (entity.isNew) {
|
||||
title = '';
|
||||
String appBarTitle;
|
||||
if (title != null) {
|
||||
appBarTitle = title;
|
||||
} else if (entity.isNew) {
|
||||
appBarTitle = '';
|
||||
} else {
|
||||
final presenter = EntityPresenter().initialize(entity, context);
|
||||
title = presenter.title(isNarrow: isMobile(context));
|
||||
appBarTitle = presenter.title(isNarrow: isMobile(context));
|
||||
}
|
||||
|
||||
Widget leading;
|
||||
|
|
@ -97,8 +101,8 @@ class ViewScaffold extends StatelessWidget {
|
|||
leading: leading,
|
||||
automaticallyImplyLeading: isMobile(context),
|
||||
title: CopyToClipboard(
|
||||
value: title,
|
||||
child: Text(title),
|
||||
value: appBarTitle,
|
||||
child: Text(appBarTitle),
|
||||
),
|
||||
bottom: appBarBottom,
|
||||
actions: entity.isNew
|
||||
|
|
|
|||
|
|
@ -37,16 +37,20 @@ class _TransactionViewState extends State<TransactionView> {
|
|||
final viewModel = widget.viewModel;
|
||||
final transactions = viewModel.transactions;
|
||||
final transaction =
|
||||
transactions.isNotEmpty ? transactions.first : TransactionEntity();
|
||||
transactions.isEmpty ? TransactionEntity() : transactions.first;
|
||||
final localization = AppLocalization.of(context);
|
||||
final state = viewModel.state;
|
||||
|
||||
return ViewScaffold(
|
||||
isFilter: widget.isFilter,
|
||||
entity: transaction,
|
||||
title: transactions.length > 1
|
||||
? '${transactions.length} ${localization.selected}'
|
||||
: null,
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
if (transactions.length == 1) ...[
|
||||
EntityHeader(
|
||||
entity: transaction,
|
||||
label: transaction.isDeposit
|
||||
|
|
@ -58,6 +62,7 @@ class _TransactionViewState extends State<TransactionView> {
|
|||
secondValue: formatDate(transaction.date, context),
|
||||
),
|
||||
ListDivider(),
|
||||
],
|
||||
if (transaction.isConverted) ...[
|
||||
if (transaction.isDeposit)
|
||||
...transaction.invoiceIds
|
||||
|
|
|
|||
Loading…
Reference in New Issue