Upgrade to Pro — share decks privately, control downloads, hide ads and more …

BloC..? understand by like Android

BloC..? understand by like Android

omjoonkim

July 27, 2019
Tweet

More Decks by omjoonkim

Other Decks in Programming

Transcript

  1. Business Logic Component BLoC? 서비스의 Business Logic을 담은(책임을 가진) 객체

    ୹୊ : https://www.slideshare.net/NaverEngineering/techcon-2019-mobile-android-model
  2. BLoC? The BLoC Pattern has been designed by Paolo Soares

    and Cong Hui, from Google and first presented during the DartConf 2018 (January 23-24, 2018). ୹୊ : https://www.didierboelens.com/2018/08/reactive-programming---streams---bloc/
  3. End

  4. BLoC is ViewModel == Presentation Logic ViewModel == Business Logic

    BLoC == Presentation Logic BLoC == Business Logic
  5. BLoC is ViewModel == Presentation Logic ViewModel == Business Logic

    BLoC == Presentation Logic BLoC == Business Logic
  6. Business Logic Component Rule - BLoC 로직(서비스)이 담긴 객체 The

    BLoC Pattern has been designed by Paolo Soares and Cong Hui, from Google and first presented during the DartConf 2018 (January 23-24, 2018). https://www.youtube.com/watch?v=PLHln7wHgPE ୹୊ : https://www.didierboelens.com/2018/08/reactive-programming---streams---bloc/
  7. Business Logic Component Rule - UI 로직(서비스)이 담긴 객체 The

    BLoC Pattern has been designed by Paolo Soares and Cong Hui, from Google and first presented during the DartConf 2018 (January 23-24, 2018). https://www.youtube.com/watch?v=PLHln7wHgPE ୹୊ : https://www.didierboelens.com/2018/08/reactive-programming---streams---bloc/
  8. On Flutter Repository BLoC UI Rx Rx Rx Rx Stream

    StreamBuilder Databinding Observable or Future with Acync Await
  9. Stream Stream Observable Stream 단독 사용 가능(with StreamController). listen() 을

    통해 Subscription하는 형태로 동작. Subject docs : https://api.dart.dev/stable/2.4.0/dart-async/Stream-class.html
  10. Stream -> Observable Observable Listen Subscription Subject Add (Sink) ଵҊ(ठۑ)

    : https://gdgkr.slack.com/archives/CAT0YEFEY/p1562064409012900
  11. StreamBuilder @override Widget build(BuildContext context) => Scaffold( body: StreamBuilder( stream:

    bloc.state, builder: (context, AsyncSnapshot<HomeState> snapshot) => !snapshot.hasData || snapshot.data.loading ? Center(child: CircularProgressIndicator()) : _buildContentView(topPadding, snapshot.data.meetUps), ), bottomSheet: _buildBottomSheet(bottomPadding) )
  12. StreamBuilder @override Widget build(BuildContext context) => Scaffold( body: StreamBuilder( stream:

    bloc.state, builder: (context, AsyncSnapshot<HomeState> snapshot) => !snapshot.hasData || snapshot.data.loading ? Center(child: CircularProgressIndicator()) : _buildContentView(topPadding, snapshot.data.meetUps), ), bottomSheet: _buildBottomSheet(bottomPadding) )
  13. StreamBuilder @override Widget build(BuildContext context) => Scaffold( body: StreamBuilder( stream:

    bloc.state, builder: (context, AsyncSnapshot<HomeState> snapshot) => !snapshot.hasData || snapshot.data.loading ? Center(child: CircularProgressIndicator()) : _buildContentView(topPadding, snapshot.data.meetUps), ), bottomSheet: _buildBottomSheet(bottomPadding) )
  14. StreamBuilder @override Widget build(BuildContext context) => Scaffold( body: StreamBuilder( stream:

    bloc.state, builder: (context, AsyncSnapshot<HomeState> snapshot) => !snapshot.hasData || snapshot.data.loading ? Center(child: CircularProgressIndicator()) : _buildContentView(topPadding, snapshot.data.meetUps), ), bottomSheet: _buildBottomSheet(bottomPadding) )
  15. StreamBuilder @override Widget build(BuildContext context) => Scaffold( body: StreamBuilder( stream:

    bloc.state, builder: (context, AsyncSnapshot<HomeState> snapshot) => !snapshot.hasData || snapshot.data.loading ? Center(child: CircularProgressIndicator()) : _buildContentView(topPadding,snapshot.data.meetUps), ), bottomSheet: _buildBottomSheet(bottomPadding) )
  16. Di Dependency Injection Inversion of Control Repository UI BLoC bloc

    repository something(api or xx) Maintainability and Testable
  17. Di - Provider 가장 기본적인? DI 방식. ଵҊ : https://pub.dev/packages/provider

    Package로도 지원. ୹୊ : https://medium.com/flutterpub/architect-your-flutter-project-using-bloc-pattern-part-2-d8dd1eca9ba5 InheritedWidget✨
  18. Stateless 더 효율적으로 렌더링 할 수는 없을까? Output이 State하나일 경우

    State가 변경되었을 때 모든 Widget이 다시 Build 된다. BLoC에 관점(플래폼 독립성)에서 가장 효율적인 렌더링 방법은..?
  19. Cons BLoC Deep Dive Advanced ✨ Business Logic of Component

    Rx everywhere DI, Navigation, Stateless )