Invoice history
This commit is contained in:
parent
2b0cfe79d3
commit
bcd8a27e7e
|
|
@ -104,16 +104,21 @@ class _InvoiceViewState extends State<InvoiceView>
|
|||
child: InvoiceOverview(
|
||||
viewModel: viewModel,
|
||||
isFilter: widget.isFilter,
|
||||
key: ValueKey(viewModel.invoice.id),
|
||||
),
|
||||
),
|
||||
RefreshIndicator(
|
||||
onRefresh: () => viewModel.onRefreshed(context),
|
||||
child: InvoiceViewDocuments(
|
||||
viewModel: viewModel, invoice: viewModel.invoice),
|
||||
viewModel: viewModel,
|
||||
invoice: viewModel.invoice,
|
||||
key: ValueKey(viewModel.invoice.id)),
|
||||
),
|
||||
RefreshIndicator(
|
||||
onRefresh: () => viewModel.onRefreshed(context),
|
||||
child: InvoiceViewHistory(viewModel: viewModel),
|
||||
child: InvoiceViewHistory(
|
||||
viewModel: viewModel,
|
||||
key: ValueKey(viewModel.invoice.id)),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ import 'package:invoiceninja_flutter/ui/invoice/view/invoice_view_vm.dart';
|
|||
|
||||
class InvoiceViewDocuments extends StatelessWidget {
|
||||
const InvoiceViewDocuments(
|
||||
{@required this.invoice, @required this.viewModel});
|
||||
{Key key, @required this.invoice, @required this.viewModel})
|
||||
: super(key: key);
|
||||
|
||||
final EntityViewVM viewModel;
|
||||
final InvoiceEntity invoice;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/lists/list_divider.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/loading_indicator.dart';
|
||||
import 'package:invoiceninja_flutter/ui/invoice/view/invoice_view_vm.dart';
|
||||
import 'package:invoiceninja_flutter/utils/formatting.dart';
|
||||
|
||||
class InvoiceViewHistory extends StatefulWidget {
|
||||
const InvoiceViewHistory({@required this.viewModel});
|
||||
const InvoiceViewHistory({Key key, @required this.viewModel}) : super(key: key);
|
||||
|
||||
final EntityViewVM viewModel;
|
||||
|
||||
|
|
@ -27,7 +29,25 @@ class _InvoiceViewHistoryState extends State<InvoiceViewHistory> {
|
|||
if (invoice.isStale) {
|
||||
return LoadingIndicator();
|
||||
}
|
||||
|
||||
return Placeholder();
|
||||
|
||||
return ListView.separated(
|
||||
shrinkWrap: true,
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
itemBuilder: (BuildContext context, index) {
|
||||
final history = invoice.history[index];
|
||||
return ListTile(
|
||||
title: Text('test'),
|
||||
subtitle: Text(
|
||||
formatDate(
|
||||
convertTimestampToDateString(history.createdAt),
|
||||
context,
|
||||
showTime: true,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) => ListDivider(),
|
||||
itemCount: invoice.history.length,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ class _ProductViewState extends State<ProductView>
|
|||
onRefresh: () => viewModel.onRefreshed(context),
|
||||
child: ProductOverview(
|
||||
viewModel: viewModel,
|
||||
key: ValueKey(viewModel.product.id),
|
||||
//isFilter: widget.isFilter,
|
||||
),
|
||||
),
|
||||
|
|
@ -80,6 +81,7 @@ class _ProductViewState extends State<ProductView>
|
|||
onRefresh: () => viewModel.onRefreshed(context),
|
||||
child: ProductViewDocuments(
|
||||
viewModel: viewModel,
|
||||
key: ValueKey(viewModel.product.id),
|
||||
//client: viewModel.client,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import 'package:invoiceninja_flutter/ui/app/document_grid.dart';
|
|||
import 'package:invoiceninja_flutter/ui/app/screen_imports.dart';
|
||||
|
||||
class ProductViewDocuments extends StatelessWidget {
|
||||
const ProductViewDocuments({@required this.viewModel});
|
||||
const ProductViewDocuments({Key key, @required this.viewModel}) : super(key: key);
|
||||
|
||||
final ProductViewVM viewModel;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,9 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
|
|||
|
||||
class ProductOverview extends StatefulWidget {
|
||||
const ProductOverview({
|
||||
Key key,
|
||||
@required this.viewModel,
|
||||
});
|
||||
}) : super(key: key);
|
||||
|
||||
final ProductViewVM viewModel;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue