Logo

dev-resources.site

for different kinds of informations.

Control Flow Statements (switch and case) in Dart (Bangla)

Published at
12/31/2024
Categories
dart
flutter
programming
bangl
Author
amirul897
Categories
4 categories in total
dart
open
flutter
open
programming
open
bangl
open
Author
9 person written this
amirul897
open
Control Flow Statements (switch and case) in Dart (Bangla)

Dart-āĻ switch āĻāĻŦāĻ‚ case āĻšāĻ˛ Control Flow Statements, āĻ¯āĻž āĻŦāĻŋāĻ­āĻŋāĻ¨ā§āĻ¨ āĻļāĻ°ā§āĻ¤ā§‡āĻ° āĻ­āĻŋāĻ¤ā§āĻ¤āĻŋāĻ¤ā§‡ āĻāĻ•āĻŸāĻŋ āĻ¨āĻŋāĻ°ā§āĻĻāĻŋāĻˇā§āĻŸ āĻ•ā§‹āĻĄ āĻŦā§āĻ˛āĻ• āĻšāĻžāĻ˛āĻžāĻ¨ā§‹āĻ° āĻœāĻ¨ā§āĻ¯ āĻŦā§āĻ¯āĻŦāĻšā§ƒāĻ¤ āĻšāĻ¯āĻŧāĨ¤ āĻāĻ‡ āĻ¸ā§āĻŸā§‡āĻŸāĻŽā§‡āĻ¨ā§āĻŸāĻŸāĻŋ āĻ¤āĻ–āĻ¨ āĻŦā§āĻ¯āĻŦāĻšā§ƒāĻ¤ āĻšāĻ¯āĻŧ āĻ¯āĻ–āĻ¨ āĻ†āĻŽāĻžāĻĻā§‡āĻ° āĻāĻ•āĻžāĻ§āĻŋāĻ• āĻ¸āĻŽā§āĻ­āĻžāĻŦā§āĻ¯ āĻļāĻ°ā§āĻ¤ āĻĒāĻ°ā§€āĻ•ā§āĻˇāĻž āĻ•āĻ°āĻ¤ā§‡ āĻšāĻ¯āĻŧ āĻāĻŦāĻ‚ āĻĒā§āĻ°āĻ¤āĻŋāĻŸāĻŋ āĻļāĻ°ā§āĻ¤ā§‡āĻ° āĻœāĻ¨ā§āĻ¯ āĻ†āĻ˛āĻžāĻĻāĻž āĻ•ā§‹āĻĄ āĻšāĻžāĻ˛āĻžāĻ¤ā§‡ āĻšāĻ¯āĻŧāĨ¤

switch āĻāĻŦāĻ‚ case āĻ•ā§€āĻ­āĻžāĻŦā§‡ āĻ•āĻžāĻœ āĻ•āĻ°ā§‡?

switch āĻ¸ā§āĻŸā§‡āĻŸāĻŽā§‡āĻ¨ā§āĻŸāĻŸāĻŋ āĻāĻ•āĻžāĻ§āĻŋāĻ• āĻļāĻ°ā§āĻ¤ āĻĒāĻ°ā§€āĻ•ā§āĻˇāĻž āĻ•āĻ°āĻ¤ā§‡ āĻ¸āĻžāĻšāĻžāĻ¯ā§āĻ¯ āĻ•āĻ°ā§‡ āĻāĻŦāĻ‚ āĻĒā§āĻ°āĻ¤āĻŋāĻŸāĻŋ āĻļāĻ°ā§āĻ¤ā§‡āĻ° āĻœāĻ¨ā§āĻ¯ āĻ¨āĻŋāĻ°ā§āĻĻāĻŋāĻˇā§āĻŸ āĻ•ā§‹āĻĄ āĻŦā§āĻ˛āĻ• āĻšāĻžāĻ˛āĻžāĻ¨ā§‹āĻ° āĻœāĻ¨ā§āĻ¯ case āĻŦā§āĻ¯āĻŦāĻšāĻžāĻ° āĻ•āĻ°āĻž āĻšāĻ¯āĻŧāĨ¤ switch āĻ¸ā§āĻŸā§‡āĻŸāĻŽā§‡āĻ¨ā§āĻŸāĻŸāĻŋ if-else āĻšā§‡āĻ¨ā§‡āĻ° āĻ¤ā§āĻ˛āĻ¨āĻžāĻ¯āĻŧ āĻ…āĻ¨ā§‡āĻ• āĻĒāĻ°āĻŋāĻˇā§āĻ•āĻžāĻ° āĻāĻŦāĻ‚ āĻĒāĻĄāĻŧāĻ¤ā§‡ āĻ¸āĻšāĻœāĨ¤

switch āĻ¸ā§āĻŸā§‡āĻŸāĻŽā§‡āĻ¨ā§āĻŸā§‡āĻ° āĻ¸āĻŋāĻ¨āĻŸā§āĻ¯āĻžāĻ•ā§āĻ¸:

switch (expression) {
  case value1:
    // code to be executed if expression == value1
    break;
  case value2:
    // code to be executed if expression == value2
    break;
  default:
    // code to be executed if no case matches
}
Enter fullscreen mode Exit fullscreen mode
  • expression: āĻāĻŸāĻŋ āĻāĻŽāĻ¨ āĻāĻ•āĻŸāĻŋ āĻāĻ•ā§āĻ¸āĻĒā§āĻ°ā§‡āĻļāĻ¨ āĻ¯āĻž āĻ¯āĻžāĻšāĻžāĻ‡ āĻ•āĻ°āĻž āĻšāĻ¯āĻŧ (āĻ¯ā§‡āĻŽāĻ¨ āĻāĻ•āĻŸāĻŋ āĻ­ā§‡āĻ°āĻŋāĻ¯āĻŧā§‡āĻŦāĻ˛ āĻŦāĻž āĻŽāĻžāĻ¨)āĨ¤
  • case value: āĻāĻ• āĻāĻ•āĻŸāĻŋ case āĻšāĻ˛ā§‹ expression āĻāĻ° āĻ¸āĻŽā§āĻ­āĻžāĻŦā§āĻ¯ āĻŽāĻžāĻ¨āĨ¤
  • break: āĻ¯āĻ–āĻ¨ āĻāĻ•āĻŸāĻŋ case āĻāĻ° āĻļāĻ°ā§āĻ¤ āĻĒā§‚āĻ°ā§āĻŖ āĻšāĻ¯āĻŧ, āĻ¤āĻ–āĻ¨ break āĻŦā§āĻ¯āĻŦāĻšāĻžāĻ° āĻ•āĻ°ā§‡ āĻ†āĻŽāĻ°āĻž āĻ˛ā§āĻĒ āĻĨā§‡āĻ•ā§‡ āĻŦā§‡āĻ° āĻšāĻ¯āĻŧā§‡ āĻ¯āĻžāĻ‡āĨ¤ āĻāĻŸāĻž āĻ¸ā§āĻŸā§‡āĻŸāĻŽā§‡āĻ¨ā§āĻŸāĻŸāĻŋāĻ•ā§‡ āĻĒāĻ°āĻŦāĻ°ā§āĻ¤ā§€ case āĻŦāĻž default āĻāĻ° āĻĻāĻŋāĻ•ā§‡ āĻ¯ā§‡āĻ¤ā§‡ āĻŦāĻžāĻ§āĻž āĻĻā§‡āĻ¯āĻŧāĨ¤
  • default: āĻāĻŸāĻŋ āĻāĻ¸āĻŦ āĻ¸āĻŽāĻ¯āĻŧā§‡ āĻŦā§āĻ¯āĻŦāĻšā§ƒāĻ¤ āĻšāĻ¯āĻŧ āĻ¯āĻ–āĻ¨ āĻ•ā§‹āĻ¨ case āĻŽāĻŋāĻ˛ā§‡ āĻ¨āĻžāĨ¤ āĻāĻŸāĻŋ āĻāĻ•āĻŸāĻŋ āĻŦāĻŋāĻ•āĻ˛ā§āĻĒ āĻ•ā§‹āĻĄ āĻŦā§āĻ˛āĻ• āĻšāĻŋāĻ¸āĻžāĻŦā§‡ āĻ•āĻžāĻœ āĻ•āĻ°ā§‡āĨ¤

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

