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