Navigation changes
This commit is contained in:
parent
3f689f0f0b
commit
612625e282
|
|
@ -70,14 +70,12 @@ List<String> filteredInvoicesSelector(
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
print('## PAYMENT MAP: $invoicePaymentMap');
|
|
||||||
final list = invoiceList.where((invoiceId) {
|
final list = invoiceList.where((invoiceId) {
|
||||||
final invoice = invoiceMap[invoiceId];
|
final invoice = invoiceMap[invoiceId];
|
||||||
final client =
|
final client =
|
||||||
clientMap[invoice.clientId] ?? ClientEntity(id: invoice.clientId);
|
clientMap[invoice.clientId] ?? ClientEntity(id: invoice.clientId);
|
||||||
|
|
||||||
print(
|
|
||||||
'## invoiceListState.filterEntityType: ${invoiceListState.filterEntityType}');
|
|
||||||
if (invoiceListState.filterEntityType == EntityType.client) {
|
if (invoiceListState.filterEntityType == EntityType.client) {
|
||||||
if (!invoiceListState.entityMatchesFilter(client)) {
|
if (!invoiceListState.entityMatchesFilter(client)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -88,8 +86,6 @@ List<String> filteredInvoicesSelector(
|
||||||
}
|
}
|
||||||
} else if (invoiceListState.filterEntityType == EntityType.payment) {
|
} else if (invoiceListState.filterEntityType == EntityType.payment) {
|
||||||
bool isMatch = false;
|
bool isMatch = false;
|
||||||
print('## invoiceListState.filterEntityId : ${invoiceListState.filterEntityId }');
|
|
||||||
print('## paymentIds: ${invoicePaymentMap[invoiceId]}');
|
|
||||||
(invoicePaymentMap[invoiceId] ?? []).forEach((paymentId) {
|
(invoicePaymentMap[invoiceId] ?? []).forEach((paymentId) {
|
||||||
if (invoiceListState.filterEntityId == paymentId) {
|
if (invoiceListState.filterEntityId == paymentId) {
|
||||||
isMatch = true;
|
isMatch = true;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,57 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/entities.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/entities/entity_state_title.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/lists/list_divider.dart';
|
||||||
|
import 'package:invoiceninja_flutter/utils/icons.dart';
|
||||||
|
|
||||||
class EntityListTile extends StatelessWidget {
|
class EntityListTile extends StatelessWidget {
|
||||||
const EntityListTile(
|
const EntityListTile({
|
||||||
{this.icon, this.onTap, this.onLongPress, this.title, this.subtitle});
|
@required this.entity,
|
||||||
|
this.onTap,
|
||||||
|
this.onLongPress,
|
||||||
|
this.subtitle,
|
||||||
|
});
|
||||||
|
|
||||||
|
final Function onTap;
|
||||||
|
final Function onLongPress;
|
||||||
|
final String subtitle;
|
||||||
|
final BaseEntity entity;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
|
Material(
|
||||||
|
color: Theme.of(context).cardColor,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
|
child: ListTile(
|
||||||
|
title: EntityStateTitle(entity: entity),
|
||||||
|
subtitle: subtitle != null && subtitle.isNotEmpty
|
||||||
|
? Text(subtitle)
|
||||||
|
: null,
|
||||||
|
leading: Icon(getEntityIcon(entity.entityType), size: 18.0),
|
||||||
|
trailing: Icon(Icons.navigate_next),
|
||||||
|
onTap: onTap,
|
||||||
|
onLongPress: onLongPress,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ListDivider(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class EntitiesListTile extends StatelessWidget {
|
||||||
|
const EntitiesListTile({
|
||||||
|
this.icon,
|
||||||
|
this.onTap,
|
||||||
|
this.onLongPress,
|
||||||
|
this.title,
|
||||||
|
this.subtitle,
|
||||||
|
});
|
||||||
|
|
||||||
final Function onTap;
|
final Function onTap;
|
||||||
final Function onLongPress;
|
final Function onLongPress;
|
||||||
|
|
@ -17,17 +66,21 @@ class EntityListTile extends StatelessWidget {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Material(
|
Material(
|
||||||
color: Theme.of(context).cardColor,
|
color: Theme.of(context).cardColor,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Text(title),
|
title: Text(title),
|
||||||
subtitle:
|
subtitle: subtitle != null && subtitle.isNotEmpty
|
||||||
subtitle != null && subtitle.isNotEmpty ? Text(subtitle) : null,
|
? Text(subtitle)
|
||||||
|
: null,
|
||||||
leading: Icon(icon, size: 18.0),
|
leading: Icon(icon, size: 18.0),
|
||||||
trailing: Icon(Icons.navigate_next),
|
trailing: Icon(Icons.navigate_next),
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
onLongPress: onLongPress,
|
onLongPress: onLongPress,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Divider(height: 1),
|
),
|
||||||
|
ListDivider(),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import 'package:invoiceninja_flutter/data/models/entities.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/actions_menu_button.dart';
|
import 'package:invoiceninja_flutter/ui/app/actions_menu_button.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/lists/list_filter.dart';
|
|
||||||
import 'package:invoiceninja_flutter/ui/app/presenters/entity_presenter.dart';
|
import 'package:invoiceninja_flutter/ui/app/presenters/entity_presenter.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/tables/app_data_table.dart';
|
import 'package:invoiceninja_flutter/ui/app/tables/app_data_table.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/tables/app_data_table_source.dart';
|
import 'package:invoiceninja_flutter/ui/app/tables/app_data_table_source.dart';
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ class _GroupViewState extends State<GroupView> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ListDivider(),
|
ListDivider(),
|
||||||
EntityListTile(
|
EntitiesListTile(
|
||||||
icon: getEntityIcon(EntityType.client),
|
icon: getEntityIcon(EntityType.client),
|
||||||
title: localization.clients,
|
title: localization.clients,
|
||||||
onTap: () => viewModel.onClientsPressed(context),
|
onTap: () => viewModel.onClientsPressed(context),
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import 'package:invoiceninja_flutter/data/models/quote_model.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/payment/payment_selectors.dart';
|
import 'package:invoiceninja_flutter/redux/payment/payment_selectors.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/FieldGrid.dart';
|
import 'package:invoiceninja_flutter/ui/app/FieldGrid.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/entities/entity_state_title.dart';
|
import 'package:invoiceninja_flutter/ui/app/entities/entity_list_tile.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/invoice/invoice_item_view.dart';
|
import 'package:invoiceninja_flutter/ui/app/invoice/invoice_item_view.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/entity_header.dart';
|
import 'package:invoiceninja_flutter/ui/app/entity_header.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/lists/list_divider.dart';
|
import 'package:invoiceninja_flutter/ui/app/lists/list_divider.dart';
|
||||||
|
|
@ -15,7 +15,6 @@ import 'package:invoiceninja_flutter/ui/invoice/view/invoice_view_vm.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/formatting.dart';
|
import 'package:invoiceninja_flutter/utils/formatting.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/icon_message.dart';
|
import 'package:invoiceninja_flutter/ui/app/icon_message.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/icons.dart';
|
|
||||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||||
|
|
||||||
class InvoiceOverview extends StatelessWidget {
|
class InvoiceOverview extends StatelessWidget {
|
||||||
|
|
@ -104,61 +103,37 @@ class InvoiceOverview extends StatelessWidget {
|
||||||
value: invoice.customValue2);
|
value: invoice.customValue2);
|
||||||
}
|
}
|
||||||
|
|
||||||
widgets.addAll([
|
widgets.add(
|
||||||
Material(
|
EntityListTile(
|
||||||
color: Theme.of(context).cardColor,
|
entity: client,
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
|
||||||
child: ListTile(
|
|
||||||
title: EntityStateTitle(entity: client),
|
|
||||||
leading: Icon(getEntityIcon(EntityType.client), size: 18.0),
|
|
||||||
trailing: Icon(Icons.navigate_next),
|
|
||||||
onTap: () => viewModel.onClientPressed(context),
|
onTap: () => viewModel.onClientPressed(context),
|
||||||
onLongPress: () => viewModel.onClientPressed(context, true),
|
onLongPress: () => viewModel.onClientPressed(context, true),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
),
|
|
||||||
ListDivider(),
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (payments.isNotEmpty) {
|
if (payments.isNotEmpty) {
|
||||||
if (payments.length == 1) {
|
if (payments.length == 1) {
|
||||||
final payment = payments.first;
|
final payment = payments.first;
|
||||||
widgets.addAll([
|
widgets.add(
|
||||||
Material(
|
EntityListTile(
|
||||||
color: Theme.of(context).cardColor,
|
entity: payment,
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
|
||||||
child: ListTile(
|
|
||||||
title: EntityStateTitle(entity: payment),
|
|
||||||
subtitle: Text(
|
|
||||||
formatNumber(payment.amount, context, clientId: client.id) +
|
|
||||||
' • ' +
|
|
||||||
formatDate(payment.date, context)),
|
|
||||||
leading: Icon(FontAwesomeIcons.creditCard, size: 18.0),
|
|
||||||
trailing: Icon(Icons.navigate_next),
|
|
||||||
onTap: () => viewModel.onPaymentPressed(context, payment),
|
onTap: () => viewModel.onPaymentPressed(context, payment),
|
||||||
onLongPress: () =>
|
onLongPress: () =>
|
||||||
viewModel.onPaymentPressed(context, payment, true),
|
viewModel.onPaymentPressed(context, payment, true),
|
||||||
|
subtitle:
|
||||||
|
formatNumber(payment.amount, context, clientId: client.id) +
|
||||||
|
' • ' +
|
||||||
|
formatDate(payment.date, context),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
),
|
|
||||||
]);
|
|
||||||
} else {
|
} else {
|
||||||
widgets.addAll([
|
widgets.add(
|
||||||
Material(
|
EntitiesListTile(
|
||||||
color: Theme.of(context).cardColor,
|
icon: FontAwesomeIcons.creditCard,
|
||||||
child: Padding(
|
title: localization.payments,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
|
||||||
child: ListTile(
|
|
||||||
title: Text(localization.payments),
|
|
||||||
leading: Icon(FontAwesomeIcons.creditCard, size: 18.0),
|
|
||||||
trailing: Icon(Icons.navigate_next),
|
|
||||||
onTap: () => viewModel.onPaymentsPressed(context),
|
onTap: () => viewModel.onPaymentsPressed(context),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
widgets.addAll([
|
widgets.addAll([
|
||||||
|
|
@ -204,8 +179,8 @@ class InvoiceOverview extends StatelessWidget {
|
||||||
return Container(
|
return Container(
|
||||||
color: Theme.of(context).cardColor,
|
color: Theme.of(context).cardColor,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(
|
padding:
|
||||||
left: 20, top: 12, right: 20, bottom: 12),
|
const EdgeInsets.only(left: 20, top: 12, right: 20, bottom: 12),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,13 @@
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_redux/flutter_redux.dart';
|
import 'package:flutter_redux/flutter_redux.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
||||||
import 'package:invoiceninja_flutter/constants.dart';
|
import 'package:invoiceninja_flutter/constants.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/payment_model.dart';
|
import 'package:invoiceninja_flutter/data/models/payment_model.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/FieldGrid.dart';
|
import 'package:invoiceninja_flutter/ui/app/FieldGrid.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/buttons/bottom_buttons.dart';
|
import 'package:invoiceninja_flutter/ui/app/buttons/bottom_buttons.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/entities/entity_state_title.dart';
|
import 'package:invoiceninja_flutter/ui/app/entities/entity_list_tile.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/icon_message.dart';
|
import 'package:invoiceninja_flutter/ui/app/icon_message.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/entity_header.dart';
|
import 'package:invoiceninja_flutter/ui/app/entity_header.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/lists/list_divider.dart';
|
import 'package:invoiceninja_flutter/ui/app/lists/list_divider.dart';
|
||||||
|
|
@ -70,56 +69,38 @@ class _PaymentViewState extends State<PaymentView> {
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
EntityHeader(
|
EntityHeader(
|
||||||
backgroundColor: PaymentStatusColors.colors[payment.statusId],
|
backgroundColor:
|
||||||
|
PaymentStatusColors.colors[payment.statusId],
|
||||||
label: localization.amount,
|
label: localization.amount,
|
||||||
value:
|
value: formatNumber(payment.amount, context,
|
||||||
formatNumber(payment.amount, context, clientId: client.id),
|
clientId: client.id),
|
||||||
secondLabel: localization.applied,
|
secondLabel: localization.applied,
|
||||||
secondValue:
|
secondValue: formatNumber(payment.applied, context,
|
||||||
formatNumber(payment.applied, context, clientId: client.id),
|
clientId: client.id),
|
||||||
),
|
),
|
||||||
ListDivider(),
|
ListDivider(),
|
||||||
Material(
|
EntityListTile(
|
||||||
color: Theme.of(context).cardColor,
|
entity: client,
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
|
||||||
child: ListTile(
|
|
||||||
title: EntityStateTitle(entity: client),
|
|
||||||
leading: Icon(FontAwesomeIcons.users, size: 18.0),
|
|
||||||
trailing: Icon(Icons.navigate_next),
|
|
||||||
onTap: () => viewModel.onClientPressed(context),
|
onTap: () => viewModel.onClientPressed(context),
|
||||||
onLongPress: () => viewModel.onClientPressed(context, true),
|
onLongPress: () =>
|
||||||
|
viewModel.onClientPressed(context, true),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
ListDivider(),
|
|
||||||
for (final paymentable in payment.paymentables)
|
for (final paymentable in payment.paymentables)
|
||||||
Material(
|
EntityListTile(
|
||||||
color: Theme.of(context).cardColor,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
|
||||||
child: ListTile(
|
|
||||||
title: EntityStateTitle(
|
|
||||||
entity: state.invoiceState.map[paymentable.invoiceId],
|
entity: state.invoiceState.map[paymentable.invoiceId],
|
||||||
title:
|
subtitle: formatNumber(paymentable.amount, context) +
|
||||||
'${localization.invoice} ${state.invoiceState.map[paymentable.invoiceId]?.number ?? ''}',
|
|
||||||
),
|
|
||||||
subtitle: Text(formatNumber(paymentable.amount, context) +
|
|
||||||
' • ' +
|
' • ' +
|
||||||
formatDate(
|
formatDate(
|
||||||
convertTimestampToDateString(paymentable.createdAt),
|
convertTimestampToDateString(
|
||||||
context)),
|
paymentable.createdAt),
|
||||||
leading: Icon(FontAwesomeIcons.filePdf, size: 18.0),
|
context),
|
||||||
trailing: Icon(Icons.navigate_next),
|
|
||||||
onTap: () => viewModel.onInvoicePressed(
|
onTap: () => viewModel.onInvoicePressed(
|
||||||
context, paymentable.invoiceId),
|
context, paymentable.invoiceId),
|
||||||
onLongPress: () => viewModel.onInvoicePressed(
|
onLongPress: () => viewModel.onInvoicePressed(
|
||||||
context, paymentable.invoiceId, true),
|
context, paymentable.invoiceId, true),
|
||||||
),
|
),
|
||||||
),
|
payment.privateNotes != null &&
|
||||||
),
|
payment.privateNotes.isNotEmpty
|
||||||
ListDivider(),
|
|
||||||
payment.privateNotes != null && payment.privateNotes.isNotEmpty
|
|
||||||
? Column(
|
? Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
IconMessage(payment.privateNotes),
|
IconMessage(payment.privateNotes),
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/invoice/invoice_selectors.dart';
|
import 'package:invoiceninja_flutter/redux/invoice/invoice_selectors.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/payment/payment_selectors.dart';
|
import 'package:invoiceninja_flutter/redux/payment/payment_selectors.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/quote/quote_selectors.dart';
|
import 'package:invoiceninja_flutter/redux/quote/quote_selectors.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/entities/entity_list_tile.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/entity_header.dart';
|
import 'package:invoiceninja_flutter/ui/app/entity_header.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/lists/list_divider.dart';
|
|
||||||
import 'package:invoiceninja_flutter/ui/app/view_scaffold.dart';
|
import 'package:invoiceninja_flutter/ui/app/view_scaffold.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/user/view/user_view_vm.dart';
|
import 'package:invoiceninja_flutter/ui/user/view/user_view_vm.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
@ -40,9 +40,7 @@ class UserView extends StatelessWidget {
|
||||||
Divider(
|
Divider(
|
||||||
height: 1.0,
|
height: 1.0,
|
||||||
),
|
),
|
||||||
EntityListTile(
|
EntitiesListTile(
|
||||||
bottomPadding: 1,
|
|
||||||
icon: getEntityIcon(EntityType.invoice),
|
|
||||||
title: localization.invoices,
|
title: localization.invoices,
|
||||||
onTap: () => viewModel.onEntityPressed(context, EntityType.invoice),
|
onTap: () => viewModel.onEntityPressed(context, EntityType.invoice),
|
||||||
onLongPress: () =>
|
onLongPress: () =>
|
||||||
|
|
@ -51,8 +49,7 @@ class UserView extends StatelessWidget {
|
||||||
memoizedInvoiceStatsForUser(user.id, state.invoiceState.map)
|
memoizedInvoiceStatsForUser(user.id, state.invoiceState.map)
|
||||||
.present(localization.active, localization.archived),
|
.present(localization.active, localization.archived),
|
||||||
),
|
),
|
||||||
EntityListTile(
|
EntitiesListTile(
|
||||||
bottomPadding: 1,
|
|
||||||
icon: getEntityIcon(EntityType.payment),
|
icon: getEntityIcon(EntityType.payment),
|
||||||
title: localization.payments,
|
title: localization.payments,
|
||||||
onTap: () => viewModel.onEntityPressed(context, EntityType.payment),
|
onTap: () => viewModel.onEntityPressed(context, EntityType.payment),
|
||||||
|
|
@ -63,8 +60,7 @@ class UserView extends StatelessWidget {
|
||||||
.present(localization.active, localization.archived),
|
.present(localization.active, localization.archived),
|
||||||
),
|
),
|
||||||
company.isModuleEnabled(EntityType.quote)
|
company.isModuleEnabled(EntityType.quote)
|
||||||
? EntityListTile(
|
? EntitiesListTile(
|
||||||
bottomPadding: 1,
|
|
||||||
icon: getEntityIcon(EntityType.quote),
|
icon: getEntityIcon(EntityType.quote),
|
||||||
title: localization.quotes,
|
title: localization.quotes,
|
||||||
onTap: () =>
|
onTap: () =>
|
||||||
|
|
@ -132,40 +128,3 @@ class UserView extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class EntityListTile extends StatelessWidget {
|
|
||||||
const EntityListTile(
|
|
||||||
{this.icon,
|
|
||||||
this.onTap,
|
|
||||||
this.onLongPress,
|
|
||||||
this.title,
|
|
||||||
this.subtitle,
|
|
||||||
this.bottomPadding = 12});
|
|
||||||
|
|
||||||
final Function onTap;
|
|
||||||
final Function onLongPress;
|
|
||||||
final IconData icon;
|
|
||||||
final String title;
|
|
||||||
final String subtitle;
|
|
||||||
final double bottomPadding;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Column(
|
|
||||||
children: <Widget>[
|
|
||||||
Material(
|
|
||||||
color: Theme.of(context).canvasColor,
|
|
||||||
child: ListTile(
|
|
||||||
title: Text(title),
|
|
||||||
subtitle: Text(subtitle),
|
|
||||||
leading: Icon(icon, size: 18.0),
|
|
||||||
trailing: Icon(Icons.navigate_next),
|
|
||||||
onTap: onTap,
|
|
||||||
onLongPress: onLongPress,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ListDivider(),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue