newModel static method

Future<void> newModel(
  1. String modelName
)

this function will =>

  1. create file model class in model folder
  2. export this file into model.dart file

Implementation

static Future<void> newModel(String modelName) async {
  final newModelFile = _getFile('$modelName.dart', _modelFolder);
  if (newModelFile.existsSync()) {
    print('$modelName is exists before');
    return;
  }
  newModelFile.createSync(recursive: true);
  newModelFile.writeAsString(_modelTemp(modelName));
  await _exportNewModel(modelName);
  await git('new model $modelName', true);
}