AFCodeGenerator class
Primary API for code generation, accessible via AFCommandContext.generator
Constructors
- AFCodeGenerator({required AFCommandAppExtensionContext definitions})
Properties
- appNamespace → String
-
The project code.
no setter
- appNamespaceUpper → String
-
The project code, uppercased
no setter
-
created
→ Map<
String, AFGeneratedFile> -
final
- definitions → AFCommandAppExtensionContext
-
final
-
ensuredFolders
→ List<
List< String> > -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
modified
→ Map<
String, AFGeneratedFile> -
final
- nameDefaultParentTheme → String
-
no setter
- nameDefaultParentThemeID → String
-
no setter
- nameDefaultStateView → String
-
no setter
- nameDefaultTheme → String
-
no setter
- nameRootState → String
-
no setter
- nameStartupQuery → String
-
no setter
-
pathAfibConfig
→ List<
String> -
The project path of the xxx_config.g.dart file.
no setter
-
pathApp
→ List<
String> -
no setter
-
pathAppCommand
→ List<
String> -
no setter
-
pathAppId
→ List<
String> -
no setter
-
pathAppState
→ List<
String> -
no setter
-
pathCommandExportsFile
→ List<
String> -
no setter
-
pathConnectedBaseFile
→ List<
String> -
Returns the path of the xxx_connected_base file, which contains
superclasses and utilities associated
no setter
-
pathCreateDartParams
→ List<
String> -
no setter
-
pathDefaultTheme
→ List<
String> -
no setter
-
pathDefineCore
→ List<
String> -
The path of the xxx_define_core.dart file.
no setter
-
pathExtendApplication
→ List<
String> -
no setter
-
pathExtendCommand
→ List<
String> -
no setter
-
pathFlutterExportsFile
→ List<
String> -
no setter
-
pathFundamentalTheme
→ List<
String> -
no setter
-
pathIdFile
→ List<
String> -
The project path of the xxx_id.dart file.
no setter
-
pathInstall
→ List<
String> -
no setter
-
pathInstallBase
→ List<
String> -
no setter
-
pathInstallCommand
→ List<
String> -
no setter
-
pathInstallCoreApp
→ List<
String> -
no setter
-
pathInstallLibraryBase
→ List<
String> -
no setter
-
pathInstallLibraryCommand
→ List<
String> -
no setter
-
pathInstallLibraryCore
→ List<
String> -
no setter
-
pathInstallTest
→ List<
String> -
no setter
-
pathMain
→ List<
String> -
no setter
-
pathMainAFibTest
→ List<
String> -
no setter
-
pathOriginalWidgetTest
→ List<
String> -
no setter
-
pathPubspecYaml
→ List<
String> -
no setter
-
pathScreenTests
→ List<
String> -
no setter
-
pathStateModelAccess
→ List<
String> -
no setter
-
pathStateTestShortcutsFile
→ List<
String> -
path to the xxx_state_test_shortcuts.dart file.
no setter
-
pathTestData
→ List<
String> -
no setter
-
read
→ Map<
String, AFGeneratedFile> -
final
-
renamed
→ Map<
List< String> , List<String> > -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stateFullLoginID → String
-
Returns the default name of the 'full login' state used by default in new UI prototypes.
no setter
Methods
-
addExportsForFiles(
AFCommandContext context, AFCommandArgumentsParsed args, List< AFGeneratedFile> files, {List<String> ? toPath}) → void -
createFile(
AFCommandContext context, List< String> projectPath, dynamic templateOrId, {AFSourceTemplateInsertions? insertions}) → AFGeneratedFile -
declarePrototypeID(
AFCommandContext ctx, String screenName) → String -
declareUIID(
AFCommandContext ctx, String screenName, AFUIControlSettings control) → String -
declareUIIDDirect(
AFCommandContext context, String idName, AFUIControlSettings control) → String -
deriveFullLibraryIDFromType(
String parentType, String suffix, {String? typeKind}) → String -
ensureFolderExists(
List< String> path) → void - Ensures the specified folder exists, relative to the project root.
-
fileExists(
List< String> projectPath) → bool -
finalizeAndWriteFiles(
AFCommandContext context) → void - Used at the very end of a command to cleanup and write out all the files which were generated or modified.
-
findLibraryForTypeWithPrefix(
String parentType) → AFLibraryID -
importStatementPath(
List< String> projectPath) → String -
isRenamed(
List< String> projectPath) → bool -
loadFile(
AFCommandContext context, List< String> path, {bool forModify = true}) → AFGeneratedFile -
modifyFile(
AFCommandContext context, List< String> projectPath) → AFGeneratedFile -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
overwriteFile(
AFCommandContext context, List< String> projectPath, dynamic templateOrId, {Map<AFSourceTemplateInsertion, AFSourceTemplate> ? insertions}) → AFGeneratedFile - Used for generated files which always get overwritten.
-
packagePath(
String packageName) → String -
pathCommand(
String commandName) → List< String> -
pathEnvironment(
String suffix) → List< String> -
pathLPI(
String lpiName, {required bool isOverride}) → List< String> - Returns the path for an LPI class name.
-
pathModel(
String modelName) → List< String> ? - Returns a path for the specified model name, which will be under state/models, or state/roots if it ends in Root.
-
pathModelFile(
String filename) → List< String> - Takes a file name, and returns a path under state/models.
-
pathQuery(
String modelName) → List< String> - Returns the path of a query class name.
-
pathRootState(
String stateName) → List< String> -
pathScreenTest(
String screenName, AFUIControlSettings control) → List< String> - Returns the path for the specified screen test class name.
-
pathState(
String stateName) → List< String> -
pathStateView(
String stateViewName) → List< String> ? - Returns the path of a state view class name.
-
pathStateViewAccess(
) → List< String> -
pathTest(
String testName, String suffix) → List< String> - Converts pathTest("MyStateTest", "StateTest") to tests/state_tests/my_state_test.dart.
-
pathTestDefinitions(
String kind) → List< String> -
pathTests(
String suffix) → List< String> - Converts pathTests("StateTest") to tests/state_tests.dart
-
pathTheme(
String themeName, {required bool isCustomParent}) → List< String> ? - Returns the path for the theme class name.
-
pathUI(
String uiName, AFUIControlSettings control) → List< String> -
Returns a path for the specified
uiNameand type. -
pathUnknown(
String name) → List< String> ? - Given an class name, attempts to determine its correct path based on its suffix.
-
readFile(
AFCommandContext context, List< String> projectPath) → AFGeneratedFile -
readJsonFileSync(
AFCommandContext context, List< String> projectPath, Map<String, Object> defaultValue) → Map<String, Object> -
readProjectStyle(
AFCommandContext context, List< String> projectPath, dynamic templateOrId, {AFSourceTemplateInsertions? insertions}) → AFGeneratedFile -
removePrefix(
String value, String prefix) → String -
removeSuffix(
String value, String suffix) → String -
removeSuffixAndCamel(
String value, String suffix) → String -
renameExistingFileToOld(
AFCommandContext context, List< String> projectPath) → void - Renames an existing file with .old
-
toCamelCase(
String value) → String -
toString(
) → String -
A string representation of this object.
inherited
-
writeJsonFileSync(
AFCommandContext context, List< String> projectPath, Map<String, Object> json) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
convertMixedToSnake(
String convert) → String -
convertMixedToSpaces(
String convert) → String -
convertSnakeToMixed(
String convert, {bool upcaseFirst = false}) → String -
convertStripId(
String convert) → String -
convertToCamelCase(
String convert) → String -
convertUpcaseFirst(
String convert) → String -
importPathStatementStatic(
List< String> projectPath) → String -
pluralize(
String source) → String -
splitMixedCase(
String convert) → List< String> -
toCapitalFirstLetter(
String convert) → String
Constants
- afibConfigFile → const String
- afibFolder → const String
- binFolder → const String
-
binPath
→ const List<
String> - bottomSheetsFolder → const String
-
bottomSheetsPath
→ const List<
String> - commandFolder → const String
-
commandPath
→ const List<
String> - deferredFolder → const String
- dialogsFolder → const String
-
dialogsPath
→ const List<
String> - drawersFolder → const String
-
drawersPath
→ const List<
String> - environmentsFolder → const String
-
environmentsPath
→ const List<
String> - initializationFolder → const String
-
initializationPath
→ const List<
String> - installFolder → const String
-
installPath
→ const List<
String> - isolateFolder → const String
- libFolder → const String
-
libPath
→ const List<
String> - listenerFolder → const String
- lpisFolder → const String
-
lpisOverridePath
→ const List<
String> -
lpisPath
→ const List<
String> - lpiSuffix → const String
- modelsFolder → const String
-
modelsPath
→ const List<
String> - overrideFolder → const String
-
overrideThemesPath
→ const List<
String> -
prototypesPath
→ const List<
String> -
queryDeferredPath
→ const List<
String> - queryFolder → const String
-
queryIsolatePath
→ const List<
String> -
queryListenerPath
→ const List<
String> -
queryPath
→ const List<
String> -
querySimplePath
→ const List<
String> - rootFolder → const String
-
rootsPath
→ const List<
String> - rootSuffix → const String
- screensFolder → const String
-
screensPath
→ const List<
String> - simpleFolder → const String
- srcFolder → const String
- stateFolder → const String
-
statePath
→ const List<
String> - stateTestsFolder → const String
-
stateTestsPath
→ const List<
String> - stateTestSuffix → const String
- stateViewsFolder → const String
-
stateViewsPath
→ const List<
String> - stateViewSuffix → const String
-
testAFibPath
→ const List<
String> - testFolder → const String
-
testPath
→ const List<
String> -
testsPath
→ const List<
String> - themesFolder → const String
-
themesPath
→ const List<
String> - uiFolder → const String
-
uiPath
→ const List<
String> - uiPrototypesFilename → const String
- uiPrototypesFolder → const String
- unitTestsFolder → const String
-
unitTestsPath
→ const List<
String> - unitTestSuffix → const String
-
vsCodeExtenstionsPath
→ const List<
String> - vsCodeFolder → const String
-
vsCodePath
→ const List<
String> - widgetsFolder → const String
-
widgetsPath
→ const List<
String> - wireframesFolder → const String
-
wireframesPath
→ const List<
String> - wireframeSuffix → const String