GithubHelp home page GithubHelp logo

How to remove a rendered widget? about boxy HOT 4 CLOSED

pingbird avatar pingbird commented on August 29, 2024
How to remove a rendered widget?

from boxy.

Comments (4)

pingbird avatar pingbird commented on August 29, 2024 1

Call source.ignore(): https://pub.dev/documentation/boxy/latest/boxy/BaseBoxyChild/ignore.html

from boxy.

rupinderjeet avatar rupinderjeet commented on August 29, 2024 1

Thank you for your help and this project. There is a lot to learn for me in this codebase. You can close this issue, my query is answered.

from boxy.

rupinderjeet avatar rupinderjeet commented on August 29, 2024

Thank you. This has helped me remove weird offset I was using. However, I have two more related questions.

  1. Is the order of using ignore correct in below code?
final source = getChild(#source);
final sourceSize = source.layout(constraints);
source.position(Offset.zero);
source.ignore();
  1. On a page, If a Hero widget, with tag photo_hero, is nested as a child of this dummy source widget, Boxy will layout it to get the size. But, this also means that I can no longer use the same Hero tag on that page again. Is this right? Hero widget tagged with photo_hero will be used with source widget and I will somehow need to tell actual widget and its Hero widget to use a different tag. Is this right?

from boxy.

pingbird avatar pingbird commented on August 29, 2024

Yes, that is correct, the child still exists in the Element tree preventing you from having an identical Hero. I'm not sure if the framework allows you to create and destroy a child in the same layout pass, that requires some more testing.

from boxy.

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.