Being SOLID in Dart.

1. SRP — Single Responsibility principle

A Generic User Class with all responsibility packed in a single class.
User class
Validators and UserAuth.

2. OCP — Open Closed Principle

Adding a new shape.

3. LSP — Liskov’s Substitution Principle

Rectangle squr = Square(8, 5);print(squr.calculateArea()); -- OUTPUT  = 64     [ Expected OUTPUT -- 40 ]
Applying Liskov’s substitution principle

4. ISP — Interface Segregation Principle

Forcing unnecessary methods.
Implementing ISP

5. DIP — Dependency Inversion Principle

DIP implementation



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store