Describe the bug
Adding enum as a parameter generates a file with an error: the argument type 'enumType' can't be assigned to the parameter type 'String'
code ....
@override
Future<Model> testAPI({required ProviderType type}) async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _headers = <String, dynamic>{};
final _data = FormData();
_data.fields.add(MapEntry(
'param',
type, // the error is here, it is supposed to be type.toString(), or type.index.toString(), or type.toJson() as a manual parser is existed.
));
final _result = ....
Expected behavior
the expected behavior is to generate a file that automatically decode the enum to the mapped JsonValue
Describe the bug Adding enum as a parameter generates a file with an error:
the argument type 'enumType' can't be assigned to the parameter type 'String'
To Reproduce
the generated file is like this:
Expected behavior the expected behavior is to generate a file that automatically decode the enum to the mapped
JsonValue