Invoices
This commit is contained in:
parent
573f7bb377
commit
a64253b9b0
|
|
@ -83,10 +83,10 @@ class AppDrawer extends StatelessWidget {
|
|||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: viewModel.companies.length > 1 && ! viewModel.isLoading
|
||||
? _multipleCompanies
|
||||
: _singleCompany
|
||||
),
|
||||
child: viewModel.companies.length > 1 &&
|
||||
!viewModel.isLoading
|
||||
? _multipleCompanies
|
||||
: _singleCompany),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
|
@ -94,12 +94,12 @@ class AppDrawer extends StatelessWidget {
|
|||
color: Colors.white10,
|
||||
),
|
||||
DrawerTile(
|
||||
icon: FontAwesomeIcons.tachometerAlt,
|
||||
title: AppLocalization.of(context).dashboard,
|
||||
onTap: () {
|
||||
navigator.pop();
|
||||
store.dispatch(ViewDashboard(context));
|
||||
},
|
||||
icon: FontAwesomeIcons.tachometerAlt,
|
||||
title: AppLocalization.of(context).dashboard,
|
||||
onTap: () {
|
||||
navigator.pop();
|
||||
store.dispatch(ViewDashboard(context));
|
||||
},
|
||||
),
|
||||
DrawerTile(
|
||||
icon: FontAwesomeIcons.users,
|
||||
|
|
@ -107,7 +107,8 @@ class AppDrawer extends StatelessWidget {
|
|||
onTap: () => navigator.pushReplacementNamed(ClientScreen.route),
|
||||
onCreateTap: () {
|
||||
navigator.pop();
|
||||
store.dispatch(EditClient(client: ClientEntity(), context: context));
|
||||
store.dispatch(
|
||||
EditClient(client: ClientEntity(), context: context));
|
||||
},
|
||||
),
|
||||
DrawerTile(
|
||||
|
|
@ -116,7 +117,8 @@ class AppDrawer extends StatelessWidget {
|
|||
onTap: () => navigator.pushReplacementNamed(ProductScreen.route),
|
||||
onCreateTap: () {
|
||||
navigator.pop();
|
||||
store.dispatch(EditProduct(product: ProductEntity(), context: context));
|
||||
store.dispatch(
|
||||
EditProduct(product: ProductEntity(), context: context));
|
||||
},
|
||||
),
|
||||
DrawerTile(
|
||||
|
|
@ -125,7 +127,8 @@ class AppDrawer extends StatelessWidget {
|
|||
onTap: () => navigator.pushReplacementNamed(InvoiceScreen.route),
|
||||
onCreateTap: () {
|
||||
navigator.pop();
|
||||
store.dispatch(EditInvoice(invoice: InvoiceEntity(), context: context));
|
||||
store.dispatch(
|
||||
EditInvoice(invoice: InvoiceEntity(), context: context));
|
||||
},
|
||||
),
|
||||
DrawerTile(
|
||||
|
|
@ -171,10 +174,12 @@ class DrawerTile extends StatelessWidget {
|
|||
leading: Icon(icon, size: 22.0),
|
||||
title: Text(title),
|
||||
onTap: () => onTap(),
|
||||
trailing: onCreateTap == null ? null : IconButton(
|
||||
icon: Icon(Icons.add_circle_outline),
|
||||
onPressed: onCreateTap,
|
||||
),
|
||||
trailing: onCreateTap == null
|
||||
? null
|
||||
: IconButton(
|
||||
icon: Icon(Icons.add_circle_outline),
|
||||
onPressed: onCreateTap,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,11 +45,11 @@ class _EntityDropdownState extends State<EntityDropdown> {
|
|||
super.dispose();
|
||||
}
|
||||
|
||||
_showOptions() {
|
||||
void _showOptions() {
|
||||
widget.onFilterChanged('');
|
||||
var localization = AppLocalization.of(context);
|
||||
|
||||
_headerRow() {
|
||||
Widget _headerRow() {
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
|
|
@ -70,27 +70,27 @@ class _EntityDropdownState extends State<EntityDropdown> {
|
|||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.close),
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
_entityList(store) {
|
||||
Widget _entityList(Store<AppState> store) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: widget.entityList
|
||||
.getRange(0, min(6, widget.entityList.length))
|
||||
.map((entityId) {
|
||||
var entity = widget.entityMap[entityId];
|
||||
var filter =
|
||||
final entity = widget.entityMap[entityId];
|
||||
final filter =
|
||||
store.state.getUIState(widget.entityType).dropdownFilter;
|
||||
var subtitle = null;
|
||||
var matchField = entity.matchesSearchField(filter);
|
||||
String subtitle;
|
||||
final matchField = entity.matchesSearchField(filter);
|
||||
if (matchField != null) {
|
||||
var field = localization.lookup(matchField);
|
||||
var value = entity.matchesSearchValue(filter);
|
||||
final field = localization.lookup(matchField);
|
||||
final value = entity.matchesSearchValue(filter);
|
||||
subtitle = '$field: $value';
|
||||
}
|
||||
return ListTile(
|
||||
|
|
@ -141,7 +141,7 @@ class _EntityDropdownState extends State<EntityDropdown> {
|
|||
controller: _textController,
|
||||
decoration: InputDecoration(
|
||||
labelText: widget.labelText,
|
||||
suffixIcon: Icon(Icons.search),
|
||||
suffixIcon: const Icon(Icons.search),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in New Issue