Andrew's Garage

Shrunk Expand

Primary Navigation

싱글톤(Singleton) 클래스

class Singleton {
  static final Singleton _instance = Singleton._internal();

  factory Singleton() {
    return _instance;
  }

  Singleton._internal() { //클래스가 최초 생성될때 1회 발생
    //초기화 코드    
  }
}

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related


Posted on 2021-05-18 1:21 AM by andrew Comment
📂This entry was posted in flutter

Related Posts

  • 2021-05-18 andrew

    QR 코드 스캔(QR Code Scan) 초간단 예제(Simple example)

    https://pub.dev/packages 에서 qrscan 검색 AndroidManifest.xml 퍼미션 추가 위치 : project/android/app/src/main/A...
  • 2021-05-18 andrew

    Back Button 막기(Disable Back Button)

    WillPopScope 위젯을 사용한다. scaffold를 WillPopScope로 감싸서 처리 한다. return Scaffold( appBar: AppBar( title: Te...
« machine_learning_flutter_app QR 코드 스캔(QR Code Scan) 초간단 예제(Simple example) »

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

( optional )


©2023 boots Entries RSS and Comments RSS Child theme Boots of Raindrops Theme