Interfaces are named collections of method signatures.
To run the program:
In Dart, we use abstract classes to define interfaces. The Geometry abstract class serves as our interface, defining the method signatures for area() and perim().
We then implement this interface in the Rectangle and Circle classes. In Dart, we use the implements keyword to indicate that a class is implementing an interface.
The measure function demonstrates polymorphism - it can work with any object that implements the Geometry interface.
In the main function, we create instances of Rectangle and Circle, and pass them to the measure function, which can handle both types because they implement the Geometry interface.
This example showcases how interfaces in Dart allow for abstraction and polymorphism, enabling more flexible and reusable code.