Fix problem adding paypal

This commit is contained in:
Hillel Coren 2020-06-04 21:41:56 +03:00
parent e46ab5e0fd
commit a6a9c68b1c
1 changed files with 10 additions and 10 deletions

View File

@ -378,17 +378,17 @@ class _GatewayConfigFieldState extends State<GatewayConfigField> {
if ('${widget.defaultValue}'.startsWith('[') &&
'${widget.defaultValue}'.endsWith(']')) {
final options = [
'',
...'${widget.defaultValue}'
final options = '${widget.defaultValue}'
.replaceFirst('[', '')
.replaceFirst(']', '')
.split(',')
];
final dynamic value =
widget.value == widget.defaultValue ? '' : widget.value;
.split(',');
return AppDropdownButton(
final dynamic value =
(widget.value == null || widget.value == widget.defaultValue)
? ''
: widget.value;
return AppDropdownButton<String>(
labelText: toTitleCase(widget.field),
value: value,
onChanged: (dynamic value) => widget.onChanged(value),