void main() {
double a = 5;
double b = 10;
print("area: ${RectangleHelper.area(a, b)}");
print("perimeter: ${RectangleHelper.perimeter(a, b)}");
}
class RectangleHelper {
static double area(double a, double b) {
return a * b;
}
static double perimeter(double a, double b) {
return (a + b) * 2;
}
}
Output
area: 50.0
perimeter: 30.0