String Interpolation On Other Data Type Variables:
After learning about string interpolation on String we would learn about applying string interpolation on various data type variables. See the below example. Now in below example we are multiplying width and length to calculate area of rectangle so whatever written in curly brackets are treated as expression using string interpolation.
void main() { double length = 100; double width = 40; print('Area of Rectangle is ${ length * width }'); }
import 'package:flutter/material.dart'; void main() { double length = 100; double width = 40; print('Area of Rectangle is ${ length * width }'); }