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
Properties
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.