āĻ§āĻ°āĻž āĻ¯āĻžāĻ•, āĻ†āĻŽāĻžāĻĻā§‡āĻ° āĻāĻ•āĻŸāĻŋ āĻĄā§‡ āĻ…āĻĢ āĻĻā§āĻ¯ āĻ‰āĻ‡āĻ• āĻšā§‡āĻ• āĻ•āĻ°āĻ¤ā§‡ āĻšāĻŦā§‡āĨ¤ āĻ†āĻŽāĻ°āĻž āĻāĻŸāĻŋ switch āĻāĻŦāĻ‚ case āĻ¸ā§āĻŸā§‡āĻŸāĻŽā§‡āĻ¨ā§āĻŸ āĻŦā§āĻ¯āĻŦāĻšāĻžāĻ° āĻ•āĻ°ā§‡ āĻ¸āĻšāĻœā§‡āĻ‡ āĻ•āĻ°āĻ¤ā§‡ āĻĒāĻžāĻ°āĻŋāĨ¤

int day = 3;

switch (day) {
  case 1:
    print('Sunday');
    break;
  case 2:
    print('Monday');
    break;
  case 3:
    print('Tuesday');
    break;
  case 4:
    print('Wednesday');
    break;
  case 5:
    print('Thursday');
    break;
  case 6:
    print('Friday');
    break;
  case 7:
    print('Saturday');
    break;
  default:
    print('Invalid day');
}
Enter fullscreen mode Exit fullscreen mode

āĻāĻ–āĻžāĻ¨ā§‡, day = 3 āĻšāĻ“āĻ¯āĻŧāĻžāĻ¯āĻŧ, case 3: āĻŽāĻŋāĻ˛ā§‡ āĻ¯āĻžāĻŦā§‡ āĻāĻŦāĻ‚ Tuesday āĻĒā§āĻ°āĻŋāĻ¨ā§āĻŸ āĻšāĻŦā§‡āĨ¤ āĻāĻ°āĻĒāĻ° break āĻ¸ā§āĻŸā§‡āĻŸāĻŽā§‡āĻ¨ā§āĻŸāĻŸāĻŋ āĻ˛ā§āĻĒ āĻĨā§‡āĻ•ā§‡ āĻŦā§‡āĻ°āĻŋāĻ¯āĻŧā§‡ āĻ¯āĻžāĻŦā§‡āĨ¤

switch āĻāĻŦāĻ‚ case āĻāĻ° āĻ¸ā§āĻŦāĻŋāĻ§āĻž:

  • āĻĒāĻžāĻ āĻ¯ā§‹āĻ—ā§āĻ¯āĻ¤āĻž: āĻ¯āĻ–āĻ¨ āĻ…āĻ¨ā§‡āĻ•āĻ—ā§āĻ˛ā§‹ āĻļāĻ°ā§āĻ¤ āĻĨāĻžāĻ•ā§‡, āĻ¤āĻ–āĻ¨ switch āĻāĻŦāĻ‚ case āĻ•ā§‹āĻĄāĻŸāĻŋ āĻ…āĻ¨ā§‡āĻ• āĻŦā§‡āĻļāĻŋ āĻĒāĻ°āĻŋāĻˇā§āĻ•āĻžāĻ° āĻāĻŦāĻ‚ āĻ¸āĻšāĻœāĻ­āĻžāĻŦā§‡ āĻĒāĻĄāĻŧāĻž āĻ¯āĻžāĻ¯āĻŧ, āĻ¯āĻž if-else āĻšā§‡āĻ¨ā§‡āĻ° āĻ¤ā§āĻ˛āĻ¨āĻžāĻ¯āĻŧ āĻ…āĻ¨ā§‡āĻ• āĻ­āĻžāĻ˛ā§‹āĨ¤
  • āĻĒāĻžāĻ°āĻĢāĻ°āĻŽā§‡āĻ¨ā§āĻ¸: āĻ•āĻŋāĻ›ā§ āĻĒāĻ°āĻŋāĻ¸ā§āĻĨāĻŋāĻ¤āĻŋāĻ¤ā§‡, switch āĻ¸ā§āĻŸā§‡āĻŸāĻŽā§‡āĻ¨ā§āĻŸāĻŸāĻŋ if-else āĻšā§‡āĻ¨ā§‡āĻ° āĻšā§‡āĻ¯āĻŧā§‡ āĻĻā§āĻ°ā§āĻ¤āĻ“ āĻšāĻ¤ā§‡ āĻĒāĻžāĻ°ā§‡, āĻŦāĻŋāĻļā§‡āĻˇ āĻ•āĻ°ā§‡ āĻ¯āĻ–āĻ¨ āĻ…āĻ¨ā§‡āĻ• case āĻĨāĻžāĻ•ā§‡āĨ¤

