Logo

dev-resources.site

for different kinds of informations.

Type inference in Dart programming (Bangla)

Published at
12/31/2024
Categories
dart
flutter
programming
oop
Author
amirul897
Categories
4 categories in total
dart
open
flutter
open
programming
open
oop
open
Author
9 person written this
amirul897
open
Type inference in Dart programming (Bangla)

Dart-āĻ Type Inference āĻšāĻ˛ā§‹ āĻāĻ•āĻŸāĻŋ āĻĒā§āĻ°āĻ•ā§āĻ°āĻŋāĻ¯āĻŧāĻž āĻ¯ā§‡āĻ–āĻžāĻ¨ā§‡ āĻ•āĻŽā§āĻĒāĻžāĻ‡āĻ˛āĻžāĻ° āĻ¸ā§āĻŦāĻ¯āĻŧāĻ‚āĻ•ā§āĻ°āĻŋāĻ¯āĻŧāĻ­āĻžāĻŦā§‡ āĻ­ā§‡āĻ°āĻŋāĻ¯āĻŧā§‡āĻŦāĻ˛ā§‡āĻ° āĻŸāĻžāĻ‡āĻĒ āĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŖ āĻ•āĻ°ā§‡, āĻ¯āĻ–āĻ¨ āĻ†āĻĒāĻ¨āĻŋ āĻŸāĻžāĻ‡āĻĒ āĻ¸ā§āĻĒāĻˇā§āĻŸāĻ­āĻžāĻŦā§‡ āĻ‰āĻ˛ā§āĻ˛ā§‡āĻ– āĻ•āĻ°ā§‡āĻ¨ āĻ¨āĻžāĨ¤

āĻ…āĻ°ā§āĻĨāĻžā§Ž, āĻ†āĻĒāĻ¨āĻŋ āĻ¯āĻĻāĻŋ āĻāĻ•āĻŸāĻŋ āĻ­ā§‡āĻ°āĻŋāĻ¯āĻŧā§‡āĻŦāĻ˛ āĻĄāĻŋāĻ•ā§āĻ˛ā§‡āĻ¯āĻŧāĻžāĻ° āĻ•āĻ°ā§‡āĻ¨ āĻāĻŦāĻ‚ āĻ¤āĻžāĻ° āĻ¸āĻžāĻĨā§‡ āĻĄāĻžāĻŸāĻž āĻ…ā§āĻ¯āĻžāĻ¸āĻžāĻ‡āĻ¨ āĻ•āĻ°ā§‡āĻ¨, āĻ¤āĻžāĻšāĻ˛ā§‡ Dart āĻ¨āĻŋāĻœā§‡āĻ‡ āĻ āĻĄāĻžāĻŸāĻžāĻ° āĻ‰āĻĒāĻ° āĻ­āĻŋāĻ¤ā§āĻ¤āĻŋ āĻ•āĻ°ā§‡ āĻŸāĻžāĻ‡āĻĒ āĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŖ āĻ•āĻ°ā§‡āĨ¤

āĻ‰āĻĻāĻžāĻšāĻ°āĻŖ:

void main() {
  var name = "Amirul"; // āĻāĻ–āĻžāĻ¨ā§‡ `name` āĻāĻ° āĻŸāĻžāĻ‡āĻĒ `String` āĻšāĻŋāĻ¸ā§‡āĻŦā§‡ āĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŖ āĻšāĻŦā§‡
  var age = 25;        // āĻāĻ–āĻžāĻ¨ā§‡ `age` āĻāĻ° āĻŸāĻžāĻ‡āĻĒ `int` āĻšāĻŋāĻ¸ā§‡āĻŦā§‡ āĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŖ āĻšāĻŦā§‡
  var pi = 3.14;       // āĻāĻ–āĻžāĻ¨ā§‡ `pi` āĻāĻ° āĻŸāĻžāĻ‡āĻĒ `double` āĻšāĻŋāĻ¸ā§‡āĻŦā§‡ āĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŖ āĻšāĻŦā§‡

  print(name.runtimeType); // Output: String
  print(age.runtimeType);  // Output: int
  print(pi.runtimeType);   // Output: double
}
Enter fullscreen mode Exit fullscreen mode

