From c63ac1858cf02ff5f77af1b598a043ce99480e91 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 11 Nov 2019 12:30:44 +0200 Subject: [PATCH] Settings --- lib/ui/company_gateway/company_gateway_screen.dart | 5 +++-- lib/ui/company_gateway/company_gateway_screen_vm.dart | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) 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) {