Home:ALL Converter>Refactoring conditionals with polymorphism in dart

Refactoring conditionals with polymorphism in dart

Ask Time:2021-12-09T07:08:33         Author:davidn

Json Formatter

I recently came across the title of this question while studying Dart Apprentice but I couldn't find anything related to the dart language. I understand how conditionals work and while I have a fair knowledge of OOP, I understand how polymorphism works. But I can't see the relationship between conditionals and polymorphism or how one can replace conditionals with polymorphism. Can anyone help clarify?

Author:davidn,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/70282815/refactoring-conditionals-with-polymorphism-in-dart
yy