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

    앱 상태(AppLifeCycle) 이벤트 얻기

    https://flutter.dev/docs/get-started/flutter-for/android-devs#how-do-i-listen-to-android-activity-li...
  • 2021-05-18 andrew

    기기 고유 식별(Identify) 얻기 device_info

    https://pub.dev/packages/device_infohttps://pub.dev/packages/device_info_plus import 'dart:io'; //Pl...
« 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 )


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