본문 바로가기

조용한 담장

검색하기
조용한 담장
프로필사진 iosroid

  • 분류 전체보기 (125)
    • Flutter (43)
    • tips (10)
    • Dart (14)
    • Interesthing (6)
    • python (6)
    • kotlin (40)
    • Blogs I read this week (3)
    • Yocto (1)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags
  • Android
  • ML
  • kotlin
  • Flutter
  • Collection
  • texttheme
  • import
  • 다트
  • DART
  • List
  • crawler
  • variable
  • 클래스
  • pushnamed
  • package
  • 플러터
  • python
  • animation
  • map
  • set
  • 파이썬
  • text
  • 콜렉션
  • textstyle
  • function
  • 크롤러
  • 함수
  • Class
  • 웹크롤러
  • 코틀린
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록Generator (1)

조용한 담장

Dart : Generators

Dart 의 generator 를 살펴보자. generator 의 용도는 to lazily produce a sequence of values 코드상에서 선언된 순간에 바로 데이터가 처리되지 않고 실제로 사용할 때 데이터가 처리된다. 뒤늦게(실제 데이터가 필요할 때) 처리되는 방식은 동기식 과 비동기식이 있다. 둘 다 yield 를 통해 데이터를 전달하는데 return 과 다른점은 처리할 데이터가 있는 동안은 동작을 완료하지 않고 계속 수행하게 된다. Synchronous sync* 속성을 함수가 가지게 된다. Iterable object 를 리턴한다. import 'dart:io'; Iterable generatorSync(int n) sync* { int k=0; while (k < n) { yiel..

Dart 2019. 11. 22. 18:18
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바