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