mirror of
https://github.com/foss42/apidash.git
synced 2025-12-05 20:40:02 +08:00
fix: disable onChanged for read-only auth fields
This commit is contained in:
@@ -55,14 +55,16 @@ class _ApiKeyAuthFieldsState extends State<ApiKeyAuthFields> {
|
||||
],
|
||||
tooltip: "Select where to add API key",
|
||||
isOutlined: true,
|
||||
onChanged: (String? newLocation) {
|
||||
if (newLocation != null) {
|
||||
setState(() {
|
||||
_addKeyTo = newLocation;
|
||||
});
|
||||
_updateApiKeyAuth();
|
||||
}
|
||||
},
|
||||
onChanged: widget.readOnly
|
||||
? null
|
||||
: (String? newLocation) {
|
||||
if (newLocation != null) {
|
||||
setState(() {
|
||||
_addKeyTo = newLocation;
|
||||
});
|
||||
_updateApiKeyAuth();
|
||||
}
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
AuthTextField(
|
||||
|
||||
@@ -102,14 +102,16 @@ class _DigestAuthFieldsState extends State<DigestAuthFields> {
|
||||
],
|
||||
tooltip: "Algorithm that will be used to produce the digest",
|
||||
isOutlined: true,
|
||||
onChanged: (String? newLocation) {
|
||||
if (newLocation != null) {
|
||||
setState(() {
|
||||
_algorithmController = newLocation;
|
||||
});
|
||||
_updateDigestAuth();
|
||||
}
|
||||
},
|
||||
onChanged: widget.readOnly
|
||||
? null
|
||||
: (String? newLocation) {
|
||||
if (newLocation != null) {
|
||||
setState(() {
|
||||
_algorithmController = newLocation;
|
||||
});
|
||||
_updateDigestAuth();
|
||||
}
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
AuthTextField(
|
||||
|
||||
@@ -61,14 +61,16 @@ class _JwtAuthFieldsState extends State<JwtAuthFields> {
|
||||
],
|
||||
tooltip: "Select where to add JWT token",
|
||||
isOutlined: true,
|
||||
onChanged: (String? newAddTokenTo) {
|
||||
if (newAddTokenTo != null) {
|
||||
setState(() {
|
||||
_addTokenTo = newAddTokenTo;
|
||||
});
|
||||
_updateJwtAuth();
|
||||
}
|
||||
},
|
||||
onChanged: widget.readOnly
|
||||
? null
|
||||
: (String? newAddTokenTo) {
|
||||
if (newAddTokenTo != null) {
|
||||
setState(() {
|
||||
_addTokenTo = newAddTokenTo;
|
||||
});
|
||||
_updateJwtAuth();
|
||||
}
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
@@ -99,14 +101,16 @@ class _JwtAuthFieldsState extends State<JwtAuthFields> {
|
||||
],
|
||||
tooltip: "Select JWT algorithm",
|
||||
isOutlined: true,
|
||||
onChanged: (String? newAlgorithm) {
|
||||
if (newAlgorithm != null) {
|
||||
setState(() {
|
||||
_algorithm = newAlgorithm;
|
||||
});
|
||||
_updateJwtAuth();
|
||||
}
|
||||
},
|
||||
onChanged: widget.readOnly
|
||||
? null
|
||||
: (String? newAlgorithm) {
|
||||
if (newAlgorithm != null) {
|
||||
setState(() {
|
||||
_algorithm = newAlgorithm;
|
||||
});
|
||||
_updateJwtAuth();
|
||||
}
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
if (_algorithm.startsWith('HS')) ...[
|
||||
|
||||
Reference in New Issue
Block a user