mirror of
https://github.com/foss42/apidash.git
synced 2025-12-02 02:39:19 +08:00
refactor: move auth models to better_networking package
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import 'package:apidash/screens/common_widgets/auth_textfield.dart';
|
||||
import 'package:apidash_core/consts.dart';
|
||||
import 'package:apidash_core/models/auth/api_auth_model.dart';
|
||||
import 'package:apidash_core/models/auth/auth_api_key_model.dart';
|
||||
import 'package:apidash_core/apidash_core.dart';
|
||||
import 'package:apidash_design_system/apidash_design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -10,12 +8,11 @@ class ApiKeyAuthFields extends StatefulWidget {
|
||||
final bool readOnly;
|
||||
final Function(AuthModel?) updateAuth;
|
||||
|
||||
const ApiKeyAuthFields({
|
||||
super.key,
|
||||
required this.authData,
|
||||
required this.updateAuth,
|
||||
this.readOnly = false
|
||||
});
|
||||
const ApiKeyAuthFields(
|
||||
{super.key,
|
||||
required this.authData,
|
||||
required this.updateAuth,
|
||||
this.readOnly = false});
|
||||
|
||||
@override
|
||||
State<ApiKeyAuthFields> createState() => _ApiKeyAuthFieldsState();
|
||||
@@ -76,7 +73,7 @@ class _ApiKeyAuthFieldsState extends State<ApiKeyAuthFields> {
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
AuthTextField(
|
||||
readOnly: widget.readOnly,
|
||||
readOnly: widget.readOnly,
|
||||
controller: _keyController,
|
||||
hintText: "API Key",
|
||||
isObscureText: true,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:apidash/consts.dart';
|
||||
import 'package:apidash/screens/home_page/editor_pane/details_card/request_pane/request_auth.dart';
|
||||
import 'package:apidash_core/consts.dart';
|
||||
import 'package:apidash_core/apidash_core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:apidash/providers/providers.dart';
|
||||
@@ -25,8 +25,8 @@ class EditGraphQLRequestPane extends ConsumerWidget {
|
||||
.select((value) => value?.httpRequestModel?.hasQuery)) ??
|
||||
false;
|
||||
|
||||
final hasAuth = ref.watch(selectedRequestModelProvider.select((value) =>
|
||||
value?.authModel?.type != APIAuthType.none));
|
||||
final hasAuth = ref.watch(selectedRequestModelProvider
|
||||
.select((value) => value?.authModel?.type != APIAuthType.none));
|
||||
|
||||
final scriptsLength = ref.watch(selectedHistoryRequestModelProvider
|
||||
.select((value) => value?.preRequestScript?.length)) ??
|
||||
|
||||
Reference in New Issue
Block a user