newCommon static method

Future<void> newCommon(
  1. String commonName
)

this function will =>

  1. create file in common folder
  2. export this file into commons.dart file

Implementation

static Future<void> newCommon(String commonName) async {
  final newCommonFile = _getFile('$commonName.dart', _commonFolder);
  if (newCommonFile.existsSync()) {
    print('$commonName is exists before');
    return;
  }
  newCommonFile.createSync(recursive: true);
  await _exportNewCommon(commonName);
  await git('new common $commonName', true);
}