AFGeneratedFile class

A file that is in the process of being generated or modified.

Constructors

AFGeneratedFile({required List<String> projectPath, required AFCodeBuffer buffer, required AFGeneratedFileAction action})
AFGeneratedFile.fromBuffer({required List<String> projectPath, required AFCodeBuffer buffer, required AFGeneratedFileAction action})
factory
AFGeneratedFile.fromPath({required List<String> projectPath})
factory
AFGeneratedFile.fromTemplate({required AFCommandContext context, required List<String> projectPath, required AFSourceTemplate template, required AFGeneratedFileAction action})
factory

Properties

action AFGeneratedFileAction
final
buffer AFCodeBuffer
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
importPathStatement String
no setter
projectPath List<String>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addLinesAfter(AFCommandContext context, RegExp match, List<String> lines, {bool preventDuplicates = true}) → void
addLinesAfterIdx(AFCommandContext context, int idx, List<String> lines, {bool preventDuplicates = true}) → void
addLinesAtEnd(AFCommandContext context, List<String> lines, {bool preventDuplicates = true}) → void
addLinesBefore(AFCommandContext context, RegExp match, List<String> lines, {bool preventDuplicates = true}) → void
findFirstAFTag() String?
findFirstLineContaining(AFCommandContext context, RegExp match, {int startAt = 0}) int
importAll(AFCommandContext context, List<String> imports, {bool preventDuplicates = true}) → void
importFile(AFCommandContext context, AFGeneratedFile file, {String? packageName}) → void
importFlutterFile(AFCommandContext context, AFLibraryID libraryId) → void
importIDFile(AFCommandContext context, AFLibraryID libraryId) → void
importProjectPath(AFCommandContext context, List<String> importPath, {String? packageName}) → void
importProjectPathString(AFCommandContext context, String importPath, {String? packageName}) → void
isDuplicateDeclaration(AFCommandContext context, List<String> lines) bool
loadPubspec() → Pubspec
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
performInsertions(AFCommandContext context, AFSourceTemplateInsertions insertions) → void
replaceLine(AFCommandContext context, int idx, String value) → void
replaceTemplate(AFCommandContext context, dynamic id, AFSourceTemplate? template) → void
Replaces all instances of the specified id with the value returned by the template.
replaceText(AFCommandContext context, dynamic id, String value) → void
Replaces all instances of the specified id with the specified value.
replaceTextLines(AFCommandContext context, dynamic id, List<String> lines) → void
replaceTextTemplate(AFCommandContext context, dynamic id, AFSourceTemplate? template) → void
resolveTemplateReferences({required AFCommandContext context}) → void
Resolves references to other registered templates.
toString() String
A string representation of this object.
inherited
write(AFCommandContext context) bool
writeIfModified(AFCommandContext context) bool

Operators

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