mirror of
https://github.com/foss42/apidash.git
synced 2025-12-06 04:56:16 +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",
|
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(
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -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')) ...[
|
||||||
|
|||||||
Reference in New Issue
Block a user