createDataModelResponse method
void
createDataModelResponse(
- String pathPage,
- String pageName,
- String apiName,
- dynamic response,
)
Implementation
void createDataModelResponse(
String pathPage,
String pageName,
String apiName,
dynamic response,
) {
final apiClassName = apiName.pascalCase;
String classResponse = '''import 'dart:convert';
import 'package:core/core.dart';
''';
classResponse +=
getResponseClass(apiClassName, 'Response', '', response, true);
final path = join(pathPage, 'data', 'models', 'response');
DirectoryHelper.createDir(path);
join(path, '${apiName.snakeCase}_response.dart').write(classResponse);
StatusHelper.generated(join(path, '${apiName.snakeCase}_response.dart'));
}