Template class
A Template tree.
Constructors
-
Template([Iterable<
TemplateEntry> ? entries]) - Template.from(dynamic o)
-
Constructs from a dynamic object
o
.factory - Template.fromJson(Iterable json)
-
Constructs from a
json
.factory - Template.fromJsonEncoded(String json)
-
Constructs from an encoded
json
.factory
Properties
-
entries
→ Set<
TemplateEntry> -
A Set of
TemplateEntry
of this instance.no setter -
entriesPaths
→ Set<
String> -
A Set of TemplateEntry paths.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- isEmpty → bool
-
Returns
true
if entries are empty.no setter - isNotEmpty → bool
-
Returns
true
if entries are NOT empty.no setter - length → int
-
Returns the amount of entries.
no setter
- mainEntryPath → String?
-
The main entry path/directory.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addEntry<
D> (TemplateEntry< D> entry) → void - Adds an TemplateEntry to this template.
-
checkDefinedVariables(
Map< String, dynamic> variables, {Map<String, dynamic> ? manifest}) → void -
Throws a StateError if not all used variables are defined by
variables
. Calls getNotDefinedVariables to determined not defined variables. -
getEntryByDirectoryAndName(
dynamic directory, String name, {bool alreadyNormalizedDirectory = false}) → TemplateEntry? -
Gets a TemplateEntry by
directory
andname
. -
getEntryByPath(
String path) → TemplateEntry? -
Gets a TemplateEntry by
path
. -
getManifest(
) → Map< String, dynamic> ? - Returns the template manifest. See isManifestFileName.
-
getNotDefinedVariables(
Map< String, dynamic> variables, {Map<String, dynamic> ? manifest}) → List<String> -
Returns a List of variables used in the template and not defined at
variables
. Calls parseTemplateVariables to determined used variables. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseTemplateVariables(
[Set< String> ? variables]) → Set<String> - Parses the template variables and returns them.
-
resolve(
Map< String, dynamic> variables) → Template - Resolves template variables to a new Template instance (without variables placeholders).
-
resolveToJsonMap(
Map< String, dynamic> variables, {Map<String, dynamic> ? manifest}) → List<Map< String, String> > -
Resolves template variables to a
JSON
Map
-
saveTo(
Storage storage, [String? destinySubPath]) → Future< List< String> > -
Saves to template to
storage
; -
toJsonEncoded(
{bool pretty = false}) → String - Converts to an encode JSON String.
-
toJsonMap(
) → List< Map< String, dynamic> > -
Converts to a JSON List of TemplateEntry (as JSON
Map
). -
toString(
) → String -
A string representation of this object.
override
-
toYAMLEncoded(
) → String - Converts to an encode YAML String.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
fromFiles(
Iterable< FileStorage> files) → Future<Template> -
isManifestFileName(
String fileName) → bool -
Returns
true
iffileName
is aproject_template
manifest.