Boolean class

A wrapper class for bool that provides Java-like functionality and methods.

This class wraps Dart's primitive bool type and provides additional utility methods similar to Java's Boolean class.

Example usage:

Boolean a = Boolean(true);
Boolean b = Boolean.valueOf(false);
Boolean c = Boolean.parseBoolean("true");

print(a.toString()); // "true"
print(a.compareTo(b)); // 1 (true > false)
Implemented types

Constructors

Boolean(bool _value)
Creates a Boolean with the specified value.
const

Properties

hashCode int
Returns the hash code for this Boolean.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value bool
Returns the wrapped boolean value.
no setter

Methods

and(Boolean other) Boolean
Performs a logical AND operation.
compareTo(Boolean other) int
Compares this Boolean with another Boolean.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
not() Boolean
Returns the logical negation of this Boolean.
or(Boolean other) Boolean
Performs a logical OR operation.
toString() String
Returns a string representation of this Boolean.
override
xor(Boolean other) Boolean
Performs a logical XOR operation.

Operators

operator &(Boolean other) Boolean
Logical operators
operator ==(Object other) bool
Returns true if this Boolean equals the specified object.
override
operator ^(Boolean other) Boolean
operator |(Boolean other) Boolean
operator ~() Boolean

Static Methods

parseBoolean(String str) Boolean
Parses a string to a Boolean.
valueOf(bool value) Boolean
Returns a Boolean instance representing the specified bool value.
valueOfString(String str) Boolean
Returns a Boolean instance from a string.

Constants

FALSE → const Boolean
Boolean constant representing false
TRUE → const Boolean
Boolean constant representing true