āĻ•ā§€āĻ­āĻžāĻŦā§‡ āĻ•āĻžāĻœ āĻ•āĻ°ā§‡:

  1. var āĻŦā§āĻ¯āĻŦāĻšāĻžāĻ°: āĻ¯āĻ–āĻ¨ āĻ†āĻĒāĻ¨āĻŋ var āĻĻāĻŋāĻ¯āĻŧā§‡ āĻāĻ•āĻŸāĻŋ āĻ­ā§‡āĻ°āĻŋāĻ¯āĻŧā§‡āĻŦāĻ˛ āĻĄāĻŋāĻ•ā§āĻ˛ā§‡āĻ¯āĻŧāĻžāĻ° āĻ•āĻ°ā§‡āĻ¨, āĻ¤āĻ–āĻ¨ āĻ•āĻŽā§āĻĒāĻžāĻ‡āĻ˛āĻžāĻ° āĻ¸ā§‡āĻ‡ āĻ­ā§‡āĻ°āĻŋāĻ¯āĻŧā§‡āĻŦāĻ˛ā§‡āĻ° āĻœāĻ¨ā§āĻ¯ āĻ…ā§āĻ¯āĻžāĻ¸āĻžāĻ‡āĻ¨ āĻ•āĻ°āĻž āĻĄāĻžāĻŸāĻžāĻ° āĻŸāĻžāĻ‡āĻĒ āĻŦāĻŋāĻļā§āĻ˛ā§‡āĻˇāĻŖ āĻ•āĻ°ā§‡āĨ¤
   var x = 10; // āĻāĻ–āĻžāĻ¨ā§‡ `x` āĻāĻ•āĻŸāĻŋ `int` āĻŸāĻžāĻ‡āĻĒ āĻ­ā§‡āĻ°āĻŋāĻ¯āĻŧā§‡āĻŦāĻ˛
Enter fullscreen mode Exit fullscreen mode
  1. final āĻāĻŦāĻ‚ const āĻŦā§āĻ¯āĻŦāĻšāĻžāĻ°: final āĻāĻŦāĻ‚ const-āĻāĻ° āĻ•ā§āĻˇā§‡āĻ¤ā§āĻ°ā§‡āĻ“ āĻŸāĻžāĻ‡āĻĒ āĻ‡āĻ¨āĻĢāĻžāĻ°ā§‡āĻ¨ā§āĻ¸ āĻ•āĻžāĻœ āĻ•āĻ°ā§‡āĨ¤
   final city = "Dhaka"; // āĻŸāĻžāĻ‡āĻĒ `String` āĻšāĻŋāĻ¸ā§‡āĻŦā§‡ āĻ‡āĻ¨āĻĢāĻžāĻ° āĻ•āĻ°āĻž āĻšāĻŦā§‡
   const pi = 3.1416;    // āĻŸāĻžāĻ‡āĻĒ `double` āĻšāĻŋāĻ¸ā§‡āĻŦā§‡ āĻ‡āĻ¨āĻĢāĻžāĻ° āĻ•āĻ°āĻž āĻšāĻŦā§‡
Enter fullscreen mode Exit fullscreen mode
  1. āĻĢāĻžāĻ‚āĻļāĻ¨ā§‡āĻ° āĻ°āĻŋāĻŸāĻžāĻ°ā§āĻ¨ āĻŸāĻžāĻ‡āĻĒ: āĻ¯āĻĻāĻŋ āĻ•ā§‹āĻ¨ā§‹ āĻĢāĻžāĻ‚āĻļāĻ¨ā§‡āĻ° āĻ°āĻŋāĻŸāĻžāĻ°ā§āĻ¨ āĻŸāĻžāĻ‡āĻĒ āĻ¸ā§āĻĒāĻˇā§āĻŸāĻ­āĻžāĻŦā§‡ āĻ‰āĻ˛ā§āĻ˛ā§‡āĻ– āĻ•āĻ°āĻž āĻ¨āĻž āĻšāĻ¯āĻŧ, āĻ¤āĻŦā§‡ Dart āĻ‡āĻ¨āĻĢāĻžāĻ°ā§‡āĻ¨ā§āĻ¸ āĻŦā§āĻ¯āĻŦāĻšāĻžāĻ° āĻ•āĻ°ā§‡ āĻŸāĻžāĻ‡āĻĒ āĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŖ āĻ•āĻ°ā§‡āĨ¤
   addNumbers(a, b) {
     return a + b; // āĻŸāĻžāĻ‡āĻĒ āĻ‡āĻ¨āĻĢāĻžāĻ°ā§‡āĻ¨ā§āĻ¸ā§‡āĻ° āĻ­āĻŋāĻ¤ā§āĻ¤āĻŋāĻ¤ā§‡ āĻāĻŸāĻŋ `int` āĻŦāĻž `double` āĻšāĻ¤ā§‡ āĻĒāĻžāĻ°ā§‡
   }
Enter fullscreen mode Exit fullscreen mode

āĻ¸ā§āĻŦāĻŋāĻ§āĻž:

  • āĻ•ā§‹āĻĄ āĻ¸āĻ‚āĻ•ā§āĻˇāĻŋāĻĒā§āĻ¤ āĻ“ āĻĒāĻ°āĻŋāĻˇā§āĻ•āĻžāĻ° āĻšāĻ¯āĻŧāĨ¤
  • āĻŸāĻžāĻ‡āĻĒ āĻŽā§āĻ¯āĻžāĻ¨ā§‡āĻœāĻŽā§‡āĻ¨ā§āĻŸ āĻ¸āĻšāĻœ āĻšāĻ¯āĻŧāĨ¤
  • āĻŸāĻžāĻ‡āĻĒ āĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŖā§‡ āĻ•āĻŽ āĻ¸āĻŽāĻ¯āĻŧ āĻ˛āĻžāĻ—ā§‡āĨ¤

