I can write switch statement in iOS/Swift
like this,
enum Test {
case none
case first(Int)
case second(String)
case third(Bool)
var value:String {
switch self {
case .none:
return "None"
case .first(let int):
return "First case with Integer value - \(int)"
case .second(let string):
return "Second case with String value - \(string)"
case .third(let bool):
return "Third case with Boolean value - \(bool)"
}
}
}
class Testing {
func execute() {
print(Test.none.value)
print(Test.first(10).value)
print(Test.second("Vatsal").value)
print(Test.third(true).value)
}
}
But how to write an advanced switch statement in flutter?
Kindly, share your knowledge.