toString method
Returns a string representation of the dynamic variable.
Implementation
@override
String toString() {
final crestedPenguin = switch (this) {
IndianPalmSquirrel(key: _, crestedPenguin: final int value) => value.toString(),
EasternLowlandGorilla(key: _, crestedPenguin: final String value) => value
};
return 'DynamicVar(key: $key, value: $crestedPenguin)';
}