Coder Social home page Coder Social logo

Comments (16)

 avatar commented on June 15, 2024 1

Thank you for trying again! 🙏

I may have an idea of the cause of the bug, so I will try to take some time to fix this.
But, I can't say when I will do this, I have a lot going on right now.

I will keep you updated! 😄

from flutter_inset_shadow.

vishaljnimblechapps avatar vishaljnimblechapps commented on June 15, 2024 1

@chitochi Okay, but we have the BoxShape.circle shape so you probably need to fix it in an ideal way. Let me know when you get a chance to fix it.

BTW Thanks for the quick replies.

from flutter_inset_shadow.

 avatar commented on June 15, 2024

Hi! Thank you for opening an issue. 🙏

The package changed name to flutter_inset_shadow. If you want to know the reasons why, you can go check the README.md of the project (do not hesitate if you have any question tho).

Can you try again using the latest version of flutter_inset_shadow instead of flutter_inset_box_shadow?

Thanks in advance!

from flutter_inset_shadow.

vishaljnimblechapps avatar vishaljnimblechapps commented on June 15, 2024

@johynpapin Thanks for the quick reply. I have switched to flutter_inset_shadow, but I'm still encountering the same issue I mentioned.

from flutter_inset_shadow.

vishaljnimblechapps avatar vishaljnimblechapps commented on June 15, 2024

Hi @chitochi, have you had a chance to look into this? We have an urgent need for this to be resolved, and it would be greatly appreciated and helpful for us if you could address it.

from flutter_inset_shadow.

chitochi avatar chitochi commented on June 15, 2024

Hi, I will try to take a look today. 👍

from flutter_inset_shadow.

chitochi avatar chitochi commented on June 15, 2024

The issue seems to happen when using BoxShape.circle and a width and height that are not equal. (So it's not about using a dynamic size.)

That's because a circle must have the same width and height. Internally, Flutter uses shortestSide (the minimum of width and height).

So maybe a quick fix is to import dart:math and to use the min function to choose between width and height, for example:

// ...

final width = MediaQuery.of(context).size.width * 0.75;
final height = MediaQuery.of(context).size.height * 0.25;
final size = math.min(width, height);

// ...

return Container(
  width: size,
  height: size,
  // ...
  decoration: const BoxDecoration(
    shape: BoxShape.circle,
    // ...
  ),
  // ...
);

I will try to fix this so that such a quick fix is not needed tho. 😅

from flutter_inset_shadow.

vishaljnimblechapps avatar vishaljnimblechapps commented on June 15, 2024

@chitochi Thank you so much for the quick fix. I understand the issue you just mentioned. I implemented the same, and I can confirm it is working fine.

One more thing I have: what if the container doesn't have width and height? In that case, the shadow size is wrong.

@chitochi Please inform me about this as well.

from flutter_inset_shadow.

chitochi avatar chitochi commented on June 15, 2024

Hi, good to know that it works for you too! 🎉

For a Container without width and height, maybe you can use the AspectRatio widget?

The idea here is to force the Container to be a square.

return AspectRatio(
  aspectRatio: 1, // ensure that the Container will be a square
  child: Container(/* ... */),
);

I am not sure, but maybe you will need to wrap the AspectRatio in a Center widget or something.

This is not ideal tho, only a temporary fix.

from flutter_inset_shadow.

chitochi avatar chitochi commented on June 15, 2024

Just in case, even if you use BoxShape.circle the Container is technically still a square or a rectangle, but it's drawn as a circle. That's why I think ensuring that the Container will be a square will allow you to get a beautiful circle. 🟢

Thank you for opening the issue. 😄

from flutter_inset_shadow.

chitochi avatar chitochi commented on June 15, 2024

Here is a little diagram to explain what I mean:

container_circle

The dotted square is the invisible Container, even with BoxShape.circle applied. The purple circle is what is drawn. But as you can see, the Container is still a square.

from flutter_inset_shadow.

vishaljnimblechapps avatar vishaljnimblechapps commented on June 15, 2024

@chitochi I understand your point, but this fix is not appropriate. If I simply add a margin, it will break again.

from flutter_inset_shadow.

vishaljnimblechapps avatar vishaljnimblechapps commented on June 15, 2024

Hi @chitochi do you have any updates on this?

from flutter_inset_shadow.

chitochi avatar chitochi commented on June 15, 2024

hi, I will try to fix this this week

from flutter_inset_shadow.

chitochi avatar chitochi commented on June 15, 2024

So I fixed this, I will add a message here once it's released.

from flutter_inset_shadow.

chitochi avatar chitochi commented on June 15, 2024

I just released the 2.0.3 version! 🎉
I would very much appreciate a confirmation that the fix works. :3

from flutter_inset_shadow.

Related Issues (10)

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.