fix: disable onChanged for read-only auth fields

This commit is contained in:
Udhay-Adithya
2025-07-07 22:32:14 +05:30
parent 38d8e8e76b
commit 127b2c1efc
3 changed files with 40 additions and 32 deletions

View File

@@ -55,14 +55,16 @@ class _ApiKeyAuthFieldsState extends State<ApiKeyAuthFields> {
], ],
tooltip: "Select where to add API key", tooltip: "Select where to add API key",
isOutlined: true, isOutlined: true,
onChanged: (String? newLocation) { onChanged: widget.readOnly
if (newLocation != null) { ? null
setState(() { : (String? newLocation) {
_addKeyTo = newLocation; if (newLocation != null) {
}); setState(() {
_updateApiKeyAuth(); _addKeyTo = newLocation;
} });
}, _updateApiKeyAuth();
}
},
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
AuthTextField( AuthTextField(

View File

@@ -102,14 +102,16 @@ class _DigestAuthFieldsState extends State<DigestAuthFields> {
], ],
tooltip: "Algorithm that will be used to produce the digest", tooltip: "Algorithm that will be used to produce the digest",
isOutlined: true, isOutlined: true,
onChanged: (String? newLocation) { onChanged: widget.readOnly
if (newLocation != null) { ? null
setState(() { : (String? newLocation) {
_algorithmController = newLocation; if (newLocation != null) {
}); setState(() {
_updateDigestAuth(); _algorithmController = newLocation;
} });
}, _updateDigestAuth();
}
},
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
AuthTextField( AuthTextField(

View File

@@ -61,14 +61,16 @@ class _JwtAuthFieldsState extends State<JwtAuthFields> {
], ],
tooltip: "Select where to add JWT token", tooltip: "Select where to add JWT token",
isOutlined: true, isOutlined: true,
onChanged: (String? newAddTokenTo) { onChanged: widget.readOnly
if (newAddTokenTo != null) { ? null
setState(() { : (String? newAddTokenTo) {
_addTokenTo = newAddTokenTo; if (newAddTokenTo != null) {
}); setState(() {
_updateJwtAuth(); _addTokenTo = newAddTokenTo;
} });
}, _updateJwtAuth();
}
},
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
Text( Text(
@@ -99,14 +101,16 @@ class _JwtAuthFieldsState extends State<JwtAuthFields> {
], ],
tooltip: "Select JWT algorithm", tooltip: "Select JWT algorithm",
isOutlined: true, isOutlined: true,
onChanged: (String? newAlgorithm) { onChanged: widget.readOnly
if (newAlgorithm != null) { ? null
setState(() { : (String? newAlgorithm) {
_algorithm = newAlgorithm; if (newAlgorithm != null) {
}); setState(() {
_updateJwtAuth(); _algorithm = newAlgorithm;
} });
}, _updateJwtAuth();
}
},
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
if (_algorithm.startsWith('HS')) ...[ if (_algorithm.startsWith('HS')) ...[