mirror of
https://github.com/foss42/apidash.git
synced 2025-05-21 08:16:29 +08:00
Minor updates
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -49,3 +49,4 @@ linux/
|
||||
macos/
|
||||
windows/
|
||||
web/
|
||||
.vscode/settings.json
|
||||
|
@ -28,7 +28,7 @@ class _RequestEditorPaneState extends ConsumerState<RequestEditorPane> {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Column(
|
||||
children: [
|
||||
children: const [
|
||||
EditorPaneRequestURLCard(),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
|
@ -150,7 +150,7 @@ class _URLTextFieldState extends ConsumerState<URLTextField> {
|
||||
key: Key("url-${activeId!}"),
|
||||
initialValue: ref
|
||||
.read(collectionStateNotifierProvider.notifier)
|
||||
.getRequestModel(activeId!)
|
||||
.getRequestModel(activeId)
|
||||
.url,
|
||||
style: codeStyle,
|
||||
decoration: InputDecoration(
|
||||
@ -161,7 +161,7 @@ class _URLTextFieldState extends ConsumerState<URLTextField> {
|
||||
onChanged: (value) {
|
||||
ref
|
||||
.read(collectionStateNotifierProvider.notifier)
|
||||
.update(activeId!, url: value);
|
||||
.update(activeId, url: value);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -20,6 +20,8 @@ class CollectionStateNotifier extends StateNotifier<List<RequestModel>> {
|
||||
),
|
||||
]);
|
||||
|
||||
final baseResponseModel = const ResponseModel();
|
||||
|
||||
int idxOfId(String id) => state.indexWhere((element) => element.id == id);
|
||||
|
||||
RequestModel getRequestModel(String id) {
|
||||
@ -95,8 +97,10 @@ class CollectionStateNotifier extends StateNotifier<List<RequestModel>> {
|
||||
message: responseRec.$2,
|
||||
);
|
||||
} else {
|
||||
final responseModel = ResponseModel()
|
||||
.fromResponse(response: responseRec.$0!, time: responseRec.$1!);
|
||||
final responseModel = baseResponseModel.fromResponse(
|
||||
response: responseRec.$0!,
|
||||
time: responseRec.$1!,
|
||||
);
|
||||
int statusCode = responseRec.$0!.statusCode;
|
||||
newRequestModel = requestModel.copyWith(
|
||||
responseStatus: statusCode,
|
||||
|
Reference in New Issue
Block a user