_index.g
library
Classes
CategorizedPattern <TCategory extends Enum >
ClassInsight <TAnnotation >
CollectionMapperEvent
Mapper event for collection types, e.g. Map, List, Set.
CombinedPaths
A mechanism to combine root and subdirectory paths to form combined
directory paths that adhere to specific path patterns.
DartAnnotatedClassAnalyzer
Provides a mechanism to analyze Dart classes from a file path.
DirInsight
DirPathExplorerResult <TCategory extends Enum >
FileInsight
FilePathExplorerResult <TCategory extends Enum >
FileReadResult
GeneratorConverger <TInsight , TPlaceholder extends Enum , TFile >
InsightMapper <TInsight , TPlaceholder >
MapperEvent
Mapper event base class.
ObjectMapperEvent
Mapper event for non-collection types, e.g. int, String, DateTime.
OnAnnotatedClassParams
Params for _TOnAnnotatedClassCallback
.
OnAnnotatedMemberParams
Params for _TOnAnnotatedMemberCallback
.
OnAnnotatedMethodParams
Params for _TOnAnnotatedMethodCallback
.
OnClassAnnotationFieldParams
Params for _TOnClassAnnotationFieldCallback
.
OnMemberAnnotationFieldParams
Params for _TOnMemberAnnotationFieldsCallback
.
OnMethodAnnotationFieldParams
Params for _TOnMethodAnnotationFieldCallback
.
PathExplorer <TCategory extends Enum >
A mechanism to explore files and folders from specified dirPathGroups .
PathExplorerResult <TCategory extends Enum >
ReplacementProducer <TInsight , TPlaceholder extends Enum >
Replacements <TInsight >
TypeMappers
ValidArgsChecker
Provides a mechanism to check if command line args are valid or not.
Enums
Lang
An enumeration of languages that are partially or fully supported for code
generation.
Functions
buildCollectionMapper (Iterable <List <String > > typeData , TTypeMappers <MapperEvent > mappers )
→ String
buildObjectMapper (String type , String fieldName , TTypeMappers <MapperEvent > mappers )
→ String ?
clearFile (String filePath )
→ Future <void >
Clears the contents of the file located at filePath
.
combinePathSets (List <Set <String > > pathSets )
→ Set <String >
Combines multiple pathSets
into a single set, returning all possible
combinations.
createDartAnalysisContextCollection (Iterable <String > paths , String ? fallbackDartSdkPath )
→ AnalysisContextCollection
Creates an AnalysisContextCollection
from a set of paths
. This is used
to analyze Dart files.
deleteFile (String filePath )
→ Future <void >
Deletes the file located at filePath
.
Extracts all code for the language langCode
from some Markdown content
.
Extracts all code snippets for the language langCode
from some Markdown content
.
Filters dirPaths
by extracting only the topmost directory paths. Use
toPath
to specify how to map T
to the path String.
fileExists (String filePath )
→ Future <bool >
Returns true
if the file located at filePath
exists.
filterMappersByType (TTypeMappers <MapperEvent > mappers , String type )
→ TTypeMappers <MapperEvent >
Searches mappers
for mappers that match the given type
and returns them.
findFileByName (String fileName , String directoryPath )
→ Future <File ? >
Finds a file with the given fileName
in the directory located at
directoryPath
. Returns null
if the directory does not exist or if the
findFilePaths (String rootDirPath , {Set <String > pathPatterns = const {} , bool recursive = true , FutureOr <bool > onFilePathFound (String filePath )? })
→ Future <List <String > >
Finds all files in rootDirPath
, including sub-directories if recursive
is true
.
findGeneratedFilePaths (String rootDirPath , {required Lang lang , Set <String > pathPatterns = const {} , FutureOr <bool > onFileFound (String filePath )? })
→ Future <List <String > >
Finds all generated file paths in rootDirPath
that for the given lang
.
findSourceFilePaths (String rootDirPath , {required Lang lang , Set <String > pathPatterns = const {} , FutureOr <bool > onFileFound (String filePath )? })
→ Future <List <String > >
Finds all source file paths in rootDirPath
that for the given lang
.
fixDartFile (String filePath )
→ Future <void >
Fixes the Dart file at filePath
via dart fix --apply
command.
fmtDartFile (String filePath )
→ Future <void >
Formats the Dart file at filePath
via the dart format
command
getBaseName (String path )
→ String
Returns the base name of a given file path
.
getDesktopPath ()
→ String
Gets the current Operating System's Desktop path.
getDirPath (String path )
→ String
Returns the directory path of a given file path
.
getFileNameWithoutExtension (String filePath )
→ String
Converts the given filePath
to a consistent, local path format.
getPackageLibPath (String package )
→ Future <String ? >
Returns the path of the lib
directory of package
or null
if the
package is not found.
isMatchingFileName (String filePath , String begType , String endType )
→ ({String fileName , bool status } )
Checks if the file name extracted from filePath
matches the specified
beginning type begType
and ending type endType
.
isPrivateFileName (String filePath )
→ bool
Checks if the provided filePath
is a private file (starts with an
underscore).
listFilePaths (String dirPath , {bool recursive = true })
→ Future <List <String > ? >
Lists the file paths of the files in the directory located at dirPath
.
Set recursive
to true
to list the file paths of the files in
the sub-directories as well.
loadFileFromGitHub ({required String username , required String repo , String branch = 'main' , required String filePath })
→ Future <String >
loadFileFromPathOrUrl (String pathOrUrl )
→ Future <String >
matchesAnyExtension (String filePath , Set <String > extensions , {bool caseSensitive = true })
→ bool
Checks if the provided filePath
matches any of the specified extensions
.
matchesAnyPathPattern (String path , Set <String > pathPatterns )
→ bool
Checks if the provided path
matches any of the specified pathPatterns
.
newTypeMappers <E extends MapperEvent > (TEventMap <E > input )
→ TTypeMappers <E >
parseArgs (Iterable <String > args )
→ Map <String , List <String > >
pathContainsComponent (String path , Set <String > components )
→ bool
Checks if the provided path
contains any of the specified components
.
This operation is case-insensitive.
previewPath (String path )
→ String
Takes the last 3 segments of the path
.
printArgParserUsage (ArgParser parser , {required String title , required String description })
→ void
Prints the usage information for the given parser
.
Processes comment annotations in the file at filePath
, invoking the
appropriate callbacks from onAnnotCallbacks
for each annotation found.
readFile (String filePath )
→ Future <String ? >
Reads the contents of the file located at filePath
as a String.
readFileAsLines (String filePath )
→ Future <List <String > ? >
Reads the contents of the file located at filePath
as a list of lines.
runCommandLineApp <T extends ValidArgsChecker > ({required String title , required String description , required List <String > args , required ArgParser parser , required T onResults (ArgParser parser , ArgResults results ), required Future <void > action (ArgParser parser , ArgResults results , T checker ) })
→ Future <void >
A helper for creating and running a basic command-line application.
splitArg (dynamic input , [Pattern separator = '&' ])
→ Iterable <String > ?
Splits the given input
string by the given separator
and trims each part.
toLocalSystemPathFormat (String path )
→ String
Replaces all forward slashes in path
with the local path separator.
toUnixSystemPathFormat (String path )
→ String
Replaces all backslashes in path
with forward slashes.
toWindowsSystemPathFormat (String path )
→ String
Replaces all forward slashes in path
with backslashes.
writeFile (String filePath , String content , {bool append = false })
→ Future <void >
Writes the given content
to the file located at filePath
. Set append
to true
to append the content
to the file instead of overwriting it.