@@ -5,7 +5,7 @@ import 'package:nylo_support/metro/metro_console.dart';
55class MetroService {
66 /// Creates a new Controller.
77 static Future makeController (String className, String value,
8- {String folderPath = controllerFolder , bool forceCreate = false }) async {
8+ {String folderPath = controllersFolder , bool forceCreate = false }) async {
99 String filePath = '$folderPath /${className .toLowerCase ()}_controller.dart' ;
1010
1111 await _makeDirectory (folderPath);
@@ -15,7 +15,7 @@ class MetroService {
1515
1616 /// Creates a new Page.
1717 static makePage (String className, String value,
18- {String folderPath = pageFolder , bool forceCreate = false }) async {
18+ {String folderPath = pagesFolder , bool forceCreate = false }) async {
1919 String filePath = '$folderPath /${className .toLowerCase ()}_page.dart' ;
2020
2121 await _makeDirectory (folderPath);
@@ -25,7 +25,7 @@ class MetroService {
2525
2626 /// Creates a new Model.
2727 static makeModel (String className, String value,
28- {String folderPath = modelFolder ,
28+ {String folderPath = modelsFolder ,
2929 bool storable = false ,
3030 bool forceCreate = false }) async {
3131 String filePath = '$folderPath /${className .toLowerCase ()}.dart' ;
@@ -37,7 +37,7 @@ class MetroService {
3737
3838 /// Creates a new Stateless Widget.
3939 static makeStatelessWidget (String className, String value,
40- {String folderPath = widgetFolder , bool forceCreate = false }) async {
40+ {String folderPath = widgetsFolder , bool forceCreate = false }) async {
4141 String filePath = '$folderPath /${className .toLowerCase ()}_widget.dart' ;
4242
4343 await _makeDirectory (folderPath);
@@ -47,7 +47,7 @@ class MetroService {
4747
4848 /// Creates a new Stateful Widget.
4949 static makeStatefulWidget (String className, String value,
50- {String folderPath = widgetFolder , bool forceCreate = false }) async {
50+ {String folderPath = widgetsFolder , bool forceCreate = false }) async {
5151 String filePath = '$folderPath /${className .toLowerCase ()}_widget.dart' ;
5252
5353 await _makeDirectory (folderPath);
@@ -57,7 +57,7 @@ class MetroService {
5757
5858 /// Creates a new Stateful Widget.
5959 static makeTheme (String className, String value,
60- {String folderPath = themeFolder , bool forceCreate = false }) async {
60+ {String folderPath = themesFolder , bool forceCreate = false }) async {
6161 String filePath = '$folderPath /${className .toLowerCase ()}_theme.dart' ;
6262
6363 await _makeDirectory (folderPath);
@@ -75,6 +75,16 @@ class MetroService {
7575 await _createNewFile (filePath, value);
7676 }
7777
78+ /// Creates a new Event.
79+ static makeEvent (String className, String value,
80+ {String folderPath = eventsFolder, bool forceCreate = false }) async {
81+ String filePath = '$folderPath /${className .toLowerCase ()}_event.dart' ;
82+
83+ await _makeDirectory (folderPath);
84+ await _checkIfFileExists (filePath, shouldForceCreate: forceCreate);
85+ await _createNewFile (filePath, value);
86+ }
87+
7888 /// Creates a new API service.
7989 static makeApiService (String className, String value,
8090 {String folderPath = networkingFolder, bool forceCreate = false }) async {
0 commit comments