listen 패키지는 등록된 리스너에게 상태 변경을 알리는 경량이고 순수한 Dart 솔루션을 제공합니다. Flutter 전용 위젯이나 프레임워크에 의존하지 않고 컴포넌트 간의 효율적인 통신을 가능하게 합니다. 단순성과 성능을 고려하여 설계되었으며, 세밀한 업데이트를 지원하고 최소한의 오버헤드가 필요한 상태 관리 시나리오에 적합합니다. 이 패키지는 Flutter가 지원하는 모든 주요 플랫폼에서 작동하므로, 다중 플랫폼 애플리케이션에서 공유 로직을 사용하기에 적합합니다.
사용 사례
실시간 데이터 업데이트
컴포넌트 간 통신
라이브러리 내 상태 관리
이벤트 기반 아키텍처
분리된 UI 및 비즈니스 로직
주요 기능
순수 Dart 구현
최소 성능 오버헤드
세밀한 변경 알림
여러 리스너를 지원
플랫폼 독립적 설계
적합한 대상
상태 알림이 필요한 라이브러리 작성자
프레임워크 종속성 회피 개발자
다중 플랫폼 공유 코드베이스
간단한 상태 관리 필요
고려 사항
완전한 상태 관리 솔루션이 아님
수동 리스너 관리가 필요합니다
제한된 내장 디버깅 도구
UI가 아닌 상태 추적에 가장 적합
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Flutter Core Packages
This repo is a companion to the flutter/flutter
and flutter/packages repositiories. It contains the source code for Flutter's
first-party packages (i.e., packages developed by the core Flutter team) that cannot
depend on Flutter, generally because they are used by the flutter/flutter repository.
Check the packages directory to see all packages.
If you wish to contribute a new package to the Flutter ecosystem, please
see the documentation for developing packages. You can store
your package source code in any GitHub repository (the present repo is only
intended for packages developed by the core Flutter team). Once your package
is ready you can publish
to the pub repository.
If you wish to contribute a change to any of the existing packages in this repo,
please review our contribution guide,
and send a pull request.