Comments (16)
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.
@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.
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.
@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.
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.
Hi, I will try to take a look today. 👍
from flutter_inset_shadow.
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.
@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.
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.
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.
Here is a little diagram to explain what I mean:
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.
@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.
Hi @chitochi do you have any updates on this?
from flutter_inset_shadow.
hi, I will try to fix this this week
from flutter_inset_shadow.
So I fixed this, I will add a message here once it's released.
from flutter_inset_shadow.
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)
- Shadows with opacity are not applied HOT 3
- Flutter inset Box Shadow HOT 3
- Blocky gradients on iOS devices when new Flutter Impeller rendering engine enabled HOT 2
- Support `ShapeDecoration` HOT 4
- Inset on multiple widget is expensive HOT 3
- Shadow with opacity less then .3 is invisible. HOT 4
- Inset Shadow not compatible with new Impeller engine HOT 1
- Cant use normal decoration Image HOT 2
- Shadow not rendering on web in a mobile layout HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_inset_shadow.