TemplateEntry<D> class

a Template entry.

Inheritance

Constructors

TemplateEntry(String directory, String name, String type, D content)
TemplateEntry.from(dynamic o)
Constructs from a dynamic object o.
factory
TemplateEntry.fromJson(Map<String, dynamic> json)
Constructs from a json.
factory
TemplateEntry.fromJsonEncoded(String json)
Constructs from an encodedjson.
factory

Properties

content → D
The content of this entry.
final
contentAsBytes Uint8List
The content as Uint8List.
no setter
contentAsString String
The content as String.
no setter
directory String
The directory path of this entry.
final
hashCode int
The hash code for this object.
no setteroverride
isAudioType bool
no setterinherited
isBinaryType bool
no setterinherited
isFontType bool
no setterinherited
isImageType bool
no setterinherited
isJavaScriptType bool
no setterinherited
isJsonType bool
no setterinherited
isManifest bool
Returns true if this entry file name is a manifest. Calls Template.isManifestFileName.
no setter
isRootEntry bool
Returns true if this entry is at root directory (empty directory path).
no setter
isTextType bool
no setterinherited
isVideoType bool
no setterinherited
name String
The name of this entry.
final
nameExtension String
The file name extension.
no setter
path String
Returns the path of this entry: directory + '/' + name.
no setter
pathParts List<String>
Returns path parts.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
The type of this File (lower-case and trimmed).
finalinherited

Methods

isEqualsDirectoryAndName(dynamic directory, String name, {bool alreadyNormalizedDirectory = false}) bool
Returns true if directory and name matches this instance.
isEqualsPath(String path) bool
Returns true if path matches this instances directory and name.
isEqualsPathParts(List<String> pathParts) bool
Returns true if pathParts matches this instances directory and name.
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) TemplateEntry<D>
Resolves entry variables to a new TemplateEntry instance (without variables placeholders).
resolveToJsonMap(Map<String, dynamic> variables, {Map<String, dynamic>? manifest}) Map<String, String>
Resolves entry variables to a JSON Map
toJson() Map<String, String>
Converts to a JSON Map.
toJsonEncoded({bool pretty = false}) String
Converts to an encode JSON String.
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

contentBase64(String directory, String name, String type, String base64) TemplateEntry<Uint8List>
Constructs with content as an encoded Base64.
contentBytes(String directory, String name, String type, Uint8List bytes) TemplateEntry<Uint8List>
Constructs with content as bytes.
fromFile(FileStorage file) Future<TemplateEntry>
isRootDirectory(String directory) bool
Returns true if directory is a root entry directory.
normalizePathParts(List<String> pathParts) List<String>
Normalizes a path split in parts.
parseNameExtension(String name) String
Parse a file name extension.
parsePathParts(String path) List<String>
Parts a path in parts and normalizes it.