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,7 +55,9 @@ class _ApiKeyAuthFieldsState extends State<ApiKeyAuthFields> {
],
tooltip: "Select where to add API key",
isOutlined: true,
onChanged: (String? newLocation) {
onChanged: widget.readOnly
? null
: (String? newLocation) {
if (newLocation != null) {
setState(() {
_addKeyTo = newLocation;

View File

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

View File

@@ -61,7 +61,9 @@ class _JwtAuthFieldsState extends State<JwtAuthFields> {
],
tooltip: "Select where to add JWT token",
isOutlined: true,
onChanged: (String? newAddTokenTo) {
onChanged: widget.readOnly
? null
: (String? newAddTokenTo) {
if (newAddTokenTo != null) {
setState(() {
_addTokenTo = newAddTokenTo;
@@ -99,7 +101,9 @@ class _JwtAuthFieldsState extends State<JwtAuthFields> {
],
tooltip: "Select JWT algorithm",
isOutlined: true,
onChanged: (String? newAlgorithm) {
onChanged: widget.readOnly
? null
: (String? newAlgorithm) {
if (newAlgorithm != null) {
setState(() {
_algorithm = newAlgorithm;