makeTheme static method
Creates a new Theme.
Implementation
static Future<void> 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: () {
final linkText = '${name.snakeCase}_theme';
final link = MetroConsole.hyperlink(linkText, filePath);
MetroConsole.writeInGreen('[Theme] $link created 🎉');
},
);
}