Code Monkey home page Code Monkey logo

Comments (4)

emanuel-braz avatar emanuel-braz commented on June 15, 2024

@bambinoua Hi, I am not able to reproduce this issue.

May you fork this repo (https://github.com/emanuel-braz/bugfix-4) and make this issue reproducible. So I can investigate the problem deeply.

I've tried to reproduce the problem, but it works as expected.

from one_context.

bambinoua avatar bambinoua commented on June 15, 2024

@emanuel-braz unfortunately I cannot do this because I am work on remote PC with strong security. The only thing I can do is description of the problem. I have a flutter web project. I have a dialog which I display using showDialog. In displayed Dialog is have a TextField which cannot be empty (for some text commands) and button for sending commands. So when I click the button and TextField is empty I need to show warning (what I do with your OneContext) but get the error.

I did this:

try {
  OneContext().showSnackBar(
      builder: (_) => SnackBar(content: Text('My awesome snackBar!'))
  );
} on Error catch(e) {
  print(e); // error -> NoSuchMethodError: tried to call a non-function, such as null: 'this[_showSnackBar]'
}

I set a breakpoint in catch block and after continue I get this in console:

OneContext not initiated! Please use builder method. You need to use OneContext.builder to be able to show dialogs and overlays.

I tried to show dialog with OneContext().showDialog hoping it helps but get the similar error

TypeError: this[_showDialog] is not a function.

So where I need to use builder?

And yes, MaterialApp of course initially built and I tried to use dialog in already redrawn widget.

from one_context.

emanuel-braz avatar emanuel-braz commented on June 15, 2024

@bambinoua you must to use the builder method in MaterialApp builder parameter

builder: OneContext().builder

e.g:

return MaterialApp(
    builder: OneContext().builder,
    navigatorKey: OneContext().key,
);

If you can't fork, could you create a repository in github.com with the minimum code reproducing the issue?

from one_context.

emanuel-braz avatar emanuel-braz commented on June 15, 2024

I'm closing this issue because of inactivity

from one_context.

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.