본문 바로가기

전체 글65

[Dart] #2.3 Collection For var oldFriends = ['nico', 'lynn']; var newFriends = [ 'lewis', 'ralph', 'darren', for(var friend in oldFriends) "♥ $friend", ]; print(newFriends); collection if : 로그인 여부에 따라 상단바 다르게 하고 싶을 때! collection for : 여러 값 반복 add() 하는거를 한번에! 2024. 1. 10.
[Dart] #2.2 String interpolation '$' var name = 'nico'; var age = 10; var greeting = 'Hello everyone, my name is $name, and I am ${age +2}'; //$ is String Interpolation 2024. 1. 10.
[Dart] #2.1 Lists & collection if List of integers. List numbers = [1,2,3,4]; var numbers = [1,2,3,4]; class called List! so, there are losts of methods you can use ex) numbers.first; = gives first item numbers.last; = gives last item var giveMeFive = true; if (giveMeFive) 5] ; if (giveMeFive) void main () { var giveMeFive = true; var numbers = [1, 2, 3, 4, if (giveMeFive) 5, ]; } 2024. 1. 10.
[Dart] #2.0 Basic Data Types String bool int double Types in Dart are all 'objects', which means it has its own methods that we can use. num -parent int, double -child void main () { var num = 12; num 69.99; } 2024. 1. 10.
[Dart] #1 Variables What you can learn in this post 1. How to declare variables in Dart 2. What is Null Safety 1. How to declare variables in Dart [Can be overwritten later] 1st. Specify type when? class property void main () { int i = 12; i = 121212; } 2nd. var when? local variables in method, small functions local variables void main () { var name = 'la' name = 'lalala' } 3rd. dynamic when? available in all types.. 2024. 1. 10.