[flutter] List, Map

soyyeong·2022년 2월 17일
0

flutter

목록 보기
10/18

리스트

List<String>students = ['a', 'b', 'c', 'd'];

리스트 추가

student.add('e');

리스트 삭제

students.remove('a');

리스트 비었는지 확인

students.isEmpty

리스트 첫, 마지막 요소 접근

students.first;
students.last;

맵(Map)

*맵은 Key-Value 쌍의 자료구조

Map<String, int>students = {'a':1, 'b':2, 'c':3};
studens{'a'}//1

맵의 각 요소는 key를 통해 접근 가능

key : a, b, c
value : 1, 2, 3

profile
블로그 이전 중입니다 : https://soyeong-blog.netlify.app/

0개의 댓글