Online payments

This commit is contained in:
Hillel Coren 2020-08-05 14:01:01 +03:00
parent bd64f724ea
commit 0546101733
2 changed files with 18 additions and 4 deletions

View File

@ -94,8 +94,9 @@ class CompanyGatewayListVM {
onRefreshed: (context) => _handleRefresh(context),
onRemovePressed: (gatewayId) {
gatewayIds.remove(gatewayId);
final settings = uiState.settings
.rebuild((b) => b..companyGatewayIds = gatewayIds.join(','));
final settings = uiState.settings.rebuild((b) => b
..companyGatewayIds =
gatewayIds.isEmpty ? '0' : gatewayIds.join(','));
store.dispatch(UpdateSettings(settings: settings));
},
onSortChanged: (int oldIndex, int newIndex) {

View File

@ -64,12 +64,25 @@ class CompanyGatewayScreen extends StatelessWidget {
onCancelPressed: (context) =>
store.dispatch(ClearCompanyGatewayMultiselect()),
)
else
else ...[
if (state.uiState.settingsUIState.isFiltered) ...[
FlatButton(
child: Text(localization.reset,
style: TextStyle(color: store.state.headerTextColor)),
onPressed: () {
final settings = store.state.uiState.settingsUIState.settings
.rebuild((b) => b..companyGatewayIds = '');
store.dispatch(UpdateSettings(settings: settings));
},
),
SizedBox(width: 10),
],
SaveCancelButtons(
isSaving: state.isSaving,
onSavePressed: viewModel.onSavePressed,
onCancelPressed: (_) => store.dispatch(ResetSettings()),
),
)
],
],
body: CompanyGatewayListBuilder(),
bottomNavigationBar: AppBottomBar(