create static method
Future<TestCase>
create(
- int sectionId, {
- Map<String, dynamic>? customValues,
- String? estimate,
- int? milestoneId,
- int? priorityId,
- String? refs,
- required String title,
- int? templateId,
- int? typeId,
})
Implementation
static Future<TestCase> create(
int sectionId, {
Map<String, dynamic>? customValues,
String? estimate,
int? milestoneId,
int? priorityId,
String? refs,
required String title,
int? templateId,
int? typeId,
}) async {
final parametersMap = {
if (estimate != null) 'estimate': estimate,
if (milestoneId != null) 'milestone_id': milestoneId,
if (priorityId != null) 'priority_id': priorityId,
if (refs != null) 'refs': refs,
if (templateId != null) 'template_id': templateId,
'title': title,
if (typeId != null) 'type_id': typeId,
};
customValues?.forEach((key, value) {
parametersMap.putIfAbsent(key, () => value);
});
final response = await FlutterTestRail.instance.client.request(
'/add_case/$sectionId',
RequestMethod.post,
params: parametersMap,
);
return TestCase.fromJson(response!);
}