toString method
A string representation of this object.
Some classes have a default textual representation,
often paired with a static parse function (like int.parse).
These classes will provide the textual representation as
their string representation.
Other classes have no meaningful textual representation
that a program will care about.
Such classes will typically override toString to provide
useful information when inspecting the object,
mainly for debugging or logging.
Implementation
@override
String toString() {
if (step == 0) {
return "Step:$step\n$details\n";
}
if (step == 1) {
return "Step:$step\n$details\nDates and Genders Guess$dateSexStr";
}
if (step == 2) {
return "Step:$step\n$details\n Birth:$birthDate Sex:$sex Exp:$expiryDate";
}
if (step == 3) {
return "Step:$step\n$details\n Birth:$birthDate Sex:$sex Exp:$expiryDate\nNationality :$nationality type:$type";
}
if (step == 4) {
return "Step:$step\n$details\n Birth:$birthDate Sex:$sex Exp:$expiryDate\nNationality :$nationality type:$type\nNumber:$docNumber\nCode: $docCode Country: $countryCode";
}
if (step == 5) {
return "Step:$step\n$details\n$dateSexStr-->$birthDate $sex $expiryDate\n${validation.toString()}\nCode: $docCode Country: $countryCode\nName: $firstName $lastName";
}
if (step == 6) {
return "Step:$step\n$details\n$dateSexStr-->$birthDate $sex $expiryDate\n${validation.toString()}\nCode: $docCode Country: $countryCode\nName: $firstName $lastName\nOptional:$optional $finalCheck";
}
return "Step:$step";
}