makePage static method

dynamic makePage(
  1. String className,
  2. String value, {
  3. String folderPath = pagesFolder,
  4. bool forceCreate = false,
  5. String? pathWithinFolder,
})

Creates a new Page.

Implementation

static makePage(String className, String value,
    {String folderPath = pagesFolder,
    bool forceCreate = false,
    String? pathWithinFolder}) async {
  String filePath =
      '$folderPath/${pathWithinFolder != null ? '$pathWithinFolder/' : ''}${className.toLowerCase()}_page.dart';

  await _makeDirectory(folderPath);
  await _checkIfFileExists(filePath, shouldForceCreate: forceCreate);
  await _createNewFile(filePath, value);
}