How To Use String Interpolation On Other Data Type Variables

admin_img Posted By Bajarangi soft , Posted On 03-11-2020

we would learn about some basic but important coding techniques. Flutter is based on Dart language and like any other language it has its own code writing structure. In today’s tutorial we would learn about What are Literals and String Interpolation in Flutter Dart Explained with Example Tutorial.

How To Use String Interpolation On Other Data Type Variables

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 }');

}

Complete Code For Other Data Type Variables  In Flutter
main.dart
import 'package:flutter/material.dart';
void main() {
  double length = 100;
  double  width = 40;
  print('Area of Rectangle is ${ length * width }');

}

Related Post