Utility class

Constructors

Utility()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addImportAndChangesInFile({required String filePath, required List<String> importStatements, required List<String> methodCalls}) → Future<void>
convertCamelcaseStringToUnderscore({required String input}) → String
getFileName({required String filePath}) → String
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeMapEntry({required String keyToRemove, required Map<String, dynamic> map}) → Map<String, String>
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

addCodeAboveBraces({required String filePath, required List<String> linesToAdd}) → Future<void>
addImport({required String filePath, required List<String> importStatements}) → Future<void>
appendLinesToFile({required String filePath, required List<String> linesToAppend}) → Future<void>
camelCaseFirstLower({required String input}) → String
collapseWhitespace(String input) → String
Collapses every run of whitespace (spaces, tabs, newlines) to a single space and trims the result. Used to compare code that dart format may have re-indented or wrapped across multiple physical lines, so matching stays stable regardless of formatting.
commandError() → void
copyFolder({required String sourcePath, required String destinationPath}) → Future<void>
covertToObjVariableName({required String input}) → String
createFolder({required String path}) → void
doesFileExist({required String filePath}) → bool
errorPrinter({required String text, String? textWithoutColor}) → void
findAndReplace({required String filePath, required String searchString, required String replacement, bool warnIfMissing = false}) → Future<void>
Replaces searchString with replacement on every line that contains it.
formatCode() → Future<void>
getDirFromCliPackage({required String sourceFolderPath}) → String
Pass path after feature
getPackageNameAndVersion() → String
getPubspecInfo() → String?
getResolvedPackageVersion({required String packageDirPath, required String packageName}) → String?
The version of packageName recorded in the project's pubspec.lock, or null when there is no lock file or no entry for the package in it.
grantPermissions({required String folderPath}) → void
infoPrinter({required String text, String? textWithoutColor}) → void
processFile({required File file, required String substring, required String replacement, required String finalReplacement}) → Future<void>
processFiles({required String path, required String substring, required String replacement, required bool isPascalCase, String targetFileName = ''}) → Future<void>
removeImport({required String filePath, required List<String> importStatements}) → Future<void>
Drops importStatements from filePath if they are present.
renameFilesWithSubstring({required String path, required String substring, required String newName}) → Future<void>
stdoutWrite({required String text, String? textWithoutColor}) → String
successPrinter({required String text, String? textWithoutColor}) → void
toLogicalLines(List<String> physicalLines) → List<String>
Merges physical source lines into logical statements so that line-based scanning is immune to how dart format wraps code. dart format may split one statement across several physical lines (e.g. a long field = json['key']; becomes field = + json['key'];). This joins the continuation lines back together — accumulating until the buffered text ends with ;, { or } — so callers see each statement whole, with its tokens on a single logical line, regardless of formatting.
toPascalCase({required String input}) → String
toScreamingSnakeCase({required String input}) → String
ratingStar, rating_star and rating-star all become RATING_STAR. Callers build SCREAMING_SNAKE_CASE constant names from user input, which a plain toUpperCase() mangles for camelCase arguments (RATINGSTAR).
toTitleCase({required String input}) → String
product_detail → Product Detail; used for the screen name reported to Firebase Analytics.