Hide settings/limits for custom gateways

This commit is contained in:
Hillel Coren 2022-06-09 11:49:16 +03:00
parent a09b703806
commit 9af66a5f33
1 changed files with 135 additions and 129 deletions

View File

@ -212,10 +212,14 @@ class _CompanyGatewayEditState extends State<CompanyGatewayEdit>
), ),
], ],
), ),
if (companyGateway.gatewayId == kGatewayCustom)
Center(
child: HelpText(localization.noPaymentTypesEnabled),
)
else
ScrollableListView( ScrollableListView(
children: <Widget>[ children: <Widget>[
FormCard(children: <Widget>[ FormCard(children: <Widget>[
if (companyGateway.gatewayId != kGatewayCustom)
DecoratedFormField( DecoratedFormField(
label: localization.label, label: localization.label,
initialValue: companyGateway.label, initialValue: companyGateway.label,
@ -230,7 +234,8 @@ class _CompanyGatewayEditState extends State<CompanyGatewayEdit>
labelText: localization.captureCard, labelText: localization.captureCard,
value: companyGateway.tokenBilling, value: companyGateway.tokenBilling,
onChanged: (dynamic value) => viewModel.onChanged( onChanged: (dynamic value) => viewModel.onChanged(
companyGateway.rebuild((b) => b..tokenBilling = value)), companyGateway
.rebuild((b) => b..tokenBilling = value)),
items: [ items: [
CompanyGatewayEntity.TOKEN_BILLING_ALWAYS, CompanyGatewayEntity.TOKEN_BILLING_ALWAYS,
CompanyGatewayEntity.TOKEN_BILLING_OPT_OUT, CompanyGatewayEntity.TOKEN_BILLING_OPT_OUT,
@ -244,7 +249,8 @@ class _CompanyGatewayEditState extends State<CompanyGatewayEdit>
.toList(), .toList(),
), ),
SizedBox(height: 16), SizedBox(height: 16),
for (var gatewayTypeId in gateway?.options?.keys ?? <String>[]) for (var gatewayTypeId
in gateway?.options?.keys ?? <String>[])
SwitchListTile( SwitchListTile(
title: Text(localization title: Text(localization
.lookup(kGatewayTypes[gatewayTypeId] ?? '')), .lookup(kGatewayTypes[gatewayTypeId] ?? '')),