Code Monkey home page Code Monkey logo

Comments (5)

jp1017 avatar jp1017 commented on May 12, 2024

现在用的单例提供bloc

from flutter-notebook.

jp1017 avatar jp1017 commented on May 12, 2024

找到问题了,BlocProvider 要先调用

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      child: MaterialApp(
        title: 'scoped',
        theme: ThemeData.dark(),
        home: TopPage(),
      ),
    );
  }
}

from flutter-notebook.

mirkancal avatar mirkancal commented on May 12, 2024

After navigation I get the same error. Do I have to wrap my MaterialApp with BlocProvider?

from flutter-notebook.

nrooban avatar nrooban commented on May 12, 2024

HI guys, this kind of The getter 'id' was called on null. happens because of when you do HotReload.

To reproduce this

  1. Restart the app again(Check the app wether its working fine without doing any modification in hot-reload)
  2. If works fine, do some text or icon change and let hot-reload.
  3. Now do the testing again it will fail with 'The getter 'id' was called on null.'

I too waiting for the solution..

from flutter-notebook.

souravroyrickey avatar souravroyrickey commented on May 12, 2024

I am getting same error but while navigating to a page from a drawer. Below is the code but after number of attempts unable to find solution.

Navigator.push(context,MaterialPageRoute(builder: (context){
final nbloc = BlocProvider.of(context);
return BlocProvider(child: NotificationPage(), bloc: nbloc);
}));

from flutter-notebook.

Related Issues (20)

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.