StringBuffer class Null safety

A class for concatenating strings efficiently.

Allows for the incremental building of a string using write*() methods. The strings are concatenated to a single string only when toString is called.

Implemented types

Constructors

StringBuffer([Object content = ""])
Creates the string buffer with an initial content.

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
isEmpty bool
Returns whether the buffer is empty. This is a constant-time operation.
read-only
isNotEmpty bool
Returns whether the buffer is not empty. This is a constant-time operation.
read-only
length int
Returns the length of the content that has been accumulated so far. This is a constant-time operation.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

clear() → void
Clears the string buffer.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns the contents of buffer as a single string.
override
write(Object? object) → void
Adds the string representatoon of object to the buffer.
override
writeAll(Iterable objects, [String separator = ""]) → void
Writes all objects separated by separator. [...]
override
writeCharCode(int charCode) → void
Adds the string representation of charCode to the buffer. [...]
override
writeln([Object? obj = ""]) → void
Writes object followed by a newline, "\n". [...]
override

Operators

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