diff --git a/lib/ui/company_gateway/company_gateway_list_vm.dart b/lib/ui/company_gateway/company_gateway_list_vm.dart index f67ce0fae..a93006106 100644 --- a/lib/ui/company_gateway/company_gateway_list_vm.dart +++ b/lib/ui/company_gateway/company_gateway_list_vm.dart @@ -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) { diff --git a/lib/ui/company_gateway/company_gateway_screen.dart b/lib/ui/company_gateway/company_gateway_screen.dart index 94a7136e7..51dde526f 100644 --- a/lib/ui/company_gateway/company_gateway_screen.dart +++ b/lib/ui/company_gateway/company_gateway_screen.dart @@ -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(