import 'dart:io'; void main() { Triangle t1= Triangle(3, 4); print("Triangle Area is ${t1.area()}"); Rectangle r1= Rectangle(8, 6); print("Rectangle Area is ${r1.area()}"); } class Shape{ int width; int height; Shape(int this.width, int this.height); } class Triangle extends Shape{ Triangle(int width, int height):super(width, height); double area() => (width*height)/2; } class Rectangle extends Shape{ Rectangle(int width, int height):super(width, height); int area()=> width*height; }