āĻ¸āĻžāĻ°āĻžāĻ‚āĻļ:

  • switch āĻ¸ā§āĻŸā§‡āĻŸāĻŽā§‡āĻ¨ā§āĻŸ āĻāĻ•āĻŸāĻŋ āĻ¨āĻŋāĻ°ā§āĻĻāĻŋāĻˇā§āĻŸ āĻāĻ•ā§āĻ¸āĻĒā§āĻ°ā§‡āĻļāĻ¨ āĻŦāĻž āĻŽāĻžāĻ¨ āĻ…āĻ¨ā§āĻ¯āĻžāĻ¯āĻŧā§€ āĻāĻ•āĻžāĻ§āĻŋāĻ• case āĻĒāĻ°ā§€āĻ•ā§āĻˇāĻž āĻ•āĻ°ā§‡āĨ¤
  • āĻĒā§āĻ°āĻ¤āĻŋāĻŸāĻŋ case āĻāĻ° āĻœāĻ¨ā§āĻ¯ āĻ¨āĻŋāĻ°ā§āĻĻāĻŋāĻˇā§āĻŸ āĻ•ā§‹āĻĄ āĻŦā§āĻ˛āĻ• āĻšāĻžāĻ˛āĻžāĻ¨ā§‹ āĻšāĻ¯āĻŧ āĻ¯āĻĻāĻŋ āĻļāĻ°ā§āĻ¤ āĻŽā§‡āĻ˛ā§‡, āĻāĻŦāĻ‚ break āĻĻāĻŋāĻ¯āĻŧā§‡ āĻ˛ā§āĻĒ āĻŦāĻ¨ā§āĻ§ āĻšāĻ¯āĻŧāĨ¤
  • default āĻŦā§āĻ˛āĻ•āĻŸāĻŋ āĻŦā§āĻ¯āĻŦāĻšāĻžāĻ° āĻ•āĻ°āĻž āĻšāĻ¯āĻŧ āĻ¯āĻĻāĻŋ āĻ•ā§‹āĻ¨ā§‹ case āĻļāĻ°ā§āĻ¤ āĻŽā§‡āĻ˛ā§‡ āĻ¨āĻžāĨ¤

āĻāĻ­āĻžāĻŦā§‡ switch āĻāĻŦāĻ‚ case āĻŦā§āĻ¯āĻŦāĻšāĻžāĻ° āĻ•āĻ°ā§‡ āĻŦāĻŋāĻ­āĻŋāĻ¨ā§āĻ¨ āĻļāĻ°ā§āĻ¤ā§‡āĻ° āĻ­āĻŋāĻ¤ā§āĻ¤āĻŋāĻ¤ā§‡ āĻ•ā§‹āĻĄā§‡āĻ° āĻĒā§āĻ°āĻŦāĻžāĻš āĻ¨āĻŋāĻ¯āĻŧāĻ¨ā§āĻ¤ā§āĻ°āĻŖ āĻ•āĻ°āĻž āĻ¯āĻžāĻ¯āĻŧāĨ¤

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: