Giter VIP home page Giter VIP logo

bloc_provider's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bloc_provider's Issues

[Question] The correct way to dispose

I'm new to Dart and Flutter and have questions to how to dispose subjects correctly.

Below is my pseudo code to dispose.

  @override
  void dispose() async {
    await _fooBehaviorSubject.drain<Foo>();
    await _fooBehaviorSubject.close();
    await _barPublishSubject.close();
  }

My questions are:

  1. Is async/await syntax necessary? It seems to be possible that I remove them. like
  @override
  void dispose() {
    _fooBehaviorSubject.drain<Foo>();
    _fooBehaviorSubject.close();
    _barPublishSubject.close();
  }
  1. Is drain<E>() necessary? I had found that it might cause crash w/o this line when I used BehaviorSubject. (It may or may not be my mistake.)

Thank you for your help!

Documentation more clear

You have an amazing library!, but I am doing a transition from React to flutter, and I cannot understand completely your README
I am sure that if I practice I will understand the components but I hate that, could you provide more details about each step in your documentation?.

Cannot create BuildProvider inside screen

Hi @mono0926 ๐Ÿ‘‹
Nice to meet you and thank for useful library that helped me so much in work. ๐Ÿ˜

But I have a concern and I dont know if it's a bug. For example, I have an app with 2 screens: Splash screen and Login screen.
When I define BlocProvider (LoginBloc) for LoginScreen, I cannot define it inside LoginScreen, and I must define it in route, otherwise Invalid arguments error will be raised Invalid argument(s): LoginBloc is not provided to LoginScreen. Context used for Bloc retrieval must be a descendant of BlocProvider.:

// success
(BuildContext context) => BlocProvider<LoginBloc>(
          creator: (_, _bag) => LoginBloc(),
          child: LoginScreen(),
// failed: inside LoginScreen
@override
  Widget build(BuildContext context) {
    return BlocProvider<LoginBloc>(
        creator: (_, _bag) => LoginBloc(),
        child: Scaffold(
          primary: true,
          appBar: EmptyAppBar(),
          body: _buildBody(),
        ));
  }

This is just a minor problem but I dont know if it can be fixed, thank you ๐Ÿ˜

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.