diff --git a/lib/ui/company_gateway/company_gateway_screen.dart b/lib/ui/company_gateway/company_gateway_screen.dart index 462537dac..43cd5e777 100644 --- a/lib/ui/company_gateway/company_gateway_screen.dart +++ b/lib/ui/company_gateway/company_gateway_screen.dart @@ -79,8 +79,9 @@ class CompanyGatewayScreen extends StatelessWidget { ) else SaveCancelButtons( - //onSavePressed: viewModel.on, - ), + onSavePressed: viewModel.onSavePressed, + onCancelPressed: viewModel.onCancelPressed, + ), ], body: CompanyGatewayListBuilder(), bottomNavigationBar: AppBottomBar( diff --git a/lib/ui/company_gateway/company_gateway_screen_vm.dart b/lib/ui/company_gateway/company_gateway_screen_vm.dart index b94a44950..b847d8312 100644 --- a/lib/ui/company_gateway/company_gateway_screen_vm.dart +++ b/lib/ui/company_gateway/company_gateway_screen_vm.dart @@ -43,6 +43,7 @@ class CompanyGatewayScreenVM { @required this.onEntityAction, @required this.companyGatewayMap, @required this.onSavePressed, + @required this.onCancelPressed, }); final bool isInMultiselect; @@ -51,6 +52,7 @@ class CompanyGatewayScreenVM { final Function(BuildContext, List, EntityAction) onEntityAction; final BuiltMap companyGatewayMap; final Function(BuildContext) onSavePressed; + final Function(BuildContext) onCancelPressed; static CompanyGatewayScreenVM fromStore(Store store) { final state = store.state; @@ -66,6 +68,7 @@ class CompanyGatewayScreenVM { onEntityAction: (BuildContext context, List companyGateways, EntityAction action) => handleCompanyGatewayAction(context, companyGateways, action), + onCancelPressed: (context) => store.dispatch(ResetSettings()), onSavePressed: (context) { final settingsUIState = state.uiState.settingsUIState; switch (settingsUIState.entityType) {