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