mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 13:51:20 +08:00
Add the functionality to import a curl file into the app.
The user can click on the button saying "+ Import" after which, they will be allow to drop a curl file and import the curl command in the app.
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import 'dart:typed_data';
|
||||
import 'dart:convert';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../models/models.dart';
|
||||
import '../consts.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
@ -179,3 +180,22 @@ List<NameValueModel>? getEnabledRows(
|
||||
rows.where((element) => isRowEnabledList[rows.indexOf(element)]).toList();
|
||||
return finalRows == [] ? null : finalRows;
|
||||
}
|
||||
|
||||
HTTPVerb? httpVerbFromString(String value) {
|
||||
switch (value) {
|
||||
case "GET":
|
||||
return HTTPVerb.get;
|
||||
case "POST":
|
||||
return HTTPVerb.post;
|
||||
case "PUT":
|
||||
return HTTPVerb.put;
|
||||
case "DELETE":
|
||||
return HTTPVerb.delete;
|
||||
case "HEAD":
|
||||
return HTTPVerb.head;
|
||||
case "PATCH":
|
||||
return HTTPVerb.patch;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user