Datatables
This commit is contained in:
parent
c30d34ffa3
commit
0f0cfcd88d
|
|
@ -12,10 +12,11 @@ import 'package:redux/redux.dart';
|
||||||
|
|
||||||
class AppBottomBar extends StatefulWidget {
|
class AppBottomBar extends StatefulWidget {
|
||||||
const AppBottomBar({
|
const AppBottomBar({
|
||||||
this.sortFields = const [],
|
@required this.sortFields,
|
||||||
this.onSelectedSortField,
|
@required this.onSelectedSortField,
|
||||||
this.entityType,
|
@required this.entityType,
|
||||||
this.onSelectedState,
|
@required this.onSelectedState,
|
||||||
|
@required this.onCheckboxPressed,
|
||||||
this.onSelectedStatus,
|
this.onSelectedStatus,
|
||||||
this.onSelectedCustom1,
|
this.onSelectedCustom1,
|
||||||
this.onSelectedCustom2,
|
this.onSelectedCustom2,
|
||||||
|
|
@ -31,6 +32,7 @@ class AppBottomBar extends StatefulWidget {
|
||||||
final EntityType entityType;
|
final EntityType entityType;
|
||||||
final List<String> sortFields;
|
final List<String> sortFields;
|
||||||
final List<EntityStatus> statuses;
|
final List<EntityStatus> statuses;
|
||||||
|
final Function onCheckboxPressed;
|
||||||
final Function(String) onSelectedSortField;
|
final Function(String) onSelectedSortField;
|
||||||
final Function(EntityState, bool) onSelectedState;
|
final Function(EntityState, bool) onSelectedState;
|
||||||
final Function(EntityStatus, bool) onSelectedStatus;
|
final Function(EntityStatus, bool) onSelectedStatus;
|
||||||
|
|
@ -291,12 +293,8 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: localization.multiselect,
|
tooltip: localization.multiselect,
|
||||||
icon: Icon(listState.isInMultiselect()
|
icon: Icon(Icons.check_box),
|
||||||
? Icons.check_box_outline_blank
|
onPressed: () => widget.onCheckboxPressed(),
|
||||||
: Icons.check_box),
|
|
||||||
onPressed: () {
|
|
||||||
//
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: localization.switchListTable,
|
tooltip: localization.switchListTable,
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,13 @@ class ClientScreen extends StatelessWidget {
|
||||||
onSelectedState: (EntityState state, value) {
|
onSelectedState: (EntityState state, value) {
|
||||||
store.dispatch(FilterClientsByState(state));
|
store.dispatch(FilterClientsByState(state));
|
||||||
},
|
},
|
||||||
|
onCheckboxPressed: () {
|
||||||
|
if (store.state.clientListState.isInMultiselect()) {
|
||||||
|
store.dispatch(ClearClientMultiselect());
|
||||||
|
} else {
|
||||||
|
store.dispatch(StartClientMultiselect());
|
||||||
|
}
|
||||||
|
},
|
||||||
customValues1: company.getCustomFieldValues(CustomFieldType.client1,
|
customValues1: company.getCustomFieldValues(CustomFieldType.client1,
|
||||||
excludeBlank: true),
|
excludeBlank: true),
|
||||||
customValues2: company.getCustomFieldValues(CustomFieldType.client2,
|
customValues2: company.getCustomFieldValues(CustomFieldType.client2,
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,8 @@ class CompanyGatewayScreen extends StatelessWidget {
|
||||||
],
|
],
|
||||||
body: CompanyGatewayListBuilder(),
|
body: CompanyGatewayListBuilder(),
|
||||||
bottomNavigationBar: AppBottomBar(
|
bottomNavigationBar: AppBottomBar(
|
||||||
|
sortFields: [],
|
||||||
|
onSelectedSortField: null,
|
||||||
entityType: EntityType.companyGateway,
|
entityType: EntityType.companyGateway,
|
||||||
onSelectedCustom1: (value) =>
|
onSelectedCustom1: (value) =>
|
||||||
store.dispatch(FilterCompanyGatewaysByCustom1(value)),
|
store.dispatch(FilterCompanyGatewaysByCustom1(value)),
|
||||||
|
|
@ -98,6 +100,13 @@ class CompanyGatewayScreen extends StatelessWidget {
|
||||||
onSelectedState: (EntityState state, value) {
|
onSelectedState: (EntityState state, value) {
|
||||||
store.dispatch(FilterCompanyGatewaysByState(state));
|
store.dispatch(FilterCompanyGatewaysByState(state));
|
||||||
},
|
},
|
||||||
|
onCheckboxPressed: () {
|
||||||
|
if (store.state.companyGatewayListState.isInMultiselect()) {
|
||||||
|
store.dispatch(ClearCompanyGatewayMultiselect());
|
||||||
|
} else {
|
||||||
|
store.dispatch(StartCompanyGatewayMultiselect());
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
heroTag: 'company_gateway_fab',
|
heroTag: 'company_gateway_fab',
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,13 @@ class DocumentScreen extends StatelessWidget {
|
||||||
onSelectedState: (EntityState state, value) {
|
onSelectedState: (EntityState state, value) {
|
||||||
store.dispatch(FilterDocumentsByState(state));
|
store.dispatch(FilterDocumentsByState(state));
|
||||||
},
|
},
|
||||||
|
onCheckboxPressed: () {
|
||||||
|
if (store.state.documentListState.isInMultiselect()) {
|
||||||
|
store.dispatch(ClearDocumentMultiselect());
|
||||||
|
} else {
|
||||||
|
store.dispatch(StartDocumentMultiselect());
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: userCompany.canCreate(EntityType.document)
|
floatingActionButton: userCompany.canCreate(EntityType.document)
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,13 @@ class ExpenseScreen extends StatelessWidget {
|
||||||
onSelectedStatus: (EntityStatus status, value) {
|
onSelectedStatus: (EntityStatus status, value) {
|
||||||
store.dispatch(FilterExpensesByStatus(status));
|
store.dispatch(FilterExpensesByStatus(status));
|
||||||
},
|
},
|
||||||
|
onCheckboxPressed: () {
|
||||||
|
if (store.state.expenseListState.isInMultiselect()) {
|
||||||
|
store.dispatch(ClearExpenseMultiselect());
|
||||||
|
} else {
|
||||||
|
store.dispatch(StartExpenseMultiselect());
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: userCompany.canCreate(EntityType.expense)
|
floatingActionButton: userCompany.canCreate(EntityType.expense)
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,13 @@ class GroupSettingsScreen extends StatelessWidget {
|
||||||
onSelectedState: (EntityState state, value) {
|
onSelectedState: (EntityState state, value) {
|
||||||
store.dispatch(FilterGroupsByState(state));
|
store.dispatch(FilterGroupsByState(state));
|
||||||
},
|
},
|
||||||
|
onCheckboxPressed: () {
|
||||||
|
if (store.state.groupListState.isInMultiselect()) {
|
||||||
|
store.dispatch(ClearGroupMultiselect());
|
||||||
|
} else {
|
||||||
|
store.dispatch(StartGroupMultiselect());
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: state.userCompany.canCreate(EntityType.group)
|
floatingActionButton: state.userCompany.canCreate(EntityType.group)
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
|
|
|
||||||
|
|
@ -152,6 +152,13 @@ class InvoiceScreen extends StatelessWidget {
|
||||||
..name = localization.pastDue,
|
..name = localization.pastDue,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
onCheckboxPressed: () {
|
||||||
|
if (store.state.invoiceListState.isInMultiselect()) {
|
||||||
|
store.dispatch(ClearInvoiceMultiselect());
|
||||||
|
} else {
|
||||||
|
store.dispatch(StartInvoiceMultiselect());
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: userCompany.canCreate(EntityType.invoice)
|
floatingActionButton: userCompany.canCreate(EntityType.invoice)
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,13 @@ class PaymentScreen extends StatelessWidget {
|
||||||
onSelectedState: (EntityState state, value) {
|
onSelectedState: (EntityState state, value) {
|
||||||
store.dispatch(FilterPaymentsByState(state));
|
store.dispatch(FilterPaymentsByState(state));
|
||||||
},
|
},
|
||||||
|
onCheckboxPressed: () {
|
||||||
|
if (store.state.paymentListState.isInMultiselect()) {
|
||||||
|
store.dispatch(ClearPaymentMultiselect());
|
||||||
|
} else {
|
||||||
|
store.dispatch(StartPaymentMultiselect());
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: userCompany.canCreate(EntityType.payment)
|
floatingActionButton: userCompany.canCreate(EntityType.payment)
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,13 @@ class ProductScreen extends StatelessWidget {
|
||||||
onSelectedState: (EntityState state, value) {
|
onSelectedState: (EntityState state, value) {
|
||||||
store.dispatch(FilterProductsByState(state));
|
store.dispatch(FilterProductsByState(state));
|
||||||
},
|
},
|
||||||
|
onCheckboxPressed: () {
|
||||||
|
if (store.state.productListState.isInMultiselect()) {
|
||||||
|
store.dispatch(ClearProductMultiselect());
|
||||||
|
} else {
|
||||||
|
store.dispatch(StartProductMultiselect());
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: userCompany.canCreate(EntityType.product)
|
floatingActionButton: userCompany.canCreate(EntityType.product)
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,13 @@ class ProjectScreen extends StatelessWidget {
|
||||||
onSelectedState: (EntityState state, value) {
|
onSelectedState: (EntityState state, value) {
|
||||||
store.dispatch(FilterProjectsByState(state));
|
store.dispatch(FilterProjectsByState(state));
|
||||||
},
|
},
|
||||||
|
onCheckboxPressed: () {
|
||||||
|
if (store.state.projectListState.isInMultiselect()) {
|
||||||
|
store.dispatch(ClearProjectMultiselect());
|
||||||
|
} else {
|
||||||
|
store.dispatch(StartProjectMultiselect());
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: userCompany.canCreate(EntityType.project)
|
floatingActionButton: userCompany.canCreate(EntityType.project)
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,13 @@ class QuoteScreen extends StatelessWidget {
|
||||||
..name = localization.expired,
|
..name = localization.expired,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
onCheckboxPressed: () {
|
||||||
|
if (store.state.quoteListState.isInMultiselect()) {
|
||||||
|
store.dispatch(ClearQuoteMultiselect());
|
||||||
|
} else {
|
||||||
|
store.dispatch(StartQuoteMultiselect());
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: userCompany.canCreate(EntityType.quote)
|
floatingActionButton: userCompany.canCreate(EntityType.quote)
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,13 @@ class TaskScreen extends StatelessWidget {
|
||||||
onSelectedState: (EntityState state, value) {
|
onSelectedState: (EntityState state, value) {
|
||||||
store.dispatch(FilterTasksByState(state));
|
store.dispatch(FilterTasksByState(state));
|
||||||
},
|
},
|
||||||
|
onCheckboxPressed: () {
|
||||||
|
if (store.state.taskListState.isInMultiselect()) {
|
||||||
|
store.dispatch(ClearTaskMultiselect());
|
||||||
|
} else {
|
||||||
|
store.dispatch(StartTaskMultiselect());
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: userCompany.canCreate(EntityType.task)
|
floatingActionButton: userCompany.canCreate(EntityType.task)
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,13 @@ class TaxRateSettingsScreen extends StatelessWidget {
|
||||||
onSelectedState: (EntityState state, value) {
|
onSelectedState: (EntityState state, value) {
|
||||||
store.dispatch(FilterTaxRatesByState(state));
|
store.dispatch(FilterTaxRatesByState(state));
|
||||||
},
|
},
|
||||||
|
onCheckboxPressed: () {
|
||||||
|
if (store.state.taxRateListState.isInMultiselect()) {
|
||||||
|
store.dispatch(ClearTaxRateMultiselect());
|
||||||
|
} else {
|
||||||
|
store.dispatch(StartTaxRateMultiselect());
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: state.userCompany.canCreate(EntityType.taxRate)
|
floatingActionButton: state.userCompany.canCreate(EntityType.taxRate)
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,13 @@ class UserScreen extends StatelessWidget {
|
||||||
onSelectedState: (EntityState state, value) {
|
onSelectedState: (EntityState state, value) {
|
||||||
store.dispatch(FilterUsersByState(state));
|
store.dispatch(FilterUsersByState(state));
|
||||||
},
|
},
|
||||||
|
onCheckboxPressed: () {
|
||||||
|
if (store.state.userListState.isInMultiselect()) {
|
||||||
|
store.dispatch(ClearUserMultiselect());
|
||||||
|
} else {
|
||||||
|
store.dispatch(StartUserMultiselect());
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: userCompany.canCreate(EntityType.user)
|
floatingActionButton: userCompany.canCreate(EntityType.user)
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,13 @@ class VendorScreen extends StatelessWidget {
|
||||||
onSelectedState: (EntityState state, value) {
|
onSelectedState: (EntityState state, value) {
|
||||||
store.dispatch(FilterVendorsByState(state));
|
store.dispatch(FilterVendorsByState(state));
|
||||||
},
|
},
|
||||||
|
onCheckboxPressed: () {
|
||||||
|
if (store.state.vendorListState.isInMultiselect()) {
|
||||||
|
store.dispatch(ClearVendorMultiselect());
|
||||||
|
} else {
|
||||||
|
store.dispatch(StartVendorMultiselect());
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: userCompany.canCreate(EntityType.vendor)
|
floatingActionButton: userCompany.canCreate(EntityType.vendor)
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,13 @@ class StubScreen extends StatelessWidget {
|
||||||
onSelectedState: (EntityState state, value) {
|
onSelectedState: (EntityState state, value) {
|
||||||
store.dispatch(FilterStubsByState(state));
|
store.dispatch(FilterStubsByState(state));
|
||||||
},
|
},
|
||||||
|
onCheckboxPressed: () {
|
||||||
|
if (store.state.stubListState.isInMultiselect()) {
|
||||||
|
store.dispatch(ClearStubMultiselect());
|
||||||
|
} else {
|
||||||
|
store.dispatch(StartStubMultiselect());
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
floatingActionButton: user.canCreate(EntityType.stub)
|
floatingActionButton: user.canCreate(EntityType.stub)
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue