Angular Bloc은 BLoC(Business Logic Component) 디자인 패턴의 구현을 간소화하기 위해 Angular 스타일의 컴포넌트를 제공하는 Flutter 패키지입니다. bloc 상태 관리 라이브러리와 원활하게 통합되어 웹 애플리케이션에서 반응형이고 예측 가능한 상태 처리를 가능하게 합니다. 이 패키지는 Angular 유사한 문법에 맞춰진 지시문과 유틸리티를 제공하여 복잡한 상태 로직을 체계적으로 관리할 수 있도록 도와줍니다. 웹 개발 전용으로 설계되어 코드 정리와 테스트 가능성도 향상시킵니다.
사용 사례
상태 관리로 반응형 웹 UI 만들기
비즈니스 로직과 UI 간의 명확한 분리 구현
확장 가능한 상태 기반 애플리케이션 만들기
비동기 데이터 스트림을 효율적으로 관리하기
기존의 Angular 스타일 워크플로우와의 통합
주요 기능
BLoC 통합을 위한 Angular 스타일 지시문
스트림을 사용한 반응형 상태 처리
bloc 패키지와의 원활한 호환성
비동기 및 이벤트 기반 상태 업데이트 지원
컴포넌트용 내장 라이프사이클 관리
적합한 대상
Angular 패턴에 익숙한 개발자
강력한 상태 관리가 필요한 웹 애플리케이션
상태 로직에 bloc 패키지를 사용하는 팀
테스트 가능성과 유지보수성을 강조하는 프로젝트
복잡한 사용자 상호작용을 가진 애플리케이션
고려 사항
주로 웹 플랫폼용으로 설계됨
bloc 패턴에 대한 이해가 필요합니다
웹 컨텍스트 외부에서는 활용도가 제한됨
간단한 앱에 부담을 줄 수 있음
핵심 기능을 위해 외부의 bloc 패키지에 의존합니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
A predictable state management library that helps implement the BLoC design pattern.
Counter - an example of how to create a CounterBloc (pure dart).
Flutter
Counter - an example of how to create a CounterBloc to implement the classic Flutter Counter app.
Form Validation - an example of how to use the bloc and flutter_bloc packages to implement form validation.
Bloc with Stream - an example of how to hook up a bloc to a Stream and update the UI in response to data from the Stream.
Complex List - an example of how to manage a list of items and asynchronously delete items one at a time using bloc and flutter_bloc.
Infinite List - an example of how to use the bloc and flutter_bloc packages to implement an infinite scrolling list.
Login Flow - an example of how to use the bloc and flutter_bloc packages to implement a Login Flow.
Firebase Login - an example of how to use the bloc and flutter_bloc packages to implement login via Firebase.
Github Search - an example of how to create a Github Search Application using the bloc and flutter_bloc packages.
Weather - an example of how to create a Weather Application using the bloc and flutter_bloc packages. The app uses a RefreshIndicator to implement "pull-to-refresh" as well as dynamic theming.
Todos - an example of how to create a Todos Application using the bloc and flutter_bloc packages.
Timer - an example of how to create a Timer using the bloc and flutter_bloc packages.
Shopping Cart - an example of how to create a Shopping Cart Application using the bloc and flutter_bloc packages based on flutter samples.
Dynamic Form - an example of how to use the bloc and flutter_bloc packages to implement a dynamic form which pulls data from a repository.
Wizard - an example of how to build a multi-step wizard using the bloc and flutter_bloc packages.
Code sharing with bloc - How to share code between a mobile application written with Flutter and a web application written with AngularDart.
Weather app tutorial with flutter_bloc - How to build a weather app which supports dynamic theming, pull-to-refresh, and interacting with a REST API using the bloc and flutter_bloc packages.
Firebase login tutorial with flutter_bloc - How to create a fully functional login/sign up flow using the bloc and flutter_bloc packages with Firebase Authentication and Google Sign In.
Flutter Complete Reference - A book about the Dart programming language (version 2.10, with null safety support) and the Flutter framework (version 1.20). It covers the bloc package (version 6.0.3) in all flavors: bloc, flutter_bloc hydrated_bloc, replay_bloc, bloc_test and cubit.
Extensions
IntelliJ - extends IntelliJ/Android Studio with support for the Bloc library and provides tools for effectively creating Blocs for both Flutter and AngularDart apps.
VSCode - extends VSCode with support for the Bloc library and provides tools for effectively creating Blocs for both Flutter and AngularDart apps.
Community
Learn more at the following links, which have been contributed by the community.
Packages
Bloc.js - A port of the bloc state management library from Dart to JavaScript, by Felix Angelov.