saveToFile method

Future<File> saveToFile([
  1. String? filePath
])

Save generated class to file. Defaults to brick/models/LAST_ENDPOINT_PATH.dart

Implementation

Future<File> saveToFile([String? filePath]) async {
  filePath = filePath ?? 'brick/models/${endpoint.split('/').last}.dart';
  final contents = await generate();
  final file = File(filePath);
  return await file.writeAsString(contents);
}