Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolved issue #178(switch from GET->POST if payload exists) #443

Merged
merged 15 commits into from
Sep 16, 2024
Prev Previous commit
Next Next commit
Update request_body.dart
ashitaprasad committed Sep 16, 2024
commit 31c84da762941c1ba48fb05289820901b27d1a55
Original file line number Diff line number Diff line change
@@ -18,21 +18,16 @@ class EditRequestBody extends ConsumerWidget {
final contentType = ref.watch(selectedRequestModelProvider
.select((value) => value?.httpRequestModel?.bodyContentType));

final sm = ScaffoldMessenger.of(context);
void changeToPostMethod() {
RequestModel? model = ref
.read(collectionStateNotifierProvider.notifier)
.getRequestModel(selectedId);

if (model!.httpRequestModel!.method == HTTPVerb.get) {
if (requestModel?.httpRequestModel!.method == HTTPVerb.get) {
ref
.read(collectionStateNotifierProvider.notifier)
.update(selectedId, method: HTTPVerb.post);
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text(
"Switched to POST method",
style: TextStyle(color: Colors.white),
),
backgroundColor: Colors.black,
sm.hideCurrentSnackBar();
sm.showSnackBar(getSnackBar(
"Switched to POST method",
small: false,
));
}
}