diff --git a/lib/screens/common_widgets/auth/api_key_auth_fields.dart b/lib/screens/common_widgets/auth/api_key_auth_fields.dart index 1bf5a3e7..aa020f3a 100644 --- a/lib/screens/common_widgets/auth/api_key_auth_fields.dart +++ b/lib/screens/common_widgets/auth/api_key_auth_fields.dart @@ -55,14 +55,16 @@ class _ApiKeyAuthFieldsState extends State { ], 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( diff --git a/lib/screens/common_widgets/auth/digest_auth_fields.dart b/lib/screens/common_widgets/auth/digest_auth_fields.dart index aa31efa4..eaa4028e 100644 --- a/lib/screens/common_widgets/auth/digest_auth_fields.dart +++ b/lib/screens/common_widgets/auth/digest_auth_fields.dart @@ -102,14 +102,16 @@ class _DigestAuthFieldsState extends State { ], 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( diff --git a/lib/screens/common_widgets/auth/jwt_auth_fields.dart b/lib/screens/common_widgets/auth/jwt_auth_fields.dart index 2982ab07..1637e7f5 100644 --- a/lib/screens/common_widgets/auth/jwt_auth_fields.dart +++ b/lib/screens/common_widgets/auth/jwt_auth_fields.dart @@ -61,14 +61,16 @@ class _JwtAuthFieldsState extends State { ], 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 { ], 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')) ...[