Invoices
This commit is contained in:
parent
06b4a07ebe
commit
817f141100
|
|
@ -15,6 +15,7 @@ class EntityDropdown extends StatefulWidget {
|
|||
@required this.entityMap,
|
||||
@required this.onFilterChanged,
|
||||
@required this.onSelected,
|
||||
this.validator,
|
||||
this.initialValue,
|
||||
});
|
||||
|
||||
|
|
@ -25,6 +26,7 @@ class EntityDropdown extends StatefulWidget {
|
|||
final String initialValue;
|
||||
final Function(String) onFilterChanged;
|
||||
final Function(int) onSelected;
|
||||
final Function validator;
|
||||
|
||||
@override
|
||||
_EntityDropdownState createState() => _EntityDropdownState();
|
||||
|
|
@ -138,6 +140,7 @@ class _EntityDropdownState extends State<EntityDropdown> {
|
|||
onTap: () => _showOptions(),
|
||||
child: IgnorePointer(
|
||||
child: TextFormField(
|
||||
validator: widget.validator,
|
||||
controller: _textController,
|
||||
decoration: InputDecoration(
|
||||
labelText: widget.labelText,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class InvoiceEditDetails extends StatefulWidget {
|
|||
InvoiceEditDetailsState createState() => new InvoiceEditDetailsState();
|
||||
}
|
||||
|
||||
class InvoiceEditDetailsState extends State<InvoiceEditDetails> {
|
||||
class InvoiceEditDetailsState extends State<InvoiceEditDetails> with AutomaticKeepAliveClientMixin {
|
||||
final _invoiceNumberController = TextEditingController();
|
||||
final _invoiceDateController = TextEditingController();
|
||||
final _poNumberController = TextEditingController();
|
||||
|
|
@ -29,6 +29,9 @@ class InvoiceEditDetailsState extends State<InvoiceEditDetails> {
|
|||
|
||||
List _controllers = [];
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
_controllers = [
|
||||
|
|
@ -98,6 +101,9 @@ class InvoiceEditDetailsState extends State<InvoiceEditDetails> {
|
|||
viewModel.clientMap[invoice.clientId]?.displayName,
|
||||
entityList: viewModel.clientList,
|
||||
entityMap: viewModel.clientMap,
|
||||
validator: (String val) => val.trim().isEmpty
|
||||
? AppLocalization.of(context).pleaseSelectAClient
|
||||
: null,
|
||||
onFilterChanged: viewModel.onEntityFilterChanged,
|
||||
onSelected: (clientId) {
|
||||
viewModel.onChanged(
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class ItemEditDetails extends StatefulWidget {
|
|||
ItemEditDetailsState createState() => ItemEditDetailsState();
|
||||
}
|
||||
|
||||
class ItemEditDetailsState extends State<ItemEditDetails> {
|
||||
class ItemEditDetailsState extends State<ItemEditDetails> with AutomaticKeepAliveClientMixin {
|
||||
final _productKeyController = TextEditingController();
|
||||
final _notesController = TextEditingController();
|
||||
final _costController = TextEditingController();
|
||||
|
|
@ -66,6 +66,9 @@ class ItemEditDetailsState extends State<ItemEditDetails> {
|
|||
|
||||
var _controllers = [];
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
_controllers = [
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ class AppLocalization {
|
|||
'edit': 'Edit',
|
||||
'dismiss': 'Dismiss',
|
||||
'please_select_a_date': 'Please select a date',
|
||||
'please_select_a_client': 'Please select a client',
|
||||
|
||||
'payment': 'Payment',
|
||||
'payments': 'Payments',
|
||||
|
|
@ -296,6 +297,7 @@ class AppLocalization {
|
|||
String get edit => _localizedValues[locale.languageCode]['edit'];
|
||||
String get dismiss => _localizedValues[locale.languageCode]['dismiss'];
|
||||
String get pleaseSelectADate => _localizedValues[locale.languageCode]['please_select_a_date'];
|
||||
String get pleaseSelectAClient => _localizedValues[locale.languageCode]['please_select_a_client'];
|
||||
|
||||
String get payment => _localizedValues[locale.languageCode]['payment'];
|
||||
String get payments => _localizedValues[locale.languageCode]['payments'];
|
||||
|
|
|
|||
Loading…
Reference in New Issue