mirror of
https://github.com/foss42/apidash.git
synced 2025-12-06 04:56:16 +08:00
feat: update initial values for auth fields to use local state variables
This commit is contained in:
@@ -31,12 +31,9 @@ class _ApiKeyAuthFieldsState extends State<ApiKeyAuthFields> {
|
|||||||
super.initState();
|
super.initState();
|
||||||
final apiAuth = widget.authData?.apikey;
|
final apiAuth = widget.authData?.apikey;
|
||||||
_key = apiAuth?.key ?? '';
|
_key = apiAuth?.key ?? '';
|
||||||
log(apiAuth?.name ?? "By default name is empty");
|
|
||||||
_name = (apiAuth?.name != null && apiAuth!.name.isNotEmpty)
|
_name = (apiAuth?.name != null && apiAuth!.name.isNotEmpty)
|
||||||
? apiAuth.name
|
? apiAuth.name
|
||||||
: kApiKeyHeaderName;
|
: kApiKeyHeaderName;
|
||||||
|
|
||||||
log(_name);
|
|
||||||
_addKeyTo = apiAuth?.location ?? kAddToDefaultLocation;
|
_addKeyTo = apiAuth?.location ?? kAddToDefaultLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class _BasicAuthFieldsState extends State<BasicAuthFields> {
|
|||||||
EnvAuthField(
|
EnvAuthField(
|
||||||
readOnly: widget.readOnly,
|
readOnly: widget.readOnly,
|
||||||
hintText: kHintUsername,
|
hintText: kHintUsername,
|
||||||
initialValue: widget.authData?.basic?.username,
|
initialValue: _username,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
_username = value;
|
_username = value;
|
||||||
_updateBasicAuth();
|
_updateBasicAuth();
|
||||||
@@ -49,7 +49,7 @@ class _BasicAuthFieldsState extends State<BasicAuthFields> {
|
|||||||
readOnly: widget.readOnly,
|
readOnly: widget.readOnly,
|
||||||
hintText: kHintPassword,
|
hintText: kHintPassword,
|
||||||
isObscureText: true,
|
isObscureText: true,
|
||||||
initialValue: widget.authData?.basic?.password,
|
initialValue: _password,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
_password = value;
|
_password = value;
|
||||||
_updateBasicAuth();
|
_updateBasicAuth();
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class _BearerAuthFieldsState extends State<BearerAuthFields> {
|
|||||||
readOnly: widget.readOnly,
|
readOnly: widget.readOnly,
|
||||||
hintText: kHintToken,
|
hintText: kHintToken,
|
||||||
isObscureText: true,
|
isObscureText: true,
|
||||||
initialValue: widget.authData?.bearer?.token,
|
initialValue: _token,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
_token = value;
|
_token = value;
|
||||||
_updateBearerAuth();
|
_updateBearerAuth();
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class _DigestAuthFieldsState extends State<DigestAuthFields> {
|
|||||||
readOnly: widget.readOnly,
|
readOnly: widget.readOnly,
|
||||||
hintText: kHintUsername,
|
hintText: kHintUsername,
|
||||||
infoText: kInfoDigestUsername,
|
infoText: kInfoDigestUsername,
|
||||||
initialValue: widget.authData?.digest?.username,
|
initialValue: _username,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
_username = value;
|
_username = value;
|
||||||
_updateDigestAuth();
|
_updateDigestAuth();
|
||||||
@@ -64,7 +64,7 @@ class _DigestAuthFieldsState extends State<DigestAuthFields> {
|
|||||||
hintText: kHintPassword,
|
hintText: kHintPassword,
|
||||||
isObscureText: true,
|
isObscureText: true,
|
||||||
infoText: kInfoDigestPassword,
|
infoText: kInfoDigestPassword,
|
||||||
initialValue: widget.authData?.digest?.password,
|
initialValue: _password,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
_password = value;
|
_password = value;
|
||||||
_updateDigestAuth();
|
_updateDigestAuth();
|
||||||
@@ -75,7 +75,7 @@ class _DigestAuthFieldsState extends State<DigestAuthFields> {
|
|||||||
readOnly: widget.readOnly,
|
readOnly: widget.readOnly,
|
||||||
hintText: kHintRealm,
|
hintText: kHintRealm,
|
||||||
infoText: kInfoDigestRealm,
|
infoText: kInfoDigestRealm,
|
||||||
initialValue: widget.authData?.digest?.realm,
|
initialValue: _realm,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
_realm = value;
|
_realm = value;
|
||||||
_updateDigestAuth();
|
_updateDigestAuth();
|
||||||
@@ -86,7 +86,7 @@ class _DigestAuthFieldsState extends State<DigestAuthFields> {
|
|||||||
readOnly: widget.readOnly,
|
readOnly: widget.readOnly,
|
||||||
hintText: kHintNonce,
|
hintText: kHintNonce,
|
||||||
infoText: kInfoDigestNonce,
|
infoText: kInfoDigestNonce,
|
||||||
initialValue: widget.authData?.digest?.nonce,
|
initialValue: _nonce,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
_nonce = value;
|
_nonce = value;
|
||||||
_updateDigestAuth();
|
_updateDigestAuth();
|
||||||
@@ -122,7 +122,7 @@ class _DigestAuthFieldsState extends State<DigestAuthFields> {
|
|||||||
readOnly: widget.readOnly,
|
readOnly: widget.readOnly,
|
||||||
hintText: kHintQop,
|
hintText: kHintQop,
|
||||||
infoText: kInfoDigestQop,
|
infoText: kInfoDigestQop,
|
||||||
initialValue: widget.authData?.digest?.qop,
|
initialValue: _qop,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
_qop = value;
|
_qop = value;
|
||||||
_updateDigestAuth();
|
_updateDigestAuth();
|
||||||
@@ -133,7 +133,7 @@ class _DigestAuthFieldsState extends State<DigestAuthFields> {
|
|||||||
readOnly: widget.readOnly,
|
readOnly: widget.readOnly,
|
||||||
hintText: kHintDataString,
|
hintText: kHintDataString,
|
||||||
infoText: kInfoDigestDataString,
|
infoText: kInfoDigestDataString,
|
||||||
initialValue: widget.authData?.digest?.opaque,
|
initialValue: _opaque,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
_opaque = value;
|
_opaque = value;
|
||||||
_updateDigestAuth();
|
_updateDigestAuth();
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ class _JwtAuthFieldsState extends State<JwtAuthFields> {
|
|||||||
isObscureText: true,
|
isObscureText: true,
|
||||||
hintText: kHintSecret,
|
hintText: kHintSecret,
|
||||||
infoText: kInfoSecret,
|
infoText: kInfoSecret,
|
||||||
initialValue: widget.authData?.jwt?.secret,
|
initialValue: _secret,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
_secret = value;
|
_secret = value;
|
||||||
_updateJwtAuth();
|
_updateJwtAuth();
|
||||||
|
|||||||
Reference in New Issue
Block a user