Advertisement
narimetisaigopi

dart_flutter_comments_dartypes_b1

May 8th, 2021
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. void main() {
  2. print('My first Dart App');
  3.  
  4. // int, double, String, bool
  5.  
  6. // variable name should not start with 0 - 9
  7. // variable name should not start with special characters (_,$)
  8. // vriable should not be a keyboard
  9. // case sensitive
  10.  
  11. // comments
  12. // 1) to understand
  13. // 2) to prevent the code compilation
  14.  
  15. /**
  16. * sasa
  17. * sa
  18. * sa
  19. * s
  20. * as
  21. * a
  22. * sa
  23. * s\sasa
  24. *
  25. * sasa
  26. */
  27.  
  28. double price = 89.78;
  29. String name = "Dart Classes";
  30. String myDetails = """adadnanjknalfnafnn kdnklalknfanlfamdma
  31. sasas
  32. asasa
  33. s""";
  34. String collegeName = 'VITS';
  35. bool isAvaible = true;
  36. bool isNotAvaible = false;
  37.  
  38. // datatype variableName = value;
  39.  
  40. int Age = 30;
  41.  
  42. var role = "Sr Software Developer";
  43. var salary = true;
  44.  
  45. final myAge = 25; // final = var + final
  46. print("before $myAge");
  47. // myAge = 37;
  48. // print("after $myAge");
  49. // myAge = 89;
  50. // print("after $myAge");
  51.  
  52. bool myGroup; // false
  53.  
  54. // default value is null for every data type
  55.  
  56. print(myGroup);
  57.  
  58. // print("My age is $age and\n college is $collegeName");
  59. // print("college is $myDetails");
  60. }
  61.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement