mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 13:51:20 +08:00
Update request_body.dart
This commit is contained in:
@ -18,21 +18,16 @@ class EditRequestBody extends ConsumerWidget {
|
|||||||
final contentType = ref.watch(selectedRequestModelProvider
|
final contentType = ref.watch(selectedRequestModelProvider
|
||||||
.select((value) => value?.httpRequestModel?.bodyContentType));
|
.select((value) => value?.httpRequestModel?.bodyContentType));
|
||||||
|
|
||||||
|
final sm = ScaffoldMessenger.of(context);
|
||||||
void changeToPostMethod() {
|
void changeToPostMethod() {
|
||||||
RequestModel? model = ref
|
if (requestModel?.httpRequestModel!.method == HTTPVerb.get) {
|
||||||
.read(collectionStateNotifierProvider.notifier)
|
|
||||||
.getRequestModel(selectedId);
|
|
||||||
|
|
||||||
if (model!.httpRequestModel!.method == HTTPVerb.get) {
|
|
||||||
ref
|
ref
|
||||||
.read(collectionStateNotifierProvider.notifier)
|
.read(collectionStateNotifierProvider.notifier)
|
||||||
.update(selectedId, method: HTTPVerb.post);
|
.update(selectedId, method: HTTPVerb.post);
|
||||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
sm.hideCurrentSnackBar();
|
||||||
content: Text(
|
sm.showSnackBar(getSnackBar(
|
||||||
"Switched to POST method",
|
"Switched to POST method",
|
||||||
style: TextStyle(color: Colors.white),
|
small: false,
|
||||||
),
|
|
||||||
backgroundColor: Colors.black,
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user