StringUtils class
A utility class for string manipulation, focusing on case conversions and formatting relevant to code generation (e.g., from database names to Dart conventions).
Constructors
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
capitalize(
String text) → String - Capitalizes the first letter of a string.
-
createDocComment(
String? comment) → String? - Creates a Dart-style documentation comment (doc comment) from a string.
-
createImport(
String path) → String -
Creates a Dart import statement string for the given
path
. -
pluralize(
String word) → String - Attempts to make a word plural using common English pluralization rules.
-
singularize(
String word) → String - Attempts to make a word singular using common English pluralization rules.
-
toCamelCase(
String text) → String - Converts a string to camelCase.
-
toClassName(
String name, {String? prefix, String? suffix}) → String - Converts a string (typically a database table or column name) to a Dart class name convention (PascalCase or UpperCamelCase).
-
toFileName(
String name) → String - Converts a string (typically a class or concept name) to a Dart file name convention (snake_case).
-
toPascalCase(
String text) → String - Converts a string to PascalCase (UpperCamelCase).
-
toVariableName(
String name) → String - Converts a string (typically a database column name) to a Dart variable name convention (camelCase).