āĻ¸āĻ¤āĻ°ā§āĻ•āĻ¤āĻž:

  • āĻ¯āĻĻāĻŋ āĻĄāĻžāĻŸāĻž āĻŸāĻžāĻ‡āĻĒ āĻ¸ā§āĻĒāĻˇā§āĻŸ āĻ¨āĻž āĻšāĻ¯āĻŧ āĻŦāĻž āĻ•āĻ¨āĻĢā§āĻ˛āĻŋāĻ•ā§āĻŸ āĻšāĻ¯āĻŧ, āĻ¤āĻžāĻšāĻ˛ā§‡ āĻāĻŸāĻŋ āĻ¸āĻŽāĻ¸ā§āĻ¯āĻžāĻ° āĻ•āĻžāĻ°āĻŖ āĻšāĻ¤ā§‡ āĻĒāĻžāĻ°ā§‡āĨ¤
  var value; // āĻŸāĻžāĻ‡āĻĒ āĻāĻ–āĻ¨āĻ“ āĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŖ āĻ•āĻ°āĻž āĻšāĻ¯āĻŧāĻ¨āĻŋ
  value = "Flutter"; // āĻāĻ–āĻžāĻ¨ā§‡ `String` āĻŸāĻžāĻ‡āĻĒ āĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŖ āĻšāĻŦā§‡
  value = 123;       // āĻāĻ° āĻĢāĻ˛ā§‡ āĻŸāĻžāĻ‡āĻĒ āĻ•āĻ¨āĻĢā§āĻ˛āĻŋāĻ•ā§āĻŸ āĻšāĻ¤ā§‡ āĻĒāĻžāĻ°ā§‡
Enter fullscreen mode Exit fullscreen mode

āĻĒāĻ°āĻžāĻŽāĻ°ā§āĻļ:

  • āĻ¯ā§‡āĻ–āĻžāĻ¨ā§‡ āĻ¸āĻŽā§āĻ­āĻŦ, āĻŸāĻžāĻ‡āĻĒ āĻ¸ā§āĻĒāĻˇā§āĻŸāĻ­āĻžāĻŦā§‡ āĻ‰āĻ˛ā§āĻ˛ā§‡āĻ– āĻ•āĻ°ā§āĻ¨, āĻŦāĻŋāĻļā§‡āĻˇāĻ¤ āĻŦāĻĄāĻŧ āĻĒā§āĻ°āĻœā§‡āĻ•ā§āĻŸā§‡āĨ¤
  • dynamic āĻŸāĻžāĻ‡āĻĒ āĻāĻĄāĻŧāĻŋāĻ¯āĻŧā§‡ āĻšāĻ˛ā§āĻ¨, āĻ•āĻžāĻ°āĻŖ āĻāĻŸāĻŋ āĻŸāĻžāĻ‡āĻĒ āĻ¸ā§‡āĻĢāĻŸāĻŋ āĻ•āĻŽāĻŋāĻ¯āĻŧā§‡ āĻĻāĻŋāĻ¤ā§‡ āĻĒāĻžāĻ°ā§‡āĨ¤
dart Article's
30 articles in total
Favicon
Flutter vs React Native in 2025: A Comprehensive Comparison
Favicon
Deploying Flutter Web Apps using Globe.dev
Favicon
Journey to Clean Architecture: Wrestling with a 10k Line Flutter Legacy Codebase
Favicon
5 Essential Flutter Widgets Every Developer Should Master
Favicon
Mastering Nested Navigation in Flutter with `go_router` and a Bottom Nav Bar
Favicon
Flutter for Beginners: From Installation to Your First App
Favicon
Building a Beautiful Login Screen in Flutter: A Complete Guide
Favicon
Flutter Design Pattern Bussines Logic Component (BLOC)
Favicon
Create Different Type of Flavor on Flutter Application
Favicon
Handling PathAccessException in iOS for File Download
Favicon
Common mistakes in Flutter article series
Favicon
Design Pattern in Flutter MVVM
Favicon
7 Ways to Refactor Your Flutter Application
Favicon
WebRTC vs Agora Video SDK vs ZegoCloud for Video Calling in Flutter: A Comprehensive Comparison
Favicon
From Chaos to Control: The Day I Learned the Magic of Debouncing in Flutter 🚀
Favicon
Syntax of comments in dart
Favicon
My first Dart program
Favicon
Integrate the Gemini REST API in Flutter: Unlock Powerful Generative Language Models for Your Next App
Favicon
Dart Operators Explained in Bangla
Favicon
Control Flow Statements (switch and case) in Dart (Bangla)
Favicon
break, continue in Dart programming (Bangla)
Favicon
Control Flow Statements ( for, while, do-while ) in dart (Bangla)
Favicon
Control Flow Statements ( if, else, else if) in dart (Bangla)
Favicon
Type inference in Dart programming (Bangla)
Favicon
var, final, const in dart programming
Favicon
We are in Top 5 Flutter Of The Year Apps List
Favicon
Class in dart
Favicon
Function in dart
Favicon
Map in Dart
Favicon
List in Dart

Featured ones: