Dev/Flutter

싱글톤 패턴 클래스 생성 - Singleton Pattern

healthyryu 2022. 11. 8. 18:15
class ChatUtil {
  static final ChatUtil _chatUtil = ChatUtil._internal();

  factory ChatUtil() {
    return _chatUtil;
  }

  ChatUtil._internal();
  
  ....
  
}
반응형