Literals And String Interpolation Using Flutter Android App

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.

Literals And String Interpolation Using Flutter Android App

Literals and String Interpolation

1. String Interpolation in Flutter Dart :-
  Basically we would use + Plus symbol to connect two or multiple string in most of programming languages but in Dart using + Plus symbol is sees as a bad programmer habit. So here comes the String interpolation in dart which stops us to use + symbol to connect two string and open many ways to used string. See the below example to understand properly.

void main() {
  String name = 'BajarangiSoft.com';
// Without String Interpolation.
  String message = 'Welcome to our Website ' + name ;
//Printing message on terminal.
  print(message);
}

Complete Code For Literals and String Interpolation In Flutter
main.dart
import 'package:flutter/material.dart';

void main() {
  String name = 'BajarangiSoft.com';
// Without String Interpolation.
  String message = 'Welcome to our Website ' + name ;
//Printing message on terminal.
  print(message);

}

 

Related Post