createDataModelBody method
void
createDataModelBody(])
Implementation
void createDataModelBody(
String pathPage,
String pageName,
String apiName,
dynamic body, [
bool isMultipart = false,
List<String> paramPath = const [],
]) {
final apiClassName = apiName.pascalCase;
String classBody =
'''${isMultipart ? "import 'dart:io';\n" : ''}import 'package:core/core.dart';
''';
classBody += getBodyClass(
apiClassName,
'Body',
'',
body,
true,
isMultipart,
paramPath,
);
final path = join(pathPage, 'data', 'models', 'body');
DirectoryHelper.createDir(path);
join(path, '${apiName.snakeCase}_body.dart').write(classBody);
StatusHelper.generated(join(path, '${apiName.snakeCase}_body.dart'));
}