makeTheme static method

dynamic makeTheme(
  1. String className,
  2. String value, {
  3. String folderPath = themesFolder,
  4. bool forceCreate = false,
})

Creates a new Theme.

Implementation

static makeTheme(String className, String value,
    {String folderPath = themesFolder, bool forceCreate = false}) async {
  String name = className.replaceAll(RegExp(r'(_?theme)'), "");

  String filePath = '$folderPath/${name.snakeCase}_theme.dart';

  await _makeDirectory(folderPath);
  await _checkIfFileExists(filePath, shouldForceCreate: forceCreate);
  await _createNewFile(filePath, value, onSuccess: () {
    MetroConsole.writeInGreen('[Theme] ${name.snakeCase}_theme created 🎉');
  });
}