SnippetSample class

A class to represent a snippet of sample code, marked by "{@tool snippet}...{@end-tool}".

Snippets are code that is not meant to be run as a complete application, but rather as a code usage example.

Inheritance

Constructors

SnippetSample(List<SourceLine> input, {required int index, required SourceLine lineProto})
SnippetSample.combine(List<SnippetSample> sections, {required int index, required SourceLine lineProto})
factory
SnippetSample.fromStrings(SourceLine firstLine, List<String> code, {required int index})
factory
SnippetSample.surround(String prefix, List<SourceLine> code, String postfix, {required int index})
factory

Properties

args List<String>
finalinherited
assumptions List<SourceLine>
getter/setter pair
description String
getter/setter pairinherited
element String
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
index int
The index of this sample within the dartdoc comment it came from.
finalinherited
input List<SourceLine>
finalinherited
inputAsString String
no setterinherited
inputStrings Iterable<String>
no setterinherited
metadata Map<String, Object?>
getter/setter pairinherited
output String
getter/setter pairinherited
parts List<TemplateInjection>
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sourceFile → File?
finalinherited
sourceFileContents String
no setterinherited
start SourceLine
no setteroverride
template String
no setteroverride
type